Setgamepreset tweaks (#8260)
This commit is contained in:
@@ -8,20 +8,27 @@ namespace Content.Server.GameTicking.Commands
|
|||||||
sealed class SetGamePresetCommand : IConsoleCommand
|
sealed class SetGamePresetCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "setgamepreset";
|
public string Command => "setgamepreset";
|
||||||
public string Description => "";
|
public string Description => Loc.GetString("set-game-preset-command-description", ("command", Command));
|
||||||
public string Help => "";
|
public string Help => Loc.GetString("set-game-preset-command-help-text", ("command", Command));
|
||||||
|
|
||||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||||
{
|
{
|
||||||
if (args.Length != 1)
|
if (args.Length != 1)
|
||||||
{
|
{
|
||||||
shell.WriteLine("Need exactly one argument.");
|
shell.WriteError(Loc.GetString("shell-wrong-arguments-number-need-specific", ("properAmount", 1), ("currentAmount", args.Length)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ticker = EntitySystem.Get<GameTicker>();
|
var ticker = EntitySystem.Get<GameTicker>();
|
||||||
|
|
||||||
ticker.SetGamePreset(args[0]);
|
if (!ticker.TryFindGamePreset(args[0], out var preset))
|
||||||
|
{
|
||||||
|
shell.WriteError(Loc.GetString("set-game-preset-preset-error", ("preset", args[0])));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ticker.SetGamePreset(preset);
|
||||||
|
shell.WriteLine(Loc.GetString("set-game-preset-preset-set", ("preset", preset.ID)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
set-game-preset-preset-error = Unable to find game preset "{$preset}"
|
||||||
|
set-game-preset-preset-set = Set game preset to "{$preset}"
|
||||||
Reference in New Issue
Block a user