SCN.seq改名SCN.stack

This commit is contained in:
MrZ626
2020-12-06 15:27:09 +08:00
parent d2e6631b46
commit dcc887583f

View File

@@ -14,7 +14,7 @@ local SCN={
time=nil, --Full swap time time=nil, --Full swap time
draw=nil, --Swap draw func draw=nil, --Swap draw func
}, },
seq={"quit","slowFade"},--Back sequence stack={"quit","slowFade"},--Scene stack
scenes=scenes, scenes=scenes,
@@ -80,13 +80,13 @@ function SCN.init(s,org)
end end
function SCN.push(tar,style) function SCN.push(tar,style)
if not SCN.swapping then if not SCN.swapping then
local m=#SCN.seq local m=#SCN.stack
SCN.seq[m+1]=tar or SCN.cur SCN.stack[m+1]=tar or SCN.cur
SCN.seq[m+2]=style or"fade" SCN.stack[m+2]=style or"fade"
end end
end end
function SCN.pop() function SCN.pop()
local _=SCN.seq local _=SCN.stack
_[#_],_[#_-1]=nil _[#_],_[#_-1]=nil
end end
@@ -153,10 +153,10 @@ function SCN.back()
if SCN.sceneBack then SCN.sceneBack()end if SCN.sceneBack then SCN.sceneBack()end
--Poll&Back to previous Scene --Poll&Back to previous Scene
local m=#SCN.seq local m=#SCN.stack
if m>0 then if m>0 then
SCN.swapTo(SCN.seq[m-1],SCN.seq[m]) SCN.swapTo(SCN.stack[m-1],SCN.stack[m])
SCN.seq[m],SCN.seq[m-1]=nil SCN.stack[m],SCN.stack[m-1]=nil
end end
end end
return SCN return SCN