Voting (#3185)
* Basic voting * Rewrite lobby in XAML. Working lobby voting. * Escape menu is now XAML. * Vote menu works, custom votes, gamemode votes. * Vote timeouts & administration. Basically done now. * I will now pretend I was never planning to code voting hotkeys. * Make vote call UI a bit... funny. * Fix exception on round restart. * Fix some vote command definitions.
This commit is contained in:
committed by
GitHub
parent
db290fd91e
commit
cea87d6985
55
Content.Client/UserInterface/EscapeMenu.xaml.cs
Normal file
55
Content.Client/UserInterface/EscapeMenu.xaml.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
internal partial class EscapeMenu : SS14Window
|
||||
{
|
||||
private readonly IClientConsoleHost _consoleHost;
|
||||
|
||||
private OptionsMenu optionsMenu;
|
||||
|
||||
public EscapeMenu(IClientConsoleHost consoleHost)
|
||||
{
|
||||
_consoleHost = consoleHost;
|
||||
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
optionsMenu = new OptionsMenu();
|
||||
|
||||
OptionsButton.OnPressed += OnOptionsButtonClicked;
|
||||
QuitButton.OnPressed += OnQuitButtonClicked;
|
||||
DisconnectButton.OnPressed += OnDisconnectButtonClicked;
|
||||
}
|
||||
|
||||
private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
_consoleHost.ExecuteCommand("quit");
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private void OnDisconnectButtonClicked(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
_consoleHost.ExecuteCommand("disconnect");
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private void OnOptionsButtonClicked(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
optionsMenu.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (disposing)
|
||||
{
|
||||
optionsMenu.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user