mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-06-09 10:06:43 +02:00
5168b5f3d4
* 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
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using Content.Shared.CCVar;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.Console;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Client.Administration.UI.Tabs
|
|
{
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class ServerTab : Control
|
|
{
|
|
[Dependency] private IConfigurationManager _config = default!;
|
|
[Dependency] private IClientConsoleHost _console = default!;
|
|
|
|
public ServerTab()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
_config.OnValueChanged(CCVars.OocEnabled, OocEnabledChanged, true);
|
|
_config.OnValueChanged(CCVars.LoocEnabled, LoocEnabledChanged, true);
|
|
|
|
ServerShutdownButton.OnPressed += _ => _console.ExecuteCommand("shutdown");
|
|
}
|
|
|
|
private void OocEnabledChanged(bool value)
|
|
{
|
|
SetOocButton.Pressed = value;
|
|
}
|
|
|
|
private void LoocEnabledChanged(bool value)
|
|
{
|
|
SetLoocButton.Pressed = value;
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
|
|
if (disposing)
|
|
{
|
|
_config.UnsubValueChanged(CCVars.OocEnabled, OocEnabledChanged);
|
|
_config.UnsubValueChanged(CCVars.LoocEnabled, LoocEnabledChanged);
|
|
}
|
|
}
|
|
}
|
|
}
|