简化代码
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
2
main.lua
2
main.lua
@@ -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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user