THEME做成独立模块

This commit is contained in:
MrZ626
2021-03-18 12:59:00 +08:00
parent d9a9747901
commit 5f633efa59
7 changed files with 85 additions and 83 deletions

View File

@@ -470,30 +470,13 @@ function commands.setbg(name)
end
end
function commands.theme(name)
if name=="classic"then
THEME=false
BG.setDefault("space")
BGM.setDefault("blank")
BGM.play()
elseif name=="xmas"then
THEME="xMas"
BG.setDefault("snow")
BGM.setDefault("mXmas")
BGM.play()
elseif name=="sprfes"then
THEME="sprFes"
BG.setDefault("firework")
BGM.setDefault("spring festival")
BGM.play()
elseif name=="zday"then
THEME="zDay"
BG.setDefault("lanterns")
BGM.setDefault("overzero")
BGM.play()
else
if name~=""then
if name~=""then
if THEME.set(name)then
log("Theme set to: "..name)
else
log("No theme called "..name)
end
else
log{C.water,"Usage: theme [themeName]"}
end
end

View File

@@ -8,8 +8,6 @@ local scene={}
local t1,t2,animateType
function scene.sceneInit()
BG.set()
BGM.play()
t1,t2=0,0--Timer
animateType={rnd(5),rnd(5),rnd(5),rnd(5),rnd(5),rnd(5),rnd(5),rnd(5)}--Random animation type
end

View File

@@ -182,15 +182,7 @@ local loadingThread=coroutine.create(function()
authToken=USER.authToken,
})
]]
if THEME=="Xmas"then
LOG.print("==============",COLOR.red)
LOG.print("Merry Christmas!",COLOR.white)
LOG.print("==============",COLOR.red)
elseif THEME=="sprFes"then
LOG.print(" ★☆☆★",COLOR.red)
LOG.print("新年快乐!",COLOR.white)
LOG.print(" ★☆☆★",COLOR.red)
end
THEME.fresh()
while true do
if math.random()<.126 then
upFloor()