Skip to content

Commit f8c7a79

Browse files
authored
Fix TEXT_COLOR bug + other fixes (#297)
Fix TEXT_COLOR bug + other fixes
2 parents 48c39d3 + 8e2f496 commit f8c7a79

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/SCRIPTS/BF/radios.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ local supportedRadios =
3434
resolution = lcdResolution.high,
3535
MenuBox = { x=120, y=100, w=200, x_offset=68, h_line=20, h_offset=6 },
3636
SaveBox = { x=120, y=100, w=180, x_offset=12, h=60, h_offset=12 },
37-
NoTelem = { 192, LCD_H - 28, "No Telemetry", TEXT_COLOR + INVERS + BLINK },
37+
NoTelem = { 192, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
3838
textSize = 0,
3939
yMinLimit = 35,
4040
yMaxLimit = 235,
@@ -45,7 +45,7 @@ local supportedRadios =
4545
resolution = lcdResolution.high,
4646
MenuBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=200, x_offset=68, h_line=20, h_offset=6 },
4747
SaveBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=180, x_offset=12, h=60, h_offset=12 },
48-
NoTelem = { LCD_W/2 - 50, LCD_H - 28, "No Telemetry", TEXT_COLOR + INVERS + BLINK },
48+
NoTelem = { LCD_W/2 - 50, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
4949
textSize = 0,
5050
yMinLimit = 35,
5151
yMaxLimit = 435,

src/SCRIPTS/BF/ui.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ local function incMax(val, inc, base)
144144
return ((val + inc + base - 1) % base) + 1
145145
end
146146

147-
local function clipValue(val,min,max)
147+
function clipValue(val,min,max)
148148
if val < min then
149149
val = min
150150
elseif val > max then
@@ -239,7 +239,6 @@ end
239239

240240
local function incValue(inc)
241241
local f = Page.fields[currentField]
242-
local idx = f.i or currentField
243242
local scale = (f.scale or 1)
244243
local mult = (f.mult or 1)
245244
f.value = clipValue(f.value + ((inc*mult)/scale), ((f.min or 0)/scale), ((f.max or 255)/scale))
@@ -384,9 +383,8 @@ local function run_ui(event)
384383
incField(1)
385384
elseif event == EVT_VIRTUAL_ENTER then
386385
if Page then
387-
local field = Page.fields[currentField]
388-
local idx = field.i or currentField
389-
if Page.values and Page.values[idx] and (field.ro ~= true) then
386+
local f = Page.fields[currentField]
387+
if Page.values and Page.values[f.vals[#f.vals]] and not f.ro then
390388
pageState = pageStatus.editing
391389
end
392390
end

0 commit comments

Comments
 (0)