Skip to content

Commit

Permalink
Multiplayer|libdoomsday: Command formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 7, 2019
1 parent cec1a79 commit 5fbeb59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doomsday/libs/doomsday/include/doomsday/doomsdayinfo.h
Expand Up @@ -55,7 +55,7 @@ class LIBDOOMSDAY_PUBLIC DoomsdayInfo

OptionType type;
String title;
String command; // e.g., "setmap %1"
String command; // e.g., "setmap %s"
Value defaultValue;
de::List<Value> allowedValues;

Expand Down
18 changes: 9 additions & 9 deletions doomsday/libs/doomsday/src/doomsdayinfo.cpp
Expand Up @@ -90,15 +90,15 @@ List<DoomsdayInfo::GameOption> DoomsdayInfo::gameOptions(const String &gameId)
// Common options.
opts << GameOption(Choice,
"Game type",
"server-game-deathmatch %1",
"server-game-deathmatch %s",
GOValue(),
List<GOValue>({GOValue("0", "Co-op", "coop"),
GOValue("1", "Deathmatch", "dm"),
GOValue("2", "Deathmatch II", "dm2")}));

opts << GameOption(Choice,
"Skill level",
"server-game-skill %1",
"server-game-skill %s",
GOValue(),
List<GOValue>({GOValue("0", "Novice", "skill1"),
GOValue("1", "Easy", "skill2"),
Expand All @@ -108,40 +108,40 @@ List<DoomsdayInfo::GameOption> DoomsdayInfo::gameOptions(const String &gameId)

opts << GameOption(Toggle,
"Players can jump",
"server-game-jump %1",
"server-game-jump %s",
GOValue(),
List<GOValue>({GOValue("0"), GOValue("1", "", "jump")}));

opts << GameOption(Toggle,
"Monsters disabled",
"server-game-nomonsters %1",
"server-game-nomonsters %s",
GOValue(),
List<GOValue>({GOValue("0"), GOValue("1", "", "nomonst")}));

if (!gameId.beginsWith("hexen"))
{
opts << GameOption(Toggle,
"Respawn monsters",
"server-game-respawn %1",
"server-game-respawn %s",
GOValue(),
List<GOValue>({GOValue("0"), GOValue("1", "", "respawn")}));
}

if (gameId.beginsWith("doom1"))
{
opts << GameOption(Text, "Map", "setmap %1", GOValue("E1M1", "", "mapId"));
opts << GameOption(Text, "Map", "setmap %s", GOValue("E1M1", "", "mapId"));
}
else if (gameId.beginsWith("doom2"))
{
opts << GameOption(Text, "Map", "setmap %1", GOValue("MAP01", "", "mapId"));
opts << GameOption(Text, "Map", "setmap %s", GOValue("MAP01", "", "mapId"));
}
else if (gameId.beginsWith("heretic"))
{
opts << GameOption(Text, "Map", "setmap %1", GOValue("E1M1", "", "mapId"));
opts << GameOption(Text, "Map", "setmap %s", GOValue("E1M1", "", "mapId"));
}
else if (gameId.beginsWith("hexen"))
{
opts << GameOption(Text, "Map", "setmap %1", GOValue("MAP01", "", "mapId"));
opts << GameOption(Text, "Map", "setmap %s", GOValue("MAP01", "", "mapId"));
}

return opts;
Expand Down

0 comments on commit 5fbeb59

Please sign in to comment.