From f0b12799b890a70d24ec2851a2ec0ece8160a2f4 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 12 Aug 2021 19:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6=E7=9A=84pr?= =?UTF-8?q?=E9=87=8C=E4=B8=80=E4=BA=9B=E5=B0=8F=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C=E7=BE=8E=E5=8C=96?= =?UTF-8?q?=E6=9C=AA=E8=A7=A3=E9=94=81=E7=9A=84=E6=A8=A1=E5=BC=8F=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/mode.lua | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) 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