Skip to content

Commit

Permalink
Comments (CS / XAML)
Browse files Browse the repository at this point in the history
  • Loading branch information
Monotheonist committed Jan 17, 2025
1 parent 15fd731 commit a701e48
Show file tree
Hide file tree
Showing 29 changed files with 136 additions and 133 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Options/UI/Tabs/AudioTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<CheckBox Name="EventMusicCheckBox" Text="{Loc 'ui-options-event-music'}" />
<CheckBox Name="AnnouncerDisableMultipleSoundsCheckBox"
Text="{Loc 'ui-options-announcer-disable-multiple-sounds'}"
ToolTip="{Loc 'ui-options-announcer-disable-multiple-sounds-tooltip'}" />
ToolTip="{Loc 'ui-options-announcer-disable-multiple-sounds-tooltip'}" /> <!--Impstation Random Announcer System port-->
<CheckBox Name="AdminSoundsCheckBox" Text="{Loc 'ui-options-admin-sounds'}" />
</BoxContainer>
</BoxContainer>
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Administration/UI/AdminAnnounceEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using Content.Server.EUI;
using Content.Shared.Administration;
using Content.Shared.Eui;
using Content.Server._EE.Announcements.Systems;
using Robust.Shared.Player;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Robust.Shared.Player; // Impstation Random Announcer System

namespace Content.Server.Administration.UI
{
Expand Down
6 changes: 3 additions & 3 deletions Content.Server/AlertLevel/AlertLevelSystem.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Linq;
using System.Linq;
using Content.Server.Chat.Systems;
using Content.Server.Station.Systems;
using Content.Shared.CCVar;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System

namespace Content.Server.AlertLevel;

Expand Down Expand Up @@ -161,7 +161,7 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
if (Loc.TryGetString(detail.Announcement, out var locAnnouncement))
announcement = locAnnouncement;

var alert = $"alert{char.ToUpperInvariant(level[0]) + level[1..]}";
var alert = $"alert{char.ToUpperInvariant(level[0]) + level[1..]}"; // Start Impstation Random Announcer System
if (playSound)
_announcer.SendAnnouncementAudio(alert, _stationSystem.GetInOwningStation(station));

Expand Down
16 changes: 8 additions & 8 deletions Content.Server/Announcements/AnnounceCommand.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System.Linq;
using System.Linq; // Impstation Random Announcer System
using Content.Server.Administration;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Content.Shared.Administration;
using Content.Shared._EE.Announcements.Prototypes;
using Content.Shared._EE.Announcements.Prototypes; // Impstation Random Announcer System
using Robust.Shared.Console;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Player; // Impstation Random Announcer System
using Robust.Shared.Prototypes; // Impstation Random Announcer System

namespace Content.Server.Announcements
{
Expand All @@ -14,10 +14,10 @@ public sealed class AnnounceCommand : IConsoleCommand
{
public string Command => "announce";
public string Description => "Send an in-game announcement.";
public string Help => $"{Command} <sender> <message> <sound> <announcer>";
public string Help => $"{Command} <sender> <message> <sound> <announcer>"; // Impstation Random Announcer System: Adds announcer
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var announcer = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnnouncerSystem>();
var announcer = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnnouncerSystem>(); // Start Impstation Random Announcer System
var proto = IoCManager.Resolve<IPrototypeManager>();

switch (args.Length)
Expand Down Expand Up @@ -83,7 +83,7 @@ public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
return CompletionResult.FromHintOptions(list, Loc.GetString("admin-announce-hint-voice"));
}
default:
return CompletionResult.Empty;
return CompletionResult.Empty; // End Impstation Random Announcer System
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Content.Server/Chat/Systems/AnnounceOnSpawnSystem.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Content.Server.Chat;
using Content.Server._EE.Announcements.Systems;
using Robust.Shared.Player;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Robust.Shared.Player; // Impstation Random Announcer System

namespace Content.Server.Chat.Systems;

public sealed class AnnounceOnSpawnSystem : EntitySystem
{
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand All @@ -19,7 +19,7 @@ public override void Initialize()
private void OnInit(EntityUid uid, AnnounceOnSpawnComponent comp, MapInitEvent args)
{
var sender = comp.Sender != null ? Loc.GetString(comp.Sender) : Loc.GetString("chat-manager-sender-announcement");
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("SpawnAnnounceCaptain"), Filter.Broadcast(),
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("SpawnAnnounceCaptain"), Filter.Broadcast(), // Impstation Random Announcer System: The announcer themselves
comp.Message, sender, comp.Color);
}
}
8 changes: 4 additions & 4 deletions Content.Server/Communications/CommsHackerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
using Content.Server._EE.Announcements.Systems;
using Robust.Shared.Player;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Robust.Shared.Player; // Impstation Random Announcer System

namespace Content.Server.Communications;

Expand All @@ -23,7 +23,7 @@ public sealed class CommsHackerSystem : SharedCommsHackerSystem
// TODO: remove when generic check event is used
[Dependency] private readonly NinjaGlovesSystem _gloves = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand Down Expand Up @@ -82,7 +82,7 @@ private void OnDoAfter(EntityUid uid, CommsHackerComponent comp, TerrorDoAfterEv
public void CallInThreat(NinjaHackingThreatPrototype ninjaHackingThreat)
{
_gameTicker.StartGameRule(ninjaHackingThreat.Rule, out _);
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("NinjaHacking"), Filter.Broadcast(),
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("NinjaHacking"), Filter.Broadcast(), // Impstation Random Announcer System: Adds the announcer
ninjaHackingThreat.Announcement, colorOverride: Color.Red);
}
}
Expand Down
16 changes: 8 additions & 8 deletions Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Content.Server._EE.Announcements.Systems;
using Robust.Shared.Player;
using Content.Server.Station.Components;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Robust.Shared.Player; // Impstation Random Announcer System
using Content.Server.Station.Components; // Impstation Random Announcer System

