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
25 lines
792 B
C#
25 lines
792 B
C#
using Content.Client.Configurable.UI;
|
|
using Content.Shared.Configurable;
|
|
|
|
namespace Content.Client.Configurable;
|
|
|
|
public sealed partial class ConfigurationSystem : SharedConfigurationSystem
|
|
{
|
|
[Dependency] private SharedUserInterfaceSystem _uiSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<ConfigurationComponent, AfterAutoHandleStateEvent>(OnConfigurationState);
|
|
}
|
|
|
|
private void OnConfigurationState(Entity<ConfigurationComponent> ent, ref AfterAutoHandleStateEvent args)
|
|
{
|
|
if (_uiSystem.TryGetOpenUi<ConfigurationBoundUserInterface>(ent.Owner,
|
|
ConfigurationComponent.ConfigurationUiKey.Key,
|
|
out var bui))
|
|
{
|
|
bui.Refresh(ent);
|
|
}
|
|
}
|
|
}
|