diff --git a/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs b/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs index cf705ee7ff..d8f6cd4d05 100644 --- a/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs @@ -1,4 +1,5 @@ using System; +using Content.Client.UserInterface; using Content.Shared.GameObjects.Components.Power; using NJsonSchema.Validation; using OpenTK.Graphics.OpenGL4; @@ -55,12 +56,15 @@ namespace Content.Client.GameObjects.Components.Power { case ApcExternalPowerState.None: _externalPowerStateLabel.Text = "None"; + _externalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateNone); break; case ApcExternalPowerState.Low: _externalPowerStateLabel.Text = "Low"; + _externalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateLow); break; case ApcExternalPowerState.Good: _externalPowerStateLabel.Text = "Good"; + _externalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateGood); break; default: throw new ArgumentOutOfRangeException(); @@ -145,10 +149,11 @@ namespace Content.Client.GameObjects.Components.Power var externalStatus = new HBoxContainer("ExternalStatus"); var externalStatusLabel = new Label("Label") { Text = "External Power: " }; ExternalPowerStateLabel = new Label("Status") { Text = "Good" }; + ExternalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateGood); externalStatus.AddChild(externalStatusLabel); externalStatus.AddChild(ExternalPowerStateLabel); rows.AddChild(externalStatus); - + var charge = new HBoxContainer("Charge"); var chargeLabel = new Label("Label") { Text = "Charge:" }; ChargeBar = new ProgressBar("Charge") diff --git a/Content.Client/UserInterface/NanoStyle.cs b/Content.Client/UserInterface/NanoStyle.cs index 77f5b76f2f..d6379e9294 100644 --- a/Content.Client/UserInterface/NanoStyle.cs +++ b/Content.Client/UserInterface/NanoStyle.cs @@ -1,4 +1,4 @@ -using Content.Client.GameObjects.EntitySystems; +using Content.Client.GameObjects.EntitySystems; using Content.Client.Utility; using Robust.Client.Graphics.Drawing; using Robust.Client.Interfaces.ResourceManagement; @@ -16,6 +16,11 @@ namespace Content.Client.UserInterface public const string StyleClassButtonBig = "ButtonBig"; private static readonly Color NanoGold = Color.FromHex("#A88B5E"); + //Used by the APC and SMES menus + public const string StyleClassPowerStateNone = "PowerStateNone"; + public const string StyleClassPowerStateLow = "PowerStateLow"; + public const string StyleClassPowerStateGood = "PowerStateGood"; + public Stylesheet Stylesheet { get; } public NanoStyle() @@ -420,6 +425,22 @@ namespace Content.Client.UserInterface { new StyleProperty("font", notoSans16) }), + + //APC and SMES power state label colors + new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassPowerStateNone}, null, null), new [] + { + new StyleProperty(Label.StylePropertyFontColor, new Color(0.8f, 0.0f, 0.0f)) + }), + + new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassPowerStateLow}, null, null), new [] + { + new StyleProperty(Label.StylePropertyFontColor, new Color(0.9f, 0.36f, 0.0f)) + }), + + new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassPowerStateGood}, null, null), new [] + { + new StyleProperty(Label.StylePropertyFontColor, new Color(0.024f, 0.8f, 0.0f)) + }), }); } }