Removed old Loc.GetString() use instances (#4155)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -19,10 +19,8 @@ namespace Content.Server.StationEvents.Events
|
||||
public override string Name => "PowerGridCheck";
|
||||
public override float Weight => WeightNormal;
|
||||
public override int? MaxOccurrences => 3;
|
||||
public override string StartAnnouncement => Loc.GetString(
|
||||
"Abnormal activity detected in the station's powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.");
|
||||
protected override string EndAnnouncement => Loc.GetString(
|
||||
"Power has been restored to the station. We apologize for the inconvenience.");
|
||||
public override string StartAnnouncement => Loc.GetString("station-event-power-grid-check-start-announcement");
|
||||
protected override string EndAnnouncement => Loc.GetString("station-event-power-grid-check-end-announcement");
|
||||
public override string? StartAudio => "/Audio/Announcements/power_off.ogg";
|
||||
|
||||
// If you need EndAudio it's down below. Not set here because we can't play it at the normal time without spamming sounds.
|
||||
|
||||
@@ -21,10 +21,8 @@ namespace Content.Server.StationEvents.Events
|
||||
[Dependency] private IRobustRandom _robustRandom = default!;
|
||||
|
||||
public override string Name => "RadiationStorm";
|
||||
public override string StartAnnouncement => Loc.GetString(
|
||||
"High levels of radiation detected near the station. Evacuate any areas containing abnormal green energy fields.");
|
||||
protected override string EndAnnouncement => Loc.GetString(
|
||||
"The radiation threat has passed. Please return to your workplaces.");
|
||||
public override string StartAnnouncement => Loc.GetString("station-event-radiation-storm-start-announcement");
|
||||
protected override string EndAnnouncement => Loc.GetString("station-event-radiation-storm-end-announcement");
|
||||
public override string StartAudio => "/Audio/Announcements/radiation.ogg";
|
||||
protected override float StartAfter => 10.0f;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Server.StationEvents
|
||||
{
|
||||
@@ -12,30 +13,24 @@ namespace Content.Server.StationEvents
|
||||
public sealed class StationEventCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "events";
|
||||
public string Description => "Provides admin control to station events";
|
||||
public string Help => $"events <running/list/pause/resume/stop/run <eventName/random>>\n{RunningHelp}\n{ListHelp}\n{PauseHelp}\n{ResumeHelp}\n{RunHelp}";
|
||||
|
||||
private const string RunningHelp = "running: return the current running event";
|
||||
|
||||
private const string ListHelp = "list: return all event names that can be run";
|
||||
|
||||
private const string PauseHelp = "pause: stop all random events from running and any one currently running";
|
||||
|
||||
private const string ResumeHelp = "resume: allow random events to run again";
|
||||
|
||||
private const string RunHelp =
|
||||
"run <eventName/random>: start a particular event now; <eventName> is case-insensitive and not localized";
|
||||
public string Description => Loc.GetString("station-event-command-description");
|
||||
public string Help => Loc.GetString("station-event-command-help-text",
|
||||
("runningHelp", Loc.GetString("station-event-command-running-help-text")),
|
||||
("listHelp", Loc.GetString("station-event-command-list-help-text")),
|
||||
("pauseHelp", Loc.GetString("station-event-command-pause-help-text")),
|
||||
("resumeHelp", Loc.GetString("station-event-command-resume-help-text")),
|
||||
("runHelp", Loc.GetString("station-event-command-run-help-text")));
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var player = shell.Player as IPlayerSession;
|
||||
if (args.Length == 0)
|
||||
if (!args.Any())
|
||||
{
|
||||
shell.WriteLine($"Invalid amount of arguments.\n{Help}");
|
||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number") + $"\n{Help}");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (args[0])
|
||||
switch (args.First())
|
||||
{
|
||||
case "list":
|
||||
List(shell, player);
|
||||
@@ -56,14 +51,17 @@ namespace Content.Server.StationEvents
|
||||
case "run":
|
||||
if (args.Length != 2)
|
||||
{
|
||||
shell.WriteLine($"Need 2 arguments, there were {args.Length}.\n{RunHelp}");
|
||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number-need-specific",
|
||||
("properAmount", 2),
|
||||
("currentAmount", args.Length))
|
||||
+ $"\n{Loc.GetString("station-event-command-run-help-text")}");
|
||||
break;
|
||||
}
|
||||
|
||||
Run(shell, player, args[1]);
|
||||
break;
|
||||
default:
|
||||
shell.WriteLine(Loc.GetString($"Invalid events command.\n{Help}"));
|
||||
shell.WriteLine(Loc.GetString($"shell-invalid-command-specific.", ("commandName", "events")) + $"\n{Help}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +92,8 @@ namespace Content.Server.StationEvents
|
||||
|
||||
private void List(IConsoleShell shell, IPlayerSession? player)
|
||||
{
|
||||
var resultText = "Random\n" + EntitySystem.Get<StationEventSystem>().GetEventNames();
|
||||
var resultText = Loc.GetString("station-event-command-event-list",
|
||||
("otherEvents", EntitySystem.Get<StationEventSystem>().GetEventNames()));
|
||||
shell.WriteLine(resultText);
|
||||
}
|
||||
|
||||
@@ -104,12 +103,12 @@ namespace Content.Server.StationEvents
|
||||
|
||||
if (!stationEventSystem.Enabled)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Station events are already paused"));
|
||||
shell.WriteLine(Loc.GetString("station-event-command-events-already-paused-message"));
|
||||
}
|
||||
else
|
||||
{
|
||||
stationEventSystem.Enabled = false;
|
||||
shell.WriteLine(Loc.GetString("Station events paused"));
|
||||
shell.WriteLine(Loc.GetString("station-event-command-events-paused-message"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,12 +118,12 @@ namespace Content.Server.StationEvents
|
||||
|
||||
if (stationEventSystem.Enabled)
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("Station events are already running"));
|
||||
shell.WriteLine(Loc.GetString("station-event-command-events-already-running-message"));
|
||||
}
|
||||
else
|
||||
{
|
||||
stationEventSystem.Enabled = true;
|
||||
shell.WriteLine(Loc.GetString("Station events resumed"));
|
||||
shell.WriteLine(Loc.GetString("station-event-command-events-resumed-message"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -106,11 +106,11 @@ namespace Content.Server.StationEvents
|
||||
CurrentEvent?.Shutdown();
|
||||
CurrentEvent = stationEvent;
|
||||
stationEvent.Announce();
|
||||
return Loc.GetString("Running event ") + stationEvent.Name;
|
||||
return Loc.GetString("station-event-system-run-event", ("eventName", stationEvent.Name));
|
||||
}
|
||||
|
||||
// I had string interpolation but lord it made it hard to read
|
||||
return Loc.GetString("No event named ") + name;
|
||||
return Loc.GetString("station-event-system-run-event-no-event-name", ("eventName", name));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -123,14 +123,14 @@ namespace Content.Server.StationEvents
|
||||
|
||||
if (randomEvent == null)
|
||||
{
|
||||
return Loc.GetString("No valid events available");
|
||||
return Loc.GetString("station-event-system-run-random-event-no-valid-events");
|
||||
}
|
||||
|
||||
CurrentEvent?.Shutdown();
|
||||
CurrentEvent = randomEvent;
|
||||
CurrentEvent.Startup();
|
||||
|
||||
return Loc.GetString("Running ") + randomEvent.Name;
|
||||
return Loc.GetString("station-event-system-run-event",("eventName", randomEvent.Name));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -152,11 +152,11 @@ namespace Content.Server.StationEvents
|
||||
|
||||
if (CurrentEvent == null)
|
||||
{
|
||||
resultText = Loc.GetString("No event running currently");
|
||||
resultText = Loc.GetString("station-event-system-stop-event-no-running-event");
|
||||
}
|
||||
else
|
||||
{
|
||||
resultText = Loc.GetString("Stopped event ") + CurrentEvent.Name;
|
||||
resultText = Loc.GetString("station-event-system-stop-event", ("eventName", CurrentEvent.Name));
|
||||
CurrentEvent.Shutdown();
|
||||
CurrentEvent = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user