简化代码
This commit is contained in:
@@ -7,7 +7,7 @@ local BGlist={
|
||||
}
|
||||
local BG={
|
||||
cur="none",
|
||||
defaultBG="none",
|
||||
default="none",
|
||||
init=false,
|
||||
resize=false,
|
||||
update=NULL,
|
||||
@@ -24,12 +24,12 @@ function BG.send(...)
|
||||
BG.event(...)
|
||||
end
|
||||
end
|
||||
function BG.setDefaultBG(bg)
|
||||
defaultBG=bg
|
||||
function BG.setDefault(bg)
|
||||
BG.default=bg
|
||||
end
|
||||
function BG.set(background)
|
||||
if not background then
|
||||
background=defaultBG
|
||||
background=BG.default
|
||||
end
|
||||
if background==BG.cur or not SETTING.bg then return end
|
||||
BG.discard()
|
||||
|
||||
2
main.lua
2
main.lua
@@ -353,4 +353,4 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
BG.setDefaultBG(FESTIVAL=="Xmas"and"snow"or"space")
|
||||
BG.setDefault(FESTIVAL=="Xmas"and"snow"or"space")
|
||||
|
||||
@@ -45,10 +45,7 @@ local tip
|
||||
|
||||
function scene.sceneInit()
|
||||
tip=text.getTip()
|
||||
BG.set(
|
||||
FESTIVAL=="Xmas"and"snow"or
|
||||
"space"
|
||||
)
|
||||
BG.set()
|
||||
|
||||
GAME.modeEnv=NONE
|
||||
--Create demo player
|
||||
|
||||
Reference in New Issue
Block a user