From 5a4318011923d06590005b4c2c78c14aae795c00 Mon Sep 17 00:00:00 2001 From: rhailrake <49613070+rhailrake@users.noreply.github.com> Date: Tue, 29 Aug 2023 19:29:13 +0600 Subject: [PATCH] fixo (#348) --- Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs | 6 +++--- Content.Client/Popups/PopupSystem.cs | 4 ++-- .../White/Other/ExamineSystem/ExamineSystem.cs | 13 ++++++++++++- Content.Shared/White/WhiteCVars.cs | 4 ++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs b/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs index 92d173e3a3..0c60ea2e44 100644 --- a/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs @@ -85,7 +85,7 @@ namespace Content.Client.Options.UI.Tabs ViewportLowResCheckBox.Pressed = !_cfg.GetCVar(CCVars.ViewportScaleRender); ParallaxLowQualityCheckBox.Pressed = _cfg.GetCVar(CCVars.ParallaxLowQuality); FpsCounterCheckBox.Pressed = _cfg.GetCVar(CCVars.HudFpsCounterVisible); - LogInChatCheckBox.Pressed = _cfg.GetCVar(WhiteCVars.LogInChat); + LogInChatCheckBox.Pressed = _cfg.GetCVar(WhiteCVars.LogChatActions); ViewportWidthSlider.Value = _cfg.GetCVar(CCVars.ViewportWidth); _cfg.OnValueChanged(CCVars.ViewportMinimumWidth, _ => UpdateViewportWidthRange()); @@ -118,7 +118,7 @@ namespace Content.Client.Options.UI.Tabs _cfg.SetCVar(CCVars.ViewportScaleRender, !ViewportLowResCheckBox.Pressed); _cfg.SetCVar(CCVars.ParallaxLowQuality, ParallaxLowQualityCheckBox.Pressed); _cfg.SetCVar(CCVars.HudFpsCounterVisible, FpsCounterCheckBox.Pressed); - _cfg.SetCVar(WhiteCVars.LogInChat, LogInChatCheckBox.Pressed); + _cfg.SetCVar(WhiteCVars.LogChatActions, LogInChatCheckBox.Pressed); _cfg.SetCVar(CCVars.ViewportWidth, (int) ViewportWidthSlider.Value); _cfg.SaveToFile(); @@ -148,7 +148,7 @@ namespace Content.Client.Options.UI.Tabs var isVPResSame = ViewportLowResCheckBox.Pressed == !_cfg.GetCVar(CCVars.ViewportScaleRender); var isPLQSame = ParallaxLowQualityCheckBox.Pressed == _cfg.GetCVar(CCVars.ParallaxLowQuality); var isFpsCounterVisibleSame = FpsCounterCheckBox.Pressed == _cfg.GetCVar(CCVars.HudFpsCounterVisible); - var isLogInChatSame = LogInChatCheckBox.Pressed == _cfg.GetCVar(WhiteCVars.LogInChat); + var isLogInChatSame = LogInChatCheckBox.Pressed == _cfg.GetCVar(WhiteCVars.LogChatActions); var isWidthSame = (int) ViewportWidthSlider.Value == _cfg.GetCVar(CCVars.ViewportWidth); ApplyButton.Disabled = isVSyncSame && diff --git a/Content.Client/Popups/PopupSystem.cs b/Content.Client/Popups/PopupSystem.cs index d9e2babd55..46ec696dd5 100644 --- a/Content.Client/Popups/PopupSystem.cs +++ b/Content.Client/Popups/PopupSystem.cs @@ -53,8 +53,8 @@ namespace Content.Client.Popups _overlay .AddOverlay(new PopupOverlay(_configManager, EntityManager, _playerManager, _prototype, _resource, _uiManager, this)); - isLogging = _configManager.GetCVar(WhiteCVars.LogInChat); - _configManager.OnValueChanged(WhiteCVars.LogInChat, (log) => { isLogging = log; }); + isLogging = _configManager.GetCVar(WhiteCVars.LogChatActions); + _configManager.OnValueChanged(WhiteCVars.LogChatActions, (log) => { isLogging = log; }); } public override void Shutdown() diff --git a/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs b/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs index ce4496d3f2..87f01993c7 100644 --- a/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs +++ b/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs @@ -4,7 +4,9 @@ using Robust.Shared.Enums; using Content.Shared.Humanoid; using Content.Shared.Inventory; using Content.Shared.PDA; +using Content.Shared.White; using Robust.Server.GameObjects; +using Robust.Shared.Configuration; using Robust.Shared.Console; namespace Content.Server.White.Other.ExamineSystem @@ -16,6 +18,8 @@ namespace Content.Server.White.Other.ExamineSystem [Dependency] private readonly InventorySystem _inventorySystem = default!; [Dependency] private readonly EntityManager _entityManager = default!; [Dependency] private readonly IConsoleHost _consoleHost = default!; + [Dependency] private readonly INetConfigurationManager _netConfigManager = default!; + public override void Initialize() { @@ -23,7 +27,14 @@ namespace Content.Server.White.Other.ExamineSystem } private void SendNoticeMessage(ActorComponent actorComponent, string message) - => _consoleHost.RemoteExecuteCommand(actorComponent.PlayerSession, $"notice {message}"); + { + var should = _netConfigManager.GetClientCVar(actorComponent.PlayerSession.ConnectedClient, WhiteCVars.LogChatActions); + + if (should) + { + _consoleHost.RemoteExecuteCommand(actorComponent.PlayerSession, $"notice {message}"); + } + } private void HandleExamine(EntityUid uid, ExaminableClothesComponent comp, ExaminedEvent args) { diff --git a/Content.Shared/White/WhiteCVars.cs b/Content.Shared/White/WhiteCVars.cs index df1ef885d3..73c8e55791 100644 --- a/Content.Shared/White/WhiteCVars.cs +++ b/Content.Shared/White/WhiteCVars.cs @@ -300,6 +300,6 @@ public sealed class WhiteCVars /// public static readonly CVarDef LoadERTMap = CVarDef.Create("white.ert_load", false, CVar.SERVERONLY); - public static readonly CVarDef LogInChat = - CVarDef.Create("white.log_in_chat", true, CVar.CLIENTONLY | CVar.ARCHIVE); + public static readonly CVarDef LogChatActions = + CVarDef.Create("white.log_to_chat", true, CVar.CLIENT | CVar.ARCHIVE | CVar.REPLICATED); }