Changes to the command "festival" (#54)

- festival no longer takes "flag" as a valid argument
- `festival list` is now accepted, displaying a list of available
  festivals
- festival will now prompt usage, rather than complain about an invalid
  festival, on empty args
- added help for this command
This commit is contained in:
user670
2021-03-08 07:26:12 +08:00
committed by GitHub
parent 74622c377f
commit 02051b5413

View File

@@ -185,6 +185,16 @@ local command_help_messages={
"play <mode_name>" "play <mode_name>"
} }
}, },
festival={
description="Load a festival theme.",
details={
"Load a festival theme.",
"",
"Usage:",
"festival list",
"festival <festival_name>"
}
},
} }
-- while I could have used a for loop to get this... the order at which the -- while I could have used a for loop to get this... the order at which the
@@ -204,6 +214,7 @@ local command_help_list={
"rmwtm", "rmwtm",
"unlockall", "unlockall",
"play", "play",
"festival"
} }
local command_help_page_size=10 local command_help_page_size=10
@@ -305,13 +316,9 @@ function commands.play(m)--marathon_bfmax can only entered through here
end end
end end
function commands.festival(name) function commands.festival(name)
if name=="flag"then if name=="list" then
BG.setDefault("none") log("Available festivals:")
BGM.setDefault(false) log("classic xmas sprfes zday")
BG.set("none")
BGM.stop()
SFX.play("clear_4")
LOG.print("What are you looking for?",COLOR.G)
elseif name=="classic"then elseif name=="classic"then
FESTIVAL=false FESTIVAL=false
BG.setDefault("space") BG.setDefault("space")
@@ -332,7 +339,7 @@ function commands.festival(name)
BG.setDefault("lanterns") BG.setDefault("lanterns")
BGM.setDefault("overzero") BGM.setDefault("overzero")
BGM.play() BGM.play()
elseif name then elseif name~="" then
log("No festival called "..name) log("No festival called "..name)
else else
log"Usage: festival [festivalName]" log"Usage: festival [festivalName]"