mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 04:15:26 +03:00
Horus Shadowed (#4979)
* Introduce SHADOWED and use it for BattCheck * numbers too * For drawTimer too * Compilation fix
This commit is contained in:
parent
5f76e61240
commit
726b989f6c
4 changed files with 33 additions and 21 deletions
|
@ -1238,6 +1238,7 @@ const luaR_value_entry opentxConstants[] = {
|
|||
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
||||
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
||||
#if defined(COLORLCD)
|
||||
{ "SHADOWED", SHADOWED },
|
||||
{ "COLOR", ZoneOption::Color },
|
||||
{ "CUSTOM_COLOR", CUSTOM_COLOR },
|
||||
{ "TEXT_COLOR", TEXT_COLOR },
|
||||
|
|
|
@ -205,8 +205,9 @@ See the [Appendix](../appendix/fonts.md) for available characters in each font s
|
|||
* `SMLSIZE` small font
|
||||
* `INVERS` inverted display
|
||||
* `BLINK` blinking text
|
||||
* `SHADOWED` Horus only, apply a shadow effect
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1
|
||||
*/
|
||||
static int luaLcdDrawText(lua_State *L)
|
||||
{
|
||||
|
@ -215,6 +216,9 @@ static int luaLcdDrawText(lua_State *L)
|
|||
int y = luaL_checkinteger(L, 2);
|
||||
const char * s = luaL_checkstring(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
#if defined(COLORLCD)
|
||||
if ((att&SHADOWED) && !(att&INVERS)) lcdDrawText(x+1, y+1, s, att&0xFFFF);
|
||||
#endif
|
||||
lcdDrawText(x, y, s, att);
|
||||
return 0;
|
||||
}
|
||||
|
@ -232,8 +236,9 @@ Display a value formatted as time at (x,y)
|
|||
* `0 or not specified` normal representation (minutes and seconds)
|
||||
* `TIMEHOUR` display hours
|
||||
* other general LCD flag also apply
|
||||
* `SHADOWED` Horus only, apply a shadow effect
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1
|
||||
*/
|
||||
static int luaLcdDrawTimer(lua_State *L)
|
||||
{
|
||||
|
@ -243,6 +248,7 @@ static int luaLcdDrawTimer(lua_State *L)
|
|||
int seconds = luaL_checkinteger(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
#if defined(COLORLCD)
|
||||
if (att&SHADOWED) drawTimer(x+1, y+1, seconds, (att&0xFFFF)|LEFT);
|
||||
drawTimer(x, y, seconds, att|LEFT);
|
||||
#else
|
||||
drawTimer(x, y, seconds, att|LEFT, att);
|
||||
|
@ -264,8 +270,9 @@ Display a number at (x,y)
|
|||
* `PREC1` display with one decimal place (number 386 is displayed as 38.6)
|
||||
* `PREC2` display with tow decimal places (number 386 is displayed as 3.86)
|
||||
* other general LCD flag also apply
|
||||
* `SHADOWED` Horus only, apply a shadow effect
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1
|
||||
*/
|
||||
static int luaLcdDrawNumber(lua_State *L)
|
||||
{
|
||||
|
@ -274,6 +281,9 @@ static int luaLcdDrawNumber(lua_State *L)
|
|||
int y = luaL_checkinteger(L, 2);
|
||||
int val = luaL_checkinteger(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
#if defined(COLORLCD)
|
||||
if ((att&SHADOWED) && !(att&INVERS)) lcdDrawNumber(x, y, val, att&0xFFFF);
|
||||
#endif
|
||||
lcdDrawNumber(x, y, val, att);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue