From 978e690ad104d62c1a6c2f354490ba69b590b458 Mon Sep 17 00:00:00 2001 From: Monotheonist <182929384+Monotheonist@users.noreply.github.com> Date: Thu, 9 Jan 2025 00:50:35 -0400 Subject: [PATCH] I am in misery (more Cvars) --- Content.Client/Options/UI/Tabs/AudioTab.xaml.cs | 5 +++-- .../_EE/Announcements/Systems/AnnouncerSystem.cs | 13 +++++++------ .../Shuttles/Systems/EmergencyShuttleSystem.cs | 1 + .../Systems/AnnouncerSystem.Announcer.cs | 6 +++--- .../_EE/Announcements/Systems/AnnouncerSystem.cs | 2 +- Content.Shared/_Impstation/CCVars/ImpCCVars.cs | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs b/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs index a57aa301b55..c14e508b7ac 100644 --- a/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs @@ -1,5 +1,6 @@ using Content.Client.Audio; using Content.Shared.CCVar; +using Content.Shared._Impstation.CCVar; using Robust.Client.Audio; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; @@ -52,7 +53,7 @@ public AudioTab() scale: ContentAudioSystem.InterfaceMultiplier); Control.AddOptionPercentSlider( //Impstation Random Announcer System port start - CCVars.AnnouncerVolume, + ImpCCVars.AnnouncerVolume, SliderVolumeAnnouncer, scale: ContentAudioSystem.AnnouncerMultiplier); //Impstation Random Announcer System port end @@ -65,7 +66,7 @@ public AudioTab() Control.AddOptionCheckBox(CCVars.LobbyMusicEnabled, LobbyMusicCheckBox); Control.AddOptionCheckBox(CCVars.RestartSoundsEnabled, RestartSoundsCheckBox); Control.AddOptionCheckBox(CCVars.EventMusicEnabled, EventMusicCheckBox); - Control.AddOptionCheckBox(CCVars.AnnouncerDisableMultipleSounds, AnnouncerDisableMultipleSoundsCheckBox); //Impstation Random Announcer System + Control.AddOptionCheckBox(ImpCCVars.AnnouncerDisableMultipleSounds, AnnouncerDisableMultipleSoundsCheckBox); //Impstation Random Announcer System Control.AddOptionCheckBox(CCVars.AdminSoundsEnabled, AdminSoundsCheckBox); Control.Initialize(); diff --git a/Content.Client/_EE/Announcements/Systems/AnnouncerSystem.cs b/Content.Client/_EE/Announcements/Systems/AnnouncerSystem.cs index 4f7a3727113..2a3a9b62594 100644 --- a/Content.Client/_EE/Announcements/Systems/AnnouncerSystem.cs +++ b/Content.Client/_EE/Announcements/Systems/AnnouncerSystem.cs @@ -3,6 +3,7 @@ using Content.Shared._EE.Announcements.Events; using Content.Shared._EE.Announcements.Systems; using Content.Shared.CCVar; +using Content.Shared._Impstation.CCVar; using Robust.Client.Audio; using Robust.Client.Player; using Robust.Client.ResourceManagement; @@ -27,10 +28,10 @@ public override void Initialize() { base.Initialize(); - AnnouncerVolume = _config.GetCVar(CCVars.AnnouncerVolume) * 100f / ContentAudioSystem.AnnouncerMultiplier; + AnnouncerVolume = _config.GetCVar(ImpCCVars.AnnouncerVolume) * 100f / ContentAudioSystem.AnnouncerMultiplier; - _config.OnValueChanged(CCVars.AnnouncerVolume, OnAnnouncerVolumeChanged); - _config.OnValueChanged(CCVars.AnnouncerDisableMultipleSounds, OnAnnouncerDisableMultipleSounds); + _config.OnValueChanged(ImpCCVars.AnnouncerVolume, OnAnnouncerVolumeChanged); // Impstation: Namespacing + _config.OnValueChanged(ImpCCVars.AnnouncerDisableMultipleSounds, OnAnnouncerDisableMultipleSounds); SubscribeNetworkEvent(OnAnnouncementReceived); } @@ -39,8 +40,8 @@ public override void Shutdown() { base.Shutdown(); - _config.UnsubValueChanged(CCVars.AnnouncerVolume, OnAnnouncerVolumeChanged); - _config.UnsubValueChanged(CCVars.AnnouncerDisableMultipleSounds, OnAnnouncerDisableMultipleSounds); + _config.UnsubValueChanged(ImpCCVars.AnnouncerVolume, OnAnnouncerVolumeChanged); // Impstation: Namespacing + _config.UnsubValueChanged(ImpCCVars.AnnouncerDisableMultipleSounds, OnAnnouncerDisableMultipleSounds); } @@ -78,7 +79,7 @@ private void OnAnnouncementReceived(AnnouncementSendEvent ev) source.Gain = AnnouncerVolume * SharedAudioSystem.VolumeToGain(ev.AudioParams.Volume); source.Global = true; - if (_config.GetCVar(CCVars.AnnouncerDisableMultipleSounds)) + if (_config.GetCVar(ImpCCVars.AnnouncerDisableMultipleSounds)) // Impstation: Namespacing { foreach (var audioSource in AnnouncerSources.ToList()) { diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index c3fec69b2a6..c2e60adf3cd 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -20,6 +20,7 @@ using Content.Server.Station.Systems; using Content.Shared.Access.Systems; using Content.Shared.CCVar; +using Content.Shared._Impstation.CCVar; using Content.Shared.Database; using Content.Shared.DeviceNetwork; using Content.Shared.GameTicking; diff --git a/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.Announcer.cs b/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.Announcer.cs index 5399929695e..3a518c025b1 100644 --- a/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.Announcer.cs +++ b/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.Announcer.cs @@ -21,7 +21,7 @@ private void OnRoundRestarting(RoundRestartCleanupEvent ev) /// private void NewAnnouncer() { - var announcer = _config.GetCVar(CCVars.Announcer); + var announcer = _config.GetCVar(ImpCCVars.Announcer); //Impstation: Namespacing if (string.IsNullOrEmpty(announcer) || !_proto.TryIndex(announcer, out _)) SetAnnouncer(PickAnnouncer()); else @@ -33,8 +33,8 @@ private void NewAnnouncer() /// public AnnouncerPrototype PickAnnouncer() { - var list = _proto.Index(_config.GetCVar(CCVars.AnnouncerList)); - var blacklist = _config.GetCVar(CCVars.AnnouncerBlacklist).Split(',').Select(a => a.Trim()).ToList(); + var list = _proto.Index(_config.GetCVar(ImpCCVars.AnnouncerList)); //Namespacing + var blacklist = _config.GetCVar(ImpCCVars.AnnouncerBlacklist).Split(',').Select(a => a.Trim()).ToList(); var modWeights = list.Weights.Where(a => !blacklist.Contains(a.Key)); list = new WeightedRandomPrototype(); diff --git a/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.cs b/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.cs index 5175fcd737c..4f361f1204e 100644 --- a/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.cs +++ b/Content.Server/_EE/Announcements/Systems/AnnouncerSystem.cs @@ -26,7 +26,7 @@ public override void Initialize() base.Initialize(); NewAnnouncer(); - _config.OnValueChanged(CCVars.Announcer, _ => NewAnnouncer()); + _config.OnValueChanged(ImpCCVars.Announcer, _ => NewAnnouncer()); SubscribeLocalEvent(OnRoundRestarting); } diff --git a/Content.Shared/_Impstation/CCVars/ImpCCVars.cs b/Content.Shared/_Impstation/CCVars/ImpCCVars.cs index 18956f47934..3e150def808 100644 --- a/Content.Shared/_Impstation/CCVars/ImpCCVars.cs +++ b/Content.Shared/_Impstation/CCVars/ImpCCVars.cs @@ -10,7 +10,7 @@ namespace Content.Shared._Impstation.CCVar; // ReSharper disable once InconsistentNaming - Shush you!! [CVarDefs] -public sealed class CCVars : CVars +public sealed class ImpCCVars { /* * Announcers