mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
Fix CUSTOM_COLOR,… (#3489)
* Fix CUSTOM_COLOR, also change to way setColor work to a more natural : lcd.setColor(CUSTOM_COLOR, RED) * Remove _INDEX from TBS main to match the recent change to setColor
This commit is contained in:
parent
77888ae200
commit
24abad55ca
3 changed files with 31 additions and 27 deletions
|
@ -855,6 +855,7 @@ const luaR_value_entry opentxConstants[] = {
|
|||
#endif
|
||||
#if defined(COLORLCD)
|
||||
{ "COLOR", ZoneOption::Color },
|
||||
{ "CUSTOM_COLOR_INDEX", CUSTOM_COLOR_INDEX },
|
||||
{ "TEXT_COLOR_INDEX", TEXT_COLOR_INDEX },
|
||||
{ "TEXT_BGCOLOR_INDEX", TEXT_BGCOLOR_INDEX },
|
||||
{ "TEXT_INVERTED_COLOR_INDEX", TEXT_INVERTED_COLOR_INDEX },
|
||||
|
@ -881,6 +882,7 @@ const luaR_value_entry opentxConstants[] = {
|
|||
{ "HEADER_ICON_BGCOLOR_INDEX", HEADER_ICON_BGCOLOR_INDEX },
|
||||
{ "HEADER_CURRENT_BGCOLOR_INDEX", HEADER_CURRENT_BGCOLOR_INDEX },
|
||||
{ "OVERLAY_COLOR_INDEX", OVERLAY_COLOR_INDEX },
|
||||
{ "CUSTOM_COLOR", CUSTOM_COLOR },
|
||||
{ "TEXT_COLOR", TEXT_COLOR },
|
||||
{ "TEXT_BGCOLOR", TEXT_BGCOLOR },
|
||||
{ "TEXT_INVERTED_COLOR", TEXT_INVERTED_COLOR },
|
||||
|
@ -915,6 +917,8 @@ const luaR_value_entry opentxConstants[] = {
|
|||
{ "YELLOW", (double)YELLOW },
|
||||
{ "BLUE", (double)BLUE },
|
||||
{ "LIGHTGREY", (double)LIGHTGREY },
|
||||
{ "RED", (double)RED },
|
||||
{ "DARKRED", (double)DARKRED },
|
||||
#endif
|
||||
#if defined(PCBTARANIS)
|
||||
{ "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) },
|
||||
|
|
|
@ -560,8 +560,8 @@ static int luaLcdDrawCombobox(lua_State *L)
|
|||
static int luaLcdSetColor(lua_State *L)
|
||||
{
|
||||
if (!luaLcdAllowed) return 0;
|
||||
int index = luaL_checkinteger(L, 1);
|
||||
int color = luaL_checkinteger(L, 2);
|
||||
unsigned int index = luaL_checkunsigned(L, 1) >> 16;
|
||||
unsigned int color = luaL_checkunsigned(L, 2);
|
||||
lcdColorTable[index] = color;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue