From 720325fcb9cd4fc2949a16c7c7df87fc12bfd368 Mon Sep 17 00:00:00 2001 From: C6H12O6 + NaCl + H2O <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:56:58 +0700 Subject: [PATCH] Add touch gesture for radar (#1030) --- parts/scenes/pause.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index d7ca7f8b..213b988f 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -1,5 +1,5 @@ local GAME,SCR=GAME,SCR -local sin,log=math.sin,math.log10 +local sin,log,abs=math.sin,math.log10,math.abs local GC=GC local scene={} @@ -9,6 +9,7 @@ local page local timer1,timer2-- Animation timer local form-- Form of clear & spins local radar-- Radar chart +local radarOrgTouchPos-- For storing the first touch position in radar area local val-- Radar chart normalizer local standard-- Standard hexagon local chartColor-- Color of radar chart @@ -169,6 +170,23 @@ function scene.keyDown(key,isRep) end end +function scene.touchDown(x,y) + if 535=50 and 'tab' or 'Stab') + radarOrgTouchPos=nil +end +scene.mouseUp=scene.touchUp +scene.mouseDown=scene.touchDown + function scene.update(dt) if not (GAME.result or GAME.replaying) then GAME.pauseTime=GAME.pauseTime+dt @@ -363,4 +381,4 @@ scene.widgetList={ WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey'o',hideF=function() return not (GAME.result or GAME.replaying) or GAME.initPlayerCount>1 or GAME.saved end}, } -return scene +return scene \ No newline at end of file