Skip to content

Commit 8e2f496

Browse files
committed
Fix Page.values check before editing
This is old code. i is not used anymore and currentField is not the index for the values we want to edit.
1 parent 9a73ac4 commit 8e2f496

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/SCRIPTS/BF/ui.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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)