cmd新增setbg命令

This commit is contained in:
MrZ626
2021-03-18 11:12:18 +08:00
parent 49dc6f90bc
commit d5043446d9

View File

@@ -193,6 +193,14 @@ do--commands.help(arg)
"Usage: stopbgm" "Usage: stopbgm"
}, },
}, },
setbg={
description="Set background.",
details={
"Set background.",
"",
"Usage: setbg <classic|xmas|sprfes|zday>",
},
},
theme={ theme={
description="Load a theme.", description="Load a theme.",
details={ details={
@@ -223,6 +231,7 @@ do--commands.help(arg)
"play", "play",
"playbgm", "playbgm",
"stopbgm", "stopbgm",
"setbg",
"theme", "theme",
} }
local pageSize=10 local pageSize=10
@@ -436,6 +445,21 @@ end
function commands.stopbgm() function commands.stopbgm()
BGM.stop() BGM.stop()
end end
function commands.setbg(name)
if name~=""then
if name~=BG.cur then
local t=BG.cur
BG.set(name)
if t==BG.cur then
log("No background called "..name)
else
log("Background set to: "..name)
end
end
else
log{C.water,"Usage: setbg [bgName]"}
end
end
function commands.theme(name) function commands.theme(name)
if name=="classic"then if name=="classic"then
THEME=false THEME=false