Adds "Quit Game" and "Disconnect" button to Escape Menu (#1602)
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Content.Client.UserInterface
|
|||||||
[Dependency] private readonly IClientConGroupController _conGroupController;
|
[Dependency] private readonly IClientConGroupController _conGroupController;
|
||||||
#pragma warning restore 649
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
private BaseButton DisconnectButton;
|
||||||
private BaseButton QuitButton;
|
private BaseButton QuitButton;
|
||||||
private BaseButton OptionsButton;
|
private BaseButton OptionsButton;
|
||||||
private BaseButton SpawnEntitiesButton;
|
private BaseButton SpawnEntitiesButton;
|
||||||
@@ -65,7 +66,7 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
Title = "Menu";
|
Title = "Menu";
|
||||||
|
|
||||||
var vBox = new VBoxContainer {SeparationOverride = 6};
|
var vBox = new VBoxContainer {SeparationOverride = 4};
|
||||||
Contents.AddChild(vBox);
|
Contents.AddChild(vBox);
|
||||||
|
|
||||||
SpawnEntitiesButton = new Button {Text = "Spawn Entities"};
|
SpawnEntitiesButton = new Button {Text = "Spawn Entities"};
|
||||||
@@ -83,12 +84,22 @@ namespace Content.Client.UserInterface
|
|||||||
OptionsButton.OnPressed += OnOptionsButtonClicked;
|
OptionsButton.OnPressed += OnOptionsButtonClicked;
|
||||||
vBox.AddChild(OptionsButton);
|
vBox.AddChild(OptionsButton);
|
||||||
|
|
||||||
QuitButton = new Button {Text = "Quit"};
|
DisconnectButton = new Button {Text = "Disconnect"};
|
||||||
|
DisconnectButton.OnPressed += OnDisconnectButtonClicked;
|
||||||
|
vBox.AddChild(DisconnectButton);
|
||||||
|
|
||||||
|
QuitButton = new Button { Text = "Quit Game" };
|
||||||
QuitButton.OnPressed += OnQuitButtonClicked;
|
QuitButton.OnPressed += OnQuitButtonClicked;
|
||||||
vBox.AddChild(QuitButton);
|
vBox.AddChild(QuitButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
|
private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
|
||||||
|
{
|
||||||
|
_console.ProcessCommand("quit");
|
||||||
|
Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisconnectButtonClicked(BaseButton.ButtonEventArgs args)
|
||||||
{
|
{
|
||||||
_console.ProcessCommand("disconnect");
|
_console.ProcessCommand("disconnect");
|
||||||
Dispose();
|
Dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user