namespace Content.Server.Communications
{
Expand All @@ -40,7 +40,7 @@ public sealed class CommunicationsConsoleSystem : EntitySystem
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

private const float UIUpdateInterval = 5.0f;

Expand Down Expand Up @@ -265,18 +265,18 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
Loc.TryGetString(comp.Title, out var title);
title ??= comp.Title;

msg += $"\n{Loc.GetString("comms-console-announcement-sent-by")} {author}";
msg += $"\n{Loc.GetString("comms-console-announcement-sent-by")} {author}"; // Start Impstation Random Announcer System: Integrates the Announcer
if (comp.Global)
{
_announcer.SendAnnouncement("announce", Filter.Broadcast(), msg, title, comp.Color);
_announcer.SendAnnouncement("announce", Filter.Broadcast(), msg, title, comp.Color); // End Impstation Random Announcer System: Integrates the Announcer

_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Actor):player} has sent the following global announcement: {msg}");
return;
}

if (TryComp<StationDataComponent>(_stationSystem.GetOwningStation(uid), out var stationData))
if (TryComp<StationDataComponent>(_stationSystem.GetOwningStation(uid), out var stationData)) // Start Impstation Random Announcer System: Integrates the Announcer
_announcer.SendAnnouncement("announce", _stationSystem.GetInStation(stationData), msg, title,
comp.Color);
comp.Color); // End Impstation Random Announcer System: Integrates the Announcer

_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Actor):player} has sent the following station announcement: {msg}");

Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Dragon/DragonRiftSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Utility;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System

namespace Content.Server.Dragon;

Expand All @@ -29,7 +29,7 @@ public sealed class DragonRiftSystem : EntitySystem
[Dependency] private readonly NavMapSystem _navMap = default!;
[Dependency] private readonly NPCSystem _npc = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand Down
6 changes: 3 additions & 3 deletions Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System

namespace Content.Server.GameTicking
{
Expand All @@ -30,7 +30,7 @@ public sealed partial class GameTicker
[Dependency] private readonly DiscordWebhook _discord = default!;
[Dependency] private readonly RoleSystem _role = default!;
[Dependency] private readonly ITaskManager _taskManager = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

private static readonly Counter RoundNumberMetric = Metrics.CreateCounter(
"ss14_round_number",
Expand Down Expand Up @@ -645,7 +645,7 @@ private void AnnounceRound()

var proto = _robustRandom.Pick(options);

_announcer.SendAnnouncement(_announcer.GetAnnouncementId(proto.ID), Filter.Broadcast(),
_announcer.SendAnnouncement(_announcer.GetAnnouncementId(proto.ID), Filter.Broadcast(), // Impstation Random Announcer System: Integrates the announcer
proto.Message ?? "game-ticker-welcome-to-the-station");
}

Expand Down
8 changes: 4 additions & 4 deletions Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using Robust.Shared.Player;
using Robust.Shared.Timing;
using System.Globalization;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System

namespace Content.Server.GameTicking.Rules;

Expand All @@ -34,7 +34,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly ZombieSystem _zombie = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand Down Expand Up @@ -121,9 +121,9 @@ private void CheckRoundEnd(ZombieRuleComponent zombieRuleComponent)
{
foreach (var station in _station.GetStations())
{
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("ShuttleCalled"),
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("ShuttleCalled"), // Start Impstation Random Announcer System: Integrates the announcer
_station.GetInOwningStation(station), "zombie-shuttle-call",
colorOverride: Color.Crimson);
colorOverride: Color.Crimson); // Ends Impstation Random Announcer System: Integrates the announcer
}
_roundEnd.RequestRoundEnd(null, false);
}
Expand Down
8 changes: 4 additions & 4 deletions Content.Server/Nuke/NukeCodePaperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using Content.Shared.Paper;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server._EE.Announcements.Systems;
using Robust.Shared.Player;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Robust.Shared.Player; // Impstation Random Announcer System

namespace Content.Server.Nuke
{
Expand All @@ -19,7 +19,7 @@ public sealed class NukeCodePaperSystem : EntitySystem
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly PaperSystem _paper = default!;
[Dependency] private readonly FaxSystem _faxSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public bool SendNukeCodes(EntityUid station)
}

if (wasSent)
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("NukeCodes"), Filter.Broadcast(),
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("NukeCodes"), Filter.Broadcast(), // Impstation Random Announcer System: Integrates the announcer
"nuke-component-announcement-send-codes", colorOverride: Color.Red);

return wasSent;
Expand Down
8 changes: 4 additions & 4 deletions Content.Server/Nuke/NukeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System

namespace Content.Server.Nuke;

Expand All @@ -45,7 +45,7 @@ public sealed class NukeSystem : EntitySystem
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

/// <summary>
/// Used to calculate when the nuke song should start playing for maximum kino with the nuke sfx
Expand Down Expand Up @@ -516,12 +516,12 @@ public void DisarmBomb(EntityUid uid, NukeComponent? component = null)
if (stationUid != null)
_alertLevel.SetLevel(stationUid.Value, component.AlertLevelOnDeactivate, true, true, true);

_announcer.SendAnnouncementMessage(
_announcer.SendAnnouncementMessage( // Impstation Random Announcer System: Integrates the announcer
_announcer.GetAnnouncementId("NukeDisarm"),
"nuke-component-announcement-unarmed",
Loc.GetString("nuke-component-announcement-sender"),
station: stationUid ?? uid
);
); // End Impstation Random Announcer System: Integrates the announcer

component.PlayedNukeSong = false;
_sound.PlayGlobalOnStation(uid, _audio.GetSound(component.DisarmSound));
Expand Down
8 changes: 4 additions & 4 deletions Content.Server/NukeOps/WarDeclaratorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.Timing;
using Content.Server._EE.Announcements.Systems;
using Robust.Shared.Player;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System
using Robust.Shared.Player; // Impstation Random Announcer System

namespace Content.Server.NukeOps;

Expand All @@ -27,7 +27,7 @@ public sealed class WarDeclaratorSystem : EntitySystem
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly AccessReaderSystem _accessReaderSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand Down Expand Up @@ -74,7 +74,7 @@ private void OnActivated(Entity<WarDeclaratorComponent> ent, ref WarDeclaratorAc
if (ev.Status == WarConditionStatus.WarReady)
{
var title = Loc.GetString(ent.Comp.SenderTitle);
_announcer.SendAnnouncement("war", Filter.Broadcast(), ent.Comp.Message, title, ent.Comp.Color);
_announcer.SendAnnouncement("war", Filter.Broadcast(), ent.Comp.Message, title, ent.Comp.Color); // Impstation Random Announcer System: Integrates the announcer
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(args.Actor):player} has declared war with this text: {ent.Comp.Message}");
}

Expand Down
8 changes: 4 additions & 4 deletions Content.Server/PowerSink/PowerSinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Content.Server.Power.EntitySystems;
using Content.Server._EE.Announcements.Systems;
using Content.Server._EE.Announcements.Systems; // Impstation Random Announcer System

namespace Content.Server.PowerSink
{
Expand All @@ -34,7 +34,7 @@ public sealed class PowerSinkSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Impstation Random Announcer System

public override void Initialize()
{
Expand Down Expand Up @@ -128,9 +128,9 @@ private void NotifyStationOfImminentExplosion(EntityUid uid, PowerSinkComponent
if (station == null)
return;

_announcer.SendAnnouncement(_announcer.GetAnnouncementId("PowerSinkExplosion"),
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("PowerSinkExplosion"), // Start Impstation Random Announcer System: Integrates the announcer
_station.GetInOwningStation(station.Value), "powersink-imminent-explosion-announcement",
colorOverride: Color.Yellow, station: station.Value);
colorOverride: Color.Yellow, station: station.Value); // End Impstation Random Announcer System: Integrates the announcer
}
}
}
Loading

0 comments on commit a701e48

Please sign in to comment.