2022-03-16 22:58:35 +01:00
|
|
|
|
using Content.Shared.CCVar;
|
|
|
|
|
|
using Robust.Client.AutoGenerated;
|
2021-02-21 12:38:56 +01:00
|
|
|
|
using Robust.Client.UserInterface;
|
2022-03-16 22:58:35 +01:00
|
|
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
|
|
using Robust.Shared.Configuration;
|
2021-02-17 09:39:31 -03:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Client.Administration.UI.Tabs
|
2021-02-17 09:39:31 -03:00
|
|
|
|
{
|
|
|
|
|
|
[GenerateTypedNameReferences]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed partial class ServerTab : Control
|
2021-02-17 09:39:31 -03:00
|
|
|
|
{
|
2022-03-16 22:58:35 +01:00
|
|
|
|
[Dependency] private readonly IConfigurationManager _config = default!;
|
|
|
|
|
|
|
|
|
|
|
|
public ServerTab()
|
|
|
|
|
|
{
|
|
|
|
|
|
RobustXamlLoader.Load(this);
|
|
|
|
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
|
|
|
|
|
|
|
|
_config.OnValueChanged(CCVars.OocEnabled, OocEnabledChanged, true);
|
|
|
|
|
|
_config.OnValueChanged(CCVars.LoocEnabled, LoocEnabledChanged, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-02-17 09:39:31 -03:00
|
|
|
|
}
|
|
|
|
|
|
}
|