* refactor(src): Minor refactor of Draw in "AdminNameOverlay. And new info about playtime player * fix(src): Add configure classic admin owerlay * fix * antag status indication rework * the cvars are free, you can just take them * update playerlist on cvar change * more overlay options * tweak(src): Use _antagLabelClassic and tweak style * tweak(src): Add config display overlay for startingJob and playTime * tweak(src): Vector2 is replaced by var * tweak(src): return to the end of the list * add new option checkboxes * passing ConfigurationManager through constructor, some format changes * made sorting values more futureproof * comments * labels * no point commenting this out when the overlay stack PR will uncomment it again anyway * sorting prototype * localize symbols because why not * symmetry * Revert "localize symbols because why not" This reverts commit 922d4030300285a45777d62fcfd9c74b25fe7a60. * layout and formatting stuff * fix errant space --------- Co-authored-by: Schrödinger <132720404+Schrodinger71@users.noreply.github.com>
61 lines
2.0 KiB
C#
61 lines
2.0 KiB
C#
using Content.Client.Administration.Managers;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.ResourceManagement;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Client.Administration.Systems
|
|
{
|
|
public sealed partial class AdminSystem
|
|
{
|
|
[Dependency] private readonly IOverlayManager _overlayManager = default!;
|
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
|
[Dependency] private readonly IClientAdminManager _adminManager = default!;
|
|
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
|
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
|
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
|
|
|
private AdminNameOverlay _adminNameOverlay = default!;
|
|
|
|
public event Action? OverlayEnabled;
|
|
public event Action? OverlayDisabled;
|
|
|
|
private void InitializeOverlay()
|
|
{
|
|
_adminNameOverlay = new AdminNameOverlay(
|
|
this,
|
|
EntityManager,
|
|
_eyeManager,
|
|
_resourceCache,
|
|
_entityLookup,
|
|
_userInterfaceManager,
|
|
_configurationManager);
|
|
_adminManager.AdminStatusUpdated += OnAdminStatusUpdated;
|
|
}
|
|
|
|
private void ShutdownOverlay()
|
|
{
|
|
_adminManager.AdminStatusUpdated -= OnAdminStatusUpdated;
|
|
}
|
|
|
|
private void OnAdminStatusUpdated()
|
|
{
|
|
AdminOverlayOff();
|
|
}
|
|
|
|
public void AdminOverlayOn()
|
|
{
|
|
if (_overlayManager.HasOverlay<AdminNameOverlay>()) return;
|
|
_overlayManager.AddOverlay(_adminNameOverlay);
|
|
OverlayEnabled?.Invoke();
|
|
}
|
|
|
|
public void AdminOverlayOff()
|
|
{
|
|
_overlayManager.RemoveOverlay<AdminNameOverlay>();
|
|
OverlayDisabled?.Invoke();
|
|
}
|
|
}
|
|
}
|