Files
tbd-station-14/Content.Client/Administration/UI/ManageSolutions/EditSolutionsEui.cs
Pieter-Jan Briers 3a2cd95d7f Fix solution editor UI (#24004)
Fixes #23645

The problem is that the solution editor UI is an EUI, so the UI updates before the game states are applied.

A correct fix would be to move it to a BUI in some way, but that's a little involved as we don't really have pre-existing code that uses BUIs in a manner good for this. I decided against this because I realized we'd want to have more tools similar to this and tbh I kinda figured integrating it with VV would be a better fix instead, so...

This is a bad workaround to manually synchronize the UI updates against game timing. It's not pretty but it works.
2024-01-13 15:52:42 +11:00

41 lines
1.0 KiB
C#

using Content.Client.Eui;
using Content.Shared.Administration;
using Content.Shared.Eui;
using JetBrains.Annotations;
namespace Content.Client.Administration.UI.ManageSolutions
{
/// <summary>
/// Admin Eui for displaying and editing the reagents in a solution.
/// </summary>
[UsedImplicitly]
public sealed class EditSolutionsEui : BaseEui
{
private readonly EditSolutionsWindow _window;
public EditSolutionsEui()
{
_window = new EditSolutionsWindow();
_window.OnClose += () => SendMessage(new CloseEuiMessage());
}
public override void Opened()
{
base.Opened();
_window.OpenCentered();
}
public override void Closed()
{
base.Closed();
_window.Close();
}
public override void HandleState(EuiStateBase baseState)
{
var state = (EditSolutionsEuiState) baseState;
_window.SetState(state);
}
}
}