From 2e60e098e9047e957e854e9e30270f58721108c1 Mon Sep 17 00:00:00 2001 From: DoutorWhite Date: Fri, 8 Dec 2023 01:27:22 -0300 Subject: [PATCH] New CVAR and removal of unintended debug code. --- Content.Server/Light/EntitySystems/PoweredLightSystem.cs | 5 ++--- Content.Shared/CCVar/CCVars.cs | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index 31ec70b9201ff3..71441cae426c19 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -537,8 +537,7 @@ public override void Update(float frameTime) { ForceUpdate(); _cfg.SetCVar(CCVars.NightTime, true); - Console.WriteLine("Noite! Atualize as lampadas."); - if (_isStationDefined) + if (_isStationDefined && _cfg.GetCVar(CCVars.ShiftAnnouncement)) { _chatSystem.DispatchStationAnnouncement( _originStation.GetValueOrDefault(), Loc.GetString("time-cycle-night"), "Central de Comando", true, nightShift, colorOverride: Color.SkyBlue); @@ -548,7 +547,7 @@ public override void Update(float frameTime) { ForceUpdate(); _cfg.SetCVar(CCVars.NightTime, false); - if (_isStationDefined) + if (_isStationDefined && _cfg.GetCVar(CCVars.ShiftAnnouncement)) { _chatSystem.DispatchStationAnnouncement( _originStation.GetValueOrDefault(), Loc.GetString("time-cycle-day"), "Central de Comando", true, dayShift, colorOverride: Color.Orange); diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 26c7e4c2d04787..12ea7e3a21c42b 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1830,6 +1830,8 @@ public static readonly CVarDef CVarDef.Create("time.night_time", false, desc: "Não altere.", flag: CVar.SERVERONLY); public static readonly CVarDef DayNightCycle = CVarDef.Create("time.day_night_cycle", true, desc: "Define se o sistema de iluminação noturna estará ativado na estação. (true/false)", flag: CVar.SERVERONLY); + public static readonly CVarDef ShiftAnnouncement = + CVarDef.Create("time.shift_announcement", true, desc: "Define se serão emitidos anúncios após a mudança de turno. (true/false)", flag: CVar.SERVERONLY); public static readonly CVarDef LightIntensityFall = CVarDef.Create("time.light_intensity_fall", 1.75f, desc: "Define o multiplicador queda de intensidade das luzes durante o modo noturno. (fator)", flag: CVar.SERVERONLY); public static readonly CVarDef NightChangeTime =