]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add cvar to show new players in ahelp (#23265)
authorLankLTE <135308300+LankLTE@users.noreply.github.com>
Thu, 4 Jan 2024 04:45:23 +0000 (20:45 -0800)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 04:45:23 +0000 (15:45 +1100)
* Implement cvar

* Enable cvar on Wizden

Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs
Content.Shared/CCVar/CCVars.cs
Resources/ConfigPresets/WizardsDen/wizardsDen.toml

index 5d760d9ab80b6297e2c65abc85ec9b78155e9b8e..90dc88e5b1568d07f1b869a241f6637816ec7831 100644 (file)
@@ -4,6 +4,7 @@ using Content.Client.Administration.Managers;
 using Content.Client.Administration.UI.CustomControls;
 using Content.Client.UserInterface.Systems.Bwoink;
 using Content.Shared.Administration;
+using Content.Shared.CCVar;
 using Robust.Client.AutoGenerated;
 using Robust.Client.Console;
 using Robust.Client.UserInterface;
@@ -11,6 +12,8 @@ using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.XAML;
 using Robust.Shared.Network;
 using Robust.Shared.Utility;
+using Robust.Shared.Timing;
+using Robust.Shared.Configuration;
 
 namespace Content.Client.Administration.UI.Bwoink
 {
@@ -23,6 +26,7 @@ namespace Content.Client.Administration.UI.Bwoink
         [Dependency] private readonly IClientAdminManager _adminManager = default!;
         [Dependency] private readonly IClientConsoleHost _console = default!;
         [Dependency] private readonly IUserInterfaceManager _ui = default!;
+        [Dependency] private readonly IConfigurationManager _cfg = default!;
         public AdminAHelpUIHandler AHelpHelper = default!;
 
         private PlayerInfo? _currentPlayer;
@@ -71,6 +75,9 @@ namespace Content.Client.Administration.UI.Bwoink
                 if (info.Antag && info.ActiveThisRound)
                     sb.Append(new Rune(0x1F5E1)); // 🗡
 
+                if (info.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold)))
+                    sb.Append(new Rune(0x23F2)); // ⏲
+
                 sb.AppendFormat("\"{0}\"", text);
 
                 return sb.ToString();
@@ -219,6 +226,9 @@ namespace Content.Client.Administration.UI.Bwoink
             if (pl.Antag)
                 sb.Append(new Rune(0x1F5E1)); // 🗡
 
+            if (pl.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold)))
+                sb.Append(new Rune(0x23F2)); // ⏲
+
             sb.AppendFormat("\"{0}\"", pl.CharacterName);
 
             if (pl.IdentityName != pl.CharacterName && pl.IdentityName != string.Empty)
index eefce86dfb296fbe9e96ac6ce7de06617a4e34d9..ca8ed54f3201c07edb99d2a21c03a49146f2c4f3 100644 (file)
@@ -804,6 +804,14 @@ namespace Content.Shared.CCVar
         /// </summary>
         public static readonly CVarDef<string> AdminAhelpOverrideClientName =
             CVarDef.Create("admin.override_adminname_in_client_ahelp", string.Empty, CVar.SERVERONLY);
+
+        /// <summary>
+        ///     The threshold of minutes to appear as a "new player" in the ahelp menu
+        ///     If 0, appearing as a new player is disabled. 
+        /// </summary>
+        public static readonly CVarDef<int> NewPlayerThreshold =
+            CVarDef.Create("admin.new_player_threshold", 0, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
         /*
          * Explosions
          */
index e3826b46787ed43f09234d8c02f86ba9adce368a..a271e36cf141136564630cf0c2274d46a883ec9d 100644 (file)
@@ -33,3 +33,4 @@ limit = 10.0
 [admin]
 see_own_notes = true
 deadmin_on_join = true
+new_player_threshold = 600
\ No newline at end of file