Add cvar to show new players in ahelp (#23265)
* Implement cvar * Enable cvar on Wizden
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -33,3 +33,4 @@ limit = 10.0
|
||||
[admin]
|
||||
see_own_notes = true
|
||||
deadmin_on_join = true
|
||||
new_player_threshold = 600
|
||||
Reference in New Issue
Block a user