Add completions for ForceMap and ForcePreset
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using Content.Server.Administration;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking.Presets;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
@@ -37,5 +40,20 @@ namespace Content.Server.GameTicking.Commands
|
||||
shell.WriteLine($"Forced the game to start with preset {name}.");
|
||||
ticker.UpdateInfoText();
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
var options = IoCManager.Resolve<IPrototypeManager>()
|
||||
.EnumeratePrototypes<GamePresetPrototype>()
|
||||
.OrderBy(p => p.ID)
|
||||
.Select(p => p.ID);
|
||||
|
||||
return CompletionResult.FromHintOptions(options, "<preset>");
|
||||
}
|
||||
|
||||
return CompletionResult.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user