Files
Delta-v/Content.Client/_DV/RoundEnd/NoEorgPopupSystem.cs
T
deltanedasanddeltanedas ec94579ebc the great namespace refactor (#2574)
* refactor DeltaV/deltav resources to _DV

* change DeltaV namespaces to _DV

* add space before all DeltaV comments

* update xamls

* fix and move arena parallax to _DV

* more fix

* refactor even more stuff

* fix the grid fills

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2025-01-01 07:50:34 +00:00

37 lines
894 B
C#

using Content.Shared.GameTicking;
using Content.Shared._DV.CCVars;
using Robust.Shared.Configuration;
namespace Content.Client._DV.RoundEnd;
public sealed class NoEorgPopupSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
private NoEorgPopup? _window;
public override void Initialize()
{
base.Initialize();
SubscribeNetworkEvent<RoundEndMessageEvent>(OnRoundEnd);
}
private void OnRoundEnd(RoundEndMessageEvent ev)
{
if (_cfg.GetCVar(DCCVars.SkipRoundEndNoEorgPopup) || _cfg.GetCVar(DCCVars.RoundEndNoEorgPopup) == false)
return;
OpenNoEorgPopup();
}
private void OpenNoEorgPopup()
{
if (_window != null)
return;
_window = new NoEorgPopup();
_window.OpenCentered();
_window.OnClose += () => _window = null;
}
}