mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Content.Client.UserInterface.Screens;
|
|
using Content.Client.UserInterface.Systems.Gameplay;
|
|
using Content.Client.Voting;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.UserInterface.Controllers;
|
|
|
|
namespace Content.Client.UserInterface.Systems.Vote;
|
|
|
|
[UsedImplicitly]
|
|
public sealed partial class VoteUIController : UIController
|
|
{
|
|
[Dependency] private IVoteManager _votes = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
var gameplayStateLoad = UIManager.GetUIController<GameplayStateLoadController>();
|
|
gameplayStateLoad.OnScreenLoad += OnScreenLoad;
|
|
gameplayStateLoad.OnScreenUnload += OnScreenUnload;
|
|
}
|
|
|
|
private void OnScreenLoad()
|
|
{
|
|
switch (UIManager.ActiveScreen)
|
|
{
|
|
case DefaultGameScreen game:
|
|
_votes.SetPopupContainer(game.VoteMenu);
|
|
break;
|
|
case SeparatedChatGameScreen separated:
|
|
_votes.SetPopupContainer(separated.VoteMenu);
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void OnScreenUnload()
|
|
{
|
|
_votes.ClearPopupContainer();
|
|
}
|
|
}
|