Files
wwdpublic/Content.Client/UserInterface/Systems/Vote/VoteUIController.cs
DEATHB4DEFEAT 544fd135de Default to Separated UI Layout (#433)
# Description

<sub>~~Change from Nyano~~</sub>
Uses space a lot better. The old layout still exists if people want it
for whatever reason.
I also renamed "Default" to "Overlay", which should stay anyway if the
default change is denied.

---

<details><summary><h1>Media</h1></summary>
<p>

## Separated


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/b97c4373-99ac-4ac5-80a5-149122238551)

## Overlay


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/3891756f-91f0-4336-b075-6c461ee1b8e6)

</p>
</details>

---

# Changelog

🆑
- tweak: UI layout now defaults to separated, the old one is still
available in settings
2024-06-16 18:38:10 -04:00

40 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 class VoteUIController : UIController
{
[Dependency] private readonly 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 SeparatedChatGameScreen separated:
_votes.SetPopupContainer(separated.VoteMenu);
break;
case OverlayChatGameScreen overlay:
_votes.SetPopupContainer(overlay.VoteMenu);
break;
}
}
private void OnScreenUnload()
{
_votes.ClearPopupContainer();
}
}