diff --git a/parts/scenes/mode.lua b/parts/scenes/mode.lua index 6e402df0..25177a1e 100644 --- a/parts/scenes/mode.lua +++ b/parts/scenes/mode.lua @@ -23,6 +23,7 @@ local mapCam={ zoomMethod=false, zoomK=false, } +local visibleModes local touchDist local scene={} @@ -30,12 +31,14 @@ local scene={} function scene.sceneInit(org) BG.set() mapCam.zoomK=org=='main'and 5 or 1 - VisibleModes = {} -- 1 for unlocked, 2 for locked but visible + visibleModes={}--1=unlocked, 2=locked but visible for name,M in next,MODES do - if RANKS[name]and M.unlock and M.x then - VisibleModes[name] = 1 - for _=1,#M.unlock do - VisibleModes[M.unlock[_]] = VisibleModes[M.unlock[_]] or 2 + if RANKS[name]and M.x then + visibleModes[name]=1 + if M.unlock then + for i=1,#M.unlock do + visibleModes[M.unlock[i]]=visibleModes[M.unlock[i]]or 2 + end end end end @@ -50,7 +53,7 @@ end local function onModeRaw(x,y) for name,M in next,MODES do - if VisibleModes[name]and M.x then + if visibleModes[name]and M.x then local s=M.size if M.shape==1 then if x>M.x-s and xM.y-s and y