Files
crystall-punk-14/Content.Client/Administration/UI/Tabs/ServerTab.xaml.cs

45 lines
1.2 KiB
C#
Raw Normal View History

using Content.Shared.CCVar;
using Robust.Client.AutoGenerated;
2021-02-21 12:38:56 +01:00
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Configuration;
2021-06-09 22:19:39 +02:00
namespace Content.Client.Administration.UI.Tabs
{
[GenerateTypedNameReferences]
public sealed partial class ServerTab : Control
{
[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);
}
}
}
}