mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* feat: Recent SSD indicator, SSD time in admin overlay * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * tweak: remove colon from ssd time loc string * feat: add another stage * feat: ssd examine text * apply suggestion: make ssdstage serializable, use proper doc comments Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me> * apply suggestion: more compact switch, throw instead of logging if invalid stage Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me> * apply suggestion: missing DeltaV comment Co-authored-by: Sir Warock <67167466+SirWarock@users.noreply.github.com> Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me> * fix: add missing import * refactor: remove unnecessary state-keeping i don't remember why i did it like that * chore: remove unused import * refactor: don't separate comp from ent --------- Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Co-authored-by: Sir Warock <67167466+SirWarock@users.noreply.github.com>
71 lines
2.5 KiB
C#
71 lines
2.5 KiB
C#
using Content.Client.Administration.Managers;
|
|
using Content.Shared.Roles;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.ResourceManagement;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Shared.Configuration;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Timing; // DeltaV - SSD time indicator
|
|
|
|
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!;
|
|
[Dependency] private readonly SharedRoleSystem _roles = default!;
|
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
|
[Dependency] private readonly IGameTiming _timing = default!; // DeltaV - added for SSD time indicator
|
|
|
|
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,
|
|
_roles,
|
|
_proto,
|
|
_timing); // DeltaV - Add timing
|
|
_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();
|
|
}
|
|
}
|
|
}
|