From f1517fad1a15c0f5ab990ae6b84a652413533520 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Wed, 25 Jan 2023 03:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=9C=B0=E5=9B=BE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=8C=89f2=E5=BC=80=E5=85=B3=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=EF=BC=88=E6=96=B9=E4=BE=BF=E7=9C=8B=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=89=20close=20#827?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/mode.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/parts/scenes/mode.lua b/parts/scenes/mode.lua index 1a166eba..12a7e38f 100644 --- a/parts/scenes/mode.lua +++ b/parts/scenes/mode.lua @@ -21,10 +21,12 @@ local mapCam={ } local visibleModes local touchDist +local grid local scene={} function scene.enter() + grid=false BG.set() mapCam.zoomK=SCN.prev=='main' and 5 or 1 visibleModes={}-- 1=unlocked, 2=locked but visible @@ -141,6 +143,8 @@ function scene.keyDown(key,isRep) end elseif key=='f1' then SCN.go('mod') + elseif key=='f2' then + grid=not grid elseif key=='escape' then if mapCam.sel then mapCam.sel=false @@ -223,6 +227,21 @@ function scene.draw() gc_scale(mapCam.zoomK^.7) gc_applyTransform(mapCam.xOy); + if grid then + gc_setColor(1,0,.26,.26) + gc_setLineWidth(1) + for x=-2000,2000,200 do + gc_line(x,-2200,x,1000) + end + for y=-2200,1000,200 do + gc_line(-2000,y,2000,y) + end + gc_setColor(1,0,.26,.626) + gc_setLineWidth(2) + gc_line(0,-2200,0,1000) + gc_line(-2000,0,1000,0) + end + local R=RANKS local sel=mapCam.sel