大多数菜单的二次确认统一用tryXXX管理

This commit is contained in:
MrZ626
2021-11-30 01:12:18 +08:00
parent e3db564a4b
commit 5d86925a8a
14 changed files with 43 additions and 70 deletions

View File

@@ -9,11 +9,9 @@ local gc_setColor,gc_print=gc.setColor,gc.print
local scene={}
local cur--Cursor position
local sure
function scene.sceneInit()
cur=#BAG
sure=0
end
function scene.sceneBack()
saveFile(DATA.copySequence(),'conf/customSequence')
@@ -66,14 +64,10 @@ function scene.keyDown(key)
cur=cur-1
end
elseif key=='delete'then
if sure>.3 then
if tryReset()then
TABLE.cut(BAG)
cur=0
sure=0
SFX.play('finesseError',.7)
else
sure=1
MES.new('info',text.sureReset)
end
elseif key=='='then
local l={1,2,3,4,5,6,7}
@@ -119,12 +113,6 @@ function scene.keyDown(key)
end
end
function scene.update(dt)
if sure>0 then
sure=sure-dt
end
end
local blockCharWidth={}for i=1,#BLOCK_CHARS do blockCharWidth[i]=gc.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth()end
function scene.draw()
--Draw frame