mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 15:55:26 +03:00
Lua themes with no options wouldn't load anymore (got broken in b4939… (#5351)
* Lua themes with no options wouldn't load anymore (got broken in b493973d7d
)
* Keep protection
* Changes according to PR comments
This commit is contained in:
parent
f7828ad4a3
commit
7f4daf3f5b
1 changed files with 10 additions and 7 deletions
|
@ -234,14 +234,17 @@ void luaLoadThemeCallback()
|
|||
}
|
||||
|
||||
if (name) {
|
||||
ZoneOption * options = createOptionsArray(themeOptions, MAX_THEME_OPTIONS);
|
||||
if (options) {
|
||||
LuaTheme * theme = new LuaTheme(name, options);
|
||||
theme->loadFunction = loadFunction;
|
||||
theme->drawBackgroundFunction = drawBackgroundFunction;
|
||||
theme->drawTopbarBackgroundFunction = drawTopbarBackgroundFunction;
|
||||
TRACE("Loaded Lua theme %s", name);
|
||||
ZoneOption * options = NULL;
|
||||
if (themeOptions) {
|
||||
options = createOptionsArray(themeOptions, MAX_THEME_OPTIONS);
|
||||
if (!options)
|
||||
return;
|
||||
}
|
||||
LuaTheme * theme = new LuaTheme(name, options);
|
||||
theme->loadFunction = loadFunction;
|
||||
theme->drawBackgroundFunction = drawBackgroundFunction;
|
||||
theme->drawTopbarBackgroundFunction = drawTopbarBackgroundFunction;
|
||||
TRACE("Loaded Lua theme %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue