Add a safety net to the round controls in the Admin window. (#37836)

some changes.
This commit is contained in:
Kyle Tyo
2025-05-25 22:37:21 -04:00
committed by GitHub
parent e0666cc510
commit 2ec019dc0f
2 changed files with 19 additions and 5 deletions

View File

@@ -1,13 +1,13 @@
<Control <Control
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Margin="4" Margin="4"
MinSize="50 50"> MinSize="50 50">
<GridContainer <GridContainer
Columns="3"> Columns="3">
<cc:CommandButton Command="startround" Text="{Loc administration-ui-round-tab-start-round}" /> <controls:ConfirmButton Name="StartRound" Text="{Loc administration-ui-round-tab-start-round}" />
<cc:CommandButton Command="endround" Text="{Loc administration-ui-round-tab-end-round}" /> <controls:ConfirmButton Name="EndRound" Text="{Loc administration-ui-round-tab-end-round}" />
<cc:CommandButton Command="restartround" Text="{Loc administration-ui-round-tab-restart-round}" /> <controls:ConfirmButton Name="RestartRound" Text="{Loc administration-ui-round-tab-restart-round}" />
<cc:CommandButton Command="restartroundnow" Text="{Loc administration-ui-round-tab-restart-round-now}" /> <controls:ConfirmButton Name="RestartRoundNow" Text="{Loc administration-ui-round-tab-restart-round-now}" />
</GridContainer> </GridContainer>
</Control> </Control>

View File

@@ -1,10 +1,24 @@
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Administration.UI.Tabs namespace Content.Client.Administration.UI.Tabs
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public sealed partial class RoundTab : Control public sealed partial class RoundTab : Control
{ {
[Dependency] private readonly IClientConsoleHost _console = default!;
public RoundTab()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
StartRound.OnPressed += _ => _console.ExecuteCommand("startround");
EndRound.OnPressed += _ => _console.ExecuteCommand("endround");
RestartRound.OnPressed += _ => _console.ExecuteCommand("restartround");
RestartRoundNow.OnPressed += _ => _console.ExecuteCommand("restartroundnow");
}
} }
} }