Merge more UI refactor stuff (#11277)
* Changelog+options ui controller * Sandbox UI controller * Escape menu UI controller
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
<ui1:EscapeMenu xmlns="https://spacestation14.io"
|
||||
xmlns:changelog="clr-namespace:Content.Client.Changelog"
|
||||
xmlns:ui="clr-namespace:Content.Client.Voting.UI"
|
||||
xmlns:ui1="clr-namespace:Content.Client.Options.UI"
|
||||
Title="{Loc 'ui-escape-title'}"
|
||||
Resizable="False">
|
||||
|
||||
<BoxContainer Orientation="Vertical" SeparationOverride="4" MinWidth="150">
|
||||
<changelog:ChangelogButton />
|
||||
<changelog:ChangelogButton Access="Public" Name="ChangelogButton"/>
|
||||
<ui:VoteCallMenuButton />
|
||||
<Button Name="OptionsButton" Text="{Loc 'ui-escape-options'}" />
|
||||
<Button Name="RulesButton" Text="{Loc 'ui-escape-rules'}" />
|
||||
<Button Name="WikiButton" Text="{Loc 'ui-escape-wiki'}" />
|
||||
<Button Name="DisconnectButton" Text="{Loc 'ui-escape-disconnect'}" />
|
||||
<Button Name="QuitButton" Text="{Loc 'ui-escape-quit'}" />
|
||||
<Button Access="Public" Name="OptionsButton" Text="{Loc 'ui-escape-options'}" />
|
||||
<Button Access="Public" Name="RulesButton" Text="{Loc 'ui-escape-rules'}" />
|
||||
<Button Access="Public" Name="WikiButton" Text="{Loc 'ui-escape-wiki'}" />
|
||||
<Button Access="Public" Name="DisconnectButton" Text="{Loc 'ui-escape-disconnect'}" />
|
||||
<Button Access="Public" Name="QuitButton" Text="{Loc 'ui-escape-quit'}" />
|
||||
</BoxContainer>
|
||||
</DefaultWindow>
|
||||
</ui1:EscapeMenu>
|
||||
|
||||
@@ -1,69 +1,15 @@
|
||||
using Content.Client.Info;
|
||||
using Content.Client.Administration;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Client.UserInterface;
|
||||
using Content.Client.Links;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Options.UI
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
internal sealed partial class EscapeMenu : DefaultWindow
|
||||
public sealed partial class EscapeMenu : DefaultWindow
|
||||
{
|
||||
private readonly IClientConsoleHost _consoleHost;
|
||||
|
||||
private readonly OptionsMenu _optionsMenu;
|
||||
|
||||
public EscapeMenu(IClientConsoleHost consoleHost)
|
||||
public EscapeMenu()
|
||||
{
|
||||
_consoleHost = consoleHost;
|
||||
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
_optionsMenu = new OptionsMenu();
|
||||
|
||||
OptionsButton.OnPressed += OnOptionsButtonClicked;
|
||||
QuitButton.OnPressed += OnQuitButtonClicked;
|
||||
RulesButton.OnPressed += _ => new RulesAndInfoWindow().Open();
|
||||
DisconnectButton.OnPressed += OnDisconnectButtonClicked;
|
||||
WikiButton.OnPressed += OnWikiButtonClicked;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private void OnWikiButtonClicked(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
var uriOpener = IoCManager.Resolve<IUriOpener>();
|
||||
uriOpener.OpenUri(UILinks.Wiki);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
_optionsMenu.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Client.Options.UI
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<Control xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls">
|
||||
<tabs:GraphicsTab xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:tabs="clr-namespace:Content.Client.Options.UI.Tabs">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<BoxContainer Orientation="Vertical" Margin="8 8 8 8" VerticalExpand="True">
|
||||
<CheckBox Name="VSyncCheckBox" Text="{Loc 'ui-options-vsync'}" />
|
||||
@@ -45,4 +46,4 @@
|
||||
HorizontalAlignment="Right" />
|
||||
</controls:StripeBack>
|
||||
</BoxContainer>
|
||||
</Control>
|
||||
</tabs:GraphicsTab>
|
||||
|
||||
@@ -7,9 +7,6 @@ using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Options.UI.Tabs
|
||||
|
||||
Reference in New Issue
Block a user