简化代码

This commit is contained in:
MrZ626
2020-12-28 22:13:19 +08:00
parent cbd013d2f5
commit 27baab2f57
3 changed files with 6 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ local BGlist={
} }
local BG={ local BG={
cur="none", cur="none",
defaultBG="none", default="none",
init=false, init=false,
resize=false, resize=false,
update=NULL, update=NULL,
@@ -24,12 +24,12 @@ function BG.send(...)
BG.event(...) BG.event(...)
end end
end end
function BG.setDefaultBG(bg) function BG.setDefault(bg)
defaultBG=bg BG.default=bg
end end
function BG.set(background) function BG.set(background)
if not background then if not background then
background=defaultBG background=BG.default
end end
if background==BG.cur or not SETTING.bg then return end if background==BG.cur or not SETTING.bg then return end
BG.discard() BG.discard()

View File

@@ -353,4 +353,4 @@ do
end end
end end
BG.setDefaultBG(FESTIVAL=="Xmas"and"snow"or"space") BG.setDefault(FESTIVAL=="Xmas"and"snow"or"space")

View File

@@ -45,10 +45,7 @@ local tip
function scene.sceneInit() function scene.sceneInit()
tip=text.getTip() tip=text.getTip()
BG.set( BG.set()
FESTIVAL=="Xmas"and"snow"or
"space"
)
GAME.modeEnv=NONE GAME.modeEnv=NONE
--Create demo player --Create demo player