Add panic bunker toggle to admin menu (#13450)

This commit is contained in:
Morb
2023-01-20 18:25:35 +03:00
committed by GitHub
parent 72704c3f31
commit f0429edbb1
6 changed files with 26 additions and 8 deletions

View File

@@ -5,9 +5,9 @@
MinSize="50 50">
<GridContainer
Columns="4" >
<cc:CommandButton Command="restart" Text="{Loc server-reboot}" />
<cc:CommandButton Command="shutdown" Text="{Loc server-shutdown}" />
<cc:CommandButton Name="SetOocButton" Command="setooc" Text="{Loc server-ooc-toggle}" ToggleMode="True" />
<cc:CommandButton Name="SetLoocButton" Command="setlooc" Text="{Loc server-looc-toggle}" ToggleMode="True" />
<cc:CommandButton Name="SetPanicbunkerButton" Command="panicbunker" Text="{Loc server-panicbunker-toggle}" ToggleMode="True" />
</GridContainer>
</Control>

View File

@@ -18,6 +18,7 @@ namespace Content.Client.Administration.UI.Tabs
_config.OnValueChanged(CCVars.OocEnabled, OocEnabledChanged, true);
_config.OnValueChanged(CCVars.LoocEnabled, LoocEnabledChanged, true);
_config.OnValueChanged(CCVars.PanicBunkerEnabled, BunkerEnabledChanged, true);
}
private void OocEnabledChanged(bool value)
@@ -30,6 +31,11 @@ namespace Content.Client.Administration.UI.Tabs
SetLoocButton.Pressed = value;
}
private void BunkerEnabledChanged(bool value)
{
SetPanicbunkerButton.Pressed = value;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
@@ -38,6 +44,7 @@ namespace Content.Client.Administration.UI.Tabs
{
_config.UnsubValueChanged(CCVars.OocEnabled, OocEnabledChanged);
_config.UnsubValueChanged(CCVars.LoocEnabled, LoocEnabledChanged);
_config.UnsubValueChanged(CCVars.PanicBunkerEnabled, BunkerEnabledChanged);
}
}
}