大多数菜单的二次确认统一用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

@@ -39,8 +39,6 @@ end}
local scene={}
local sure
local function _playRep(fileName)
local rep=DATA.parseReplay(fileName,true)
if not rep.available then
@@ -72,7 +70,6 @@ end
function scene.sceneInit()
BG.set()
sure=0
listBox:setList(REPLAY)
local hide=listBox:getLen()==0
for i=3,5 do
@@ -121,8 +118,7 @@ function scene.keyDown(key)
elseif key=='delete'then
local rep=listBox:getSel()
if rep then
if sure>.3 then
sure=0
if tryDelete()then
listBox:remove()
love.filesystem.remove(rep.fileName)
for i=1,#REPLAY do
@@ -132,9 +128,6 @@ function scene.keyDown(key)
end
end
SFX.play('finesseError',.7)
else
sure=1
MES.new('info',text.sureReset)
end
end
else
@@ -142,12 +135,6 @@ function scene.keyDown(key)
end
end
function scene.update(dt)
if sure>0 then
sure=sure-dt
end
end
scene.widgetList={
listBox,
WIDGET.newButton{name='export',x=180,y=640,w=140,h=80,color='lG',code=pressKey'cC',font=50,fText=CHAR.icon.export},