GravityGeneratorWindow to XAML UI (#4638)
* Move color handling to localization strings, small improvements * Create/move files to UI namespace * Actually change namespace * Move to XAML * Improve localization
This commit is contained in:
41
Content.Client/Gravity/UI/GravityGeneratorWindow.xaml.cs
Normal file
41
Content.Client/Gravity/UI/GravityGeneratorWindow.xaml.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Content.Client.Message;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Client.Gravity.UI
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class GravityGeneratorWindow : SS14Window
|
||||
{
|
||||
private readonly GravityGeneratorBoundUserInterface _owner;
|
||||
|
||||
public Button Switch => SwitchProtected;
|
||||
|
||||
public GravityGeneratorWindow(GravityGeneratorBoundUserInterface ui)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_owner = ui;
|
||||
|
||||
UpdateButton();
|
||||
}
|
||||
|
||||
public void UpdateButton()
|
||||
{
|
||||
string status = Loc.GetString(_owner.IsOn
|
||||
? "gravity-generator-window-is-on"
|
||||
: "gravity-generator-window-is-off");
|
||||
|
||||
Status.SetMarkup(Loc.GetString("gravity-generator-window-status-label", ("status", status)));
|
||||
|
||||
Switch.Text = Loc.GetString(_owner.IsOn
|
||||
? "gravity-generator-window-turn-off-button"
|
||||
: "gravity-generator-window-turn-on-button");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user