diff --git a/Content.Client/ClientContentIoC.cs b/Content.Client/ClientContentIoC.cs index 6a8e9ea10a..05dfbfa957 100644 --- a/Content.Client/ClientContentIoC.cs +++ b/Content.Client/ClientContentIoC.cs @@ -6,6 +6,7 @@ using Content.Client.Interfaces.Parallax; using Content.Client.Parallax; using Content.Client.Sandbox; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Content.Shared.Interfaces; using Robust.Shared.IoC; @@ -27,6 +28,7 @@ namespace Content.Client IoCManager.Register(); IoCManager.Register(); IoCManager.Register(); + IoCManager.Register(); } } } diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index 8eedfcc852..5077657039 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -1,4 +1,4 @@ -using System; +using System; using Content.Client.GameObjects.Components.Actor; using Content.Client.Input; using Content.Client.Interfaces; @@ -8,6 +8,7 @@ using Content.Client.Parallax; using Content.Client.Sandbox; using Content.Client.State; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Shared.GameObjects.Components; using Content.Shared.GameObjects.Components.Cargo; using Content.Shared.GameObjects.Components.Chemistry; @@ -167,10 +168,7 @@ namespace Content.Client IoCManager.Resolve().LoadParallax(); IoCManager.Resolve().PlayerJoinedServer += SubscribePlayerAttachmentEvents; - - var stylesheet = new NanoStyle(); - - IoCManager.Resolve().Stylesheet = stylesheet.Stylesheet; + IoCManager.Resolve().Initialize(); IoCManager.InjectDependencies(this); diff --git a/Content.Client/EscapeMenuOwner.cs b/Content.Client/EscapeMenuOwner.cs index 519d6e0692..5cbd33c1d8 100644 --- a/Content.Client/EscapeMenuOwner.cs +++ b/Content.Client/EscapeMenuOwner.cs @@ -5,7 +5,6 @@ using Robust.Client.Interfaces.Input; using Robust.Client.Interfaces.Placement; using Robust.Client.Interfaces.ResourceManagement; using Robust.Client.Interfaces.State; -using Robust.Client.State.States; using Robust.Shared.Input; using Robust.Shared.Interfaces.Configuration; using Robust.Shared.Interfaces.Map; diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs b/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs index 18b939d90b..dfb7e3c796 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs @@ -1,5 +1,6 @@ using Content.Client.GameObjects.Components.Mobs; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Robust.Client.Interfaces.GameObjects.Components; using Robust.Client.Interfaces.ResourceManagement; using Robust.Client.UserInterface; @@ -68,7 +69,7 @@ namespace Content.Client.GameObjects.Components.Actor (SubText = new Label { SizeFlagsVertical = SizeFlags.None, - StyleClasses = {NanoStyle.StyleClassLabelSubText} + StyleClasses = {StyleNano.StyleClassLabelSubText} }) } } diff --git a/Content.Client/GameObjects/Components/Chemistry/InjectorComponent.cs b/Content.Client/GameObjects/Components/Chemistry/InjectorComponent.cs index ab1bb415d1..bc064e32e6 100644 --- a/Content.Client/GameObjects/Components/Chemistry/InjectorComponent.cs +++ b/Content.Client/GameObjects/Components/Chemistry/InjectorComponent.cs @@ -1,4 +1,5 @@ using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Robust.Shared.Timing; using Content.Shared.GameObjects.Components.Chemistry; @@ -49,7 +50,7 @@ namespace Content.Client.GameObjects.Components.Chemistry public StatusControl(InjectorComponent parent) { _parent = parent; - _label = new RichTextLabel { StyleClasses = { NanoStyle.StyleClassItemStatus } }; + _label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } }; AddChild(_label); parent._uiUpdateNeeded = true; diff --git a/Content.Client/GameObjects/Components/Chemistry/ReagentDispenserWindow.cs b/Content.Client/GameObjects/Components/Chemistry/ReagentDispenserWindow.cs index d35b18346c..8461d0ac8b 100644 --- a/Content.Client/GameObjects/Components/Chemistry/ReagentDispenserWindow.cs +++ b/Content.Client/GameObjects/Components/Chemistry/ReagentDispenserWindow.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Shared.Chemistry; using Content.Shared.GameObjects.Components.Chemistry; using Robust.Client.Graphics.Drawing; @@ -218,7 +219,7 @@ namespace Content.Client.GameObjects.Components.Chemistry new Label { Text = $"{state.BeakerCurrentVolume}/{state.BeakerMaxVolume}", - StyleClasses = {NanoStyle.StyleClassLabelSecondaryColor} + StyleClasses = {StyleNano.StyleClassLabelSecondaryColor} } } }); @@ -247,12 +248,12 @@ namespace Content.Client.GameObjects.Components.Chemistry new Label { Text = $"{name}: ", - StyleClasses = {NanoStyle.StyleClassPowerStateGood} + StyleClasses = {StyleNano.StyleClassPowerStateGood} }, new Label { Text = $"{reagent.Quantity}u", - StyleClasses = {NanoStyle.StyleClassPowerStateGood} + StyleClasses = {StyleNano.StyleClassPowerStateGood} } } }); @@ -267,7 +268,7 @@ namespace Content.Client.GameObjects.Components.Chemistry new Label { Text = $"{reagent.Quantity}u", - StyleClasses = {NanoStyle.StyleClassLabelSecondaryColor} + StyleClasses = {StyleNano.StyleClassLabelSecondaryColor} } } }); diff --git a/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs b/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs index 4c9245b9b3..d6fcca29fd 100644 --- a/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Shared.Preferences.Appearance; using JetBrains.Annotations; using Robust.Client.GameObjects.Components.UserInterface; @@ -126,9 +127,9 @@ namespace Content.Client.GameObjects.Components var vBox = new VBoxContainer(); AddChild(vBox); - vBox.AddChild(_colorSliderR = new ColorSlider(NanoStyle.StyleClassSliderRed)); - vBox.AddChild(_colorSliderG = new ColorSlider(NanoStyle.StyleClassSliderGreen)); - vBox.AddChild(_colorSliderB = new ColorSlider(NanoStyle.StyleClassSliderBlue)); + vBox.AddChild(_colorSliderR = new ColorSlider(StyleNano.StyleClassSliderRed)); + vBox.AddChild(_colorSliderG = new ColorSlider(StyleNano.StyleClassSliderGreen)); + vBox.AddChild(_colorSliderB = new ColorSlider(StyleNano.StyleClassSliderBlue)); Action colorValueChanged = ColorValueChanged; _colorSliderR.OnValueChanged += colorValueChanged; diff --git a/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs b/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs index 0abeb69183..0d89ecfddb 100644 --- a/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs @@ -1,5 +1,6 @@ using System; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Shared.GameObjects.Components.Power; using Robust.Client.GameObjects.Components.UserInterface; using Robust.Client.Graphics.Drawing; @@ -47,15 +48,15 @@ namespace Content.Client.GameObjects.Components.Power { case ApcExternalPowerState.None: _externalPowerStateLabel.Text = "None"; - _externalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateNone); + _externalPowerStateLabel.SetOnlyStyleClass(StyleNano.StyleClassPowerStateNone); break; case ApcExternalPowerState.Low: _externalPowerStateLabel.Text = "Low"; - _externalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateLow); + _externalPowerStateLabel.SetOnlyStyleClass(StyleNano.StyleClassPowerStateLow); break; case ApcExternalPowerState.Good: _externalPowerStateLabel.Text = "Good"; - _externalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateGood); + _externalPowerStateLabel.SetOnlyStyleClass(StyleNano.StyleClassPowerStateGood); break; default: throw new ArgumentOutOfRangeException(); @@ -140,7 +141,7 @@ namespace Content.Client.GameObjects.Components.Power var externalStatus = new HBoxContainer(); var externalStatusLabel = new Label {Text = "External Power: "}; ExternalPowerStateLabel = new Label {Text = "Good"}; - ExternalPowerStateLabel.SetOnlyStyleClass(NanoStyle.StyleClassPowerStateGood); + ExternalPowerStateLabel.SetOnlyStyleClass(StyleNano.StyleClassPowerStateGood); externalStatus.AddChild(externalStatusLabel); externalStatus.AddChild(ExternalPowerStateLabel); rows.AddChild(externalStatus); diff --git a/Content.Client/GameObjects/Components/StackComponent.cs b/Content.Client/GameObjects/Components/StackComponent.cs index 717372091a..c24b1787a5 100644 --- a/Content.Client/GameObjects/Components/StackComponent.cs +++ b/Content.Client/GameObjects/Components/StackComponent.cs @@ -1,4 +1,5 @@ using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Content.Shared.GameObjects.Components; using Robust.Client.UserInterface; @@ -38,7 +39,7 @@ namespace Content.Client.GameObjects.Components public StatusControl(StackComponent parent) { _parent = parent; - _label = new RichTextLabel {StyleClasses = {NanoStyle.StyleClassItemStatus}}; + _label = new RichTextLabel {StyleClasses = {StyleNano.StyleClassItemStatus}}; AddChild(_label); parent._uiUpdateNeeded = true; diff --git a/Content.Client/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponent.cs b/Content.Client/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponent.cs index 1917dbcd65..d800e7cb5e 100644 --- a/Content.Client/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponent.cs +++ b/Content.Client/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponent.cs @@ -1,6 +1,7 @@ using System; using Content.Client.Animations; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Weapons.Ranged; @@ -174,7 +175,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged (_noMagazineLabel = new Label { Text = "No Magazine!", - StyleClasses = {NanoStyle.StyleClassItemStatus} + StyleClasses = {StyleNano.StyleClassItemStatus} }) } }, diff --git a/Content.Client/GameObjects/Components/WelderComponent.cs b/Content.Client/GameObjects/Components/WelderComponent.cs index dc7387b559..e5a64d5ccb 100644 --- a/Content.Client/GameObjects/Components/WelderComponent.cs +++ b/Content.Client/GameObjects/Components/WelderComponent.cs @@ -1,5 +1,6 @@ using System; using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components; @@ -46,7 +47,7 @@ namespace Content.Client.GameObjects.Components public StatusControl(WelderComponent parent) { _parent = parent; - _label = new RichTextLabel {StyleClasses = {NanoStyle.StyleClassItemStatus}}; + _label = new RichTextLabel {StyleClasses = {StyleNano.StyleClassItemStatus}}; AddChild(_label); parent._uiUpdateNeeded = true; diff --git a/Content.Client/Instruments/InstrumentMenu.cs b/Content.Client/Instruments/InstrumentMenu.cs index 0fb39bde2e..171263e811 100644 --- a/Content.Client/Instruments/InstrumentMenu.cs +++ b/Content.Client/Instruments/InstrumentMenu.cs @@ -1,5 +1,5 @@ using Content.Client.GameObjects.Components.Instruments; -using Content.Client.UserInterface; +using Content.Client.UserInterface.Stylesheets; using Robust.Client.Audio.Midi; using Robust.Client.Graphics.Drawing; using Robust.Client.Interfaces.UserInterface; @@ -148,7 +148,7 @@ namespace Content.Client.Instruments Align = Label.AlignMode.Center, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter, - StyleClasses = {NanoStyle.StyleClassLabelBig}, + StyleClasses = {StyleNano.StyleClassLabelBig}, Text = Loc.GetString("MIDI support is currently\nnot available on your platform.") } } diff --git a/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs b/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs index 30b8238d20..9de68993e6 100644 --- a/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs +++ b/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs @@ -9,6 +9,7 @@ using Robust.Shared.Localization; using Robust.Shared.Maths; using System; using System.Collections.Generic; +using Content.Client.UserInterface.Stylesheets; namespace Content.Client.UserInterface.Cargo { @@ -57,7 +58,7 @@ namespace Content.Client.UserInterface.Cargo var accountName = new HBoxContainer(); var accountNameLabel = new Label { Text = _loc.GetString("Account Name: "), - StyleClasses = { NanoStyle.StyleClassLabelKeyText } + StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _accountNameLabel = new Label { Text = "None" //Owner.Bank.Account.Name @@ -70,7 +71,7 @@ namespace Content.Client.UserInterface.Cargo var pointsLabel = new Label { Text = _loc.GetString("Points: "), - StyleClasses = { NanoStyle.StyleClassLabelKeyText } + StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _pointsLabel = new Label { @@ -84,7 +85,7 @@ namespace Content.Client.UserInterface.Cargo var shuttleStatusLabel = new Label { Text = _loc.GetString("Shuttle Status: "), - StyleClasses = { NanoStyle.StyleClassLabelKeyText } + StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _shuttleStatusLabel = new Label { @@ -410,13 +411,13 @@ namespace Content.Client.UserInterface.Cargo ProductName = new Label { SizeFlagsHorizontal = SizeFlags.FillExpand, - StyleClasses = { NanoStyle.StyleClassLabelSubText }, + StyleClasses = { StyleNano.StyleClassLabelSubText }, ClipText = true }; Description = new Label { SizeFlagsHorizontal = SizeFlags.FillExpand, - StyleClasses = { NanoStyle.StyleClassLabelSubText }, + StyleClasses = { StyleNano.StyleClassLabelSubText }, ClipText = true }; vBox.AddChild(ProductName); @@ -426,14 +427,14 @@ namespace Content.Client.UserInterface.Cargo Approve = new Button { Text = "Approve", - StyleClasses = { NanoStyle.StyleClassLabelSubText } + StyleClasses = { StyleNano.StyleClassLabelSubText } }; hBox.AddChild(Approve); Cancel = new Button { Text = "Cancel", - StyleClasses = { NanoStyle.StyleClassLabelSubText } + StyleClasses = { StyleNano.StyleClassLabelSubText } }; hBox.AddChild(Cancel); diff --git a/Content.Client/UserInterface/CharacterSetupGui.cs b/Content.Client/UserInterface/CharacterSetupGui.cs index 3f4291deeb..be82a1668d 100644 --- a/Content.Client/UserInterface/CharacterSetupGui.cs +++ b/Content.Client/UserInterface/CharacterSetupGui.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Client.GameObjects.Components.Mobs; using Content.Client.Interfaces; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Content.Shared.Jobs; using Content.Shared.Preferences; @@ -67,7 +68,7 @@ namespace Content.Client.UserInterface { SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd, Text = Loc.GetString("Save and close"), - StyleClasses = {NanoStyle.StyleClassButtonBig} + StyleClasses = {StyleNano.StyleClassButtonBig} }; var topHBox = new HBoxContainer @@ -83,7 +84,7 @@ namespace Content.Client.UserInterface new Label { Text = Loc.GetString("Character Setup"), - StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger}, + StyleClasses = {StyleNano.StyleClassLabelHeadingBigger}, VAlign = Label.VAlignMode.Center, SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter } @@ -99,7 +100,7 @@ namespace Content.Client.UserInterface { PanelOverride = new StyleBoxFlat { - BackgroundColor = NanoStyle.NanoGold, + BackgroundColor = StyleNano.NanoGold, ContentMarginTopOverride = 2 } }); @@ -146,7 +147,7 @@ namespace Content.Client.UserInterface hBox.AddChild(new PanelContainer { - PanelOverride = new StyleBoxFlat {BackgroundColor = NanoStyle.NanoGold}, + PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold}, CustomMinimumSize = (2, 0) }); _humanoidProfileEditor = new HumanoidProfileEditor(preferencesManager, prototypeManager); diff --git a/Content.Client/UserInterface/Controls/HighDivider.cs b/Content.Client/UserInterface/Controls/HighDivider.cs new file mode 100644 index 0000000000..29bdaabaee --- /dev/null +++ b/Content.Client/UserInterface/Controls/HighDivider.cs @@ -0,0 +1,14 @@ +using Content.Client.UserInterface.Stylesheets; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.Controls; + +namespace Content.Client.UserInterface.Controls +{ + public sealed class HighDivider : Control + { + public HighDivider() + { + Children.Add(new PanelContainer {StyleClasses = {StyleBase.ClassHighDivider}}); + } + } +} diff --git a/Content.Client/UserInterface/ItemStatusPanel.cs b/Content.Client/UserInterface/ItemStatusPanel.cs index e53a1cd522..fe94573a17 100644 --- a/Content.Client/UserInterface/ItemStatusPanel.cs +++ b/Content.Client/UserInterface/ItemStatusPanel.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Content.Client.GameObjects.Components; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Robust.Client.Graphics.Drawing; using Robust.Client.UserInterface; @@ -57,7 +58,7 @@ namespace Content.Client.UserInterface (_itemNameLabel = new Label { ClipText = true, - StyleClasses = {NanoStyle.StyleClassItemStatus} + StyleClasses = {StyleNano.StyleClassItemStatus} }) } } diff --git a/Content.Client/UserInterface/LobbyGui.cs b/Content.Client/UserInterface/LobbyGui.cs index 29624b8ced..4904eb6322 100644 --- a/Content.Client/UserInterface/LobbyGui.cs +++ b/Content.Client/UserInterface/LobbyGui.cs @@ -1,5 +1,6 @@ using Content.Client.Chat; using Content.Client.Interfaces; +using Content.Client.UserInterface.Stylesheets; using Content.Client.Utility; using Robust.Client.Graphics.Drawing; using Robust.Client.Interfaces.ResourceManagement; @@ -69,7 +70,7 @@ namespace Content.Client.UserInterface new Label { Text = Loc.GetString("Lobby"), - StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger}, + StyleClasses = {StyleNano.StyleClassLabelHeadingBigger}, /*MarginBottom = 40, MarginLeft = 8,*/ VAlign = Label.VAlignMode.Center @@ -78,7 +79,7 @@ namespace Content.Client.UserInterface }, (ServerName = new Label { - StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger}, + StyleClasses = {StyleNano.StyleClassLabelHeadingBigger}, /*MarginBottom = 40, GrowHorizontal = GrowDirection.Both,*/ VAlign = Label.VAlignMode.Center, @@ -88,7 +89,7 @@ namespace Content.Client.UserInterface { SizeFlagsHorizontal = SizeFlags.ShrinkEnd, Text = Loc.GetString("Leave"), - StyleClasses = {NanoStyle.StyleClassButtonBig}, + StyleClasses = {StyleNano.StyleClassButtonBig}, //GrowHorizontal = GrowDirection.Begin }) } @@ -100,7 +101,7 @@ namespace Content.Client.UserInterface { PanelOverride = new StyleBoxFlat { - BackgroundColor = NanoStyle.NanoGold, + BackgroundColor = StyleNano.NanoGold, ContentMarginTopOverride = 2 }, }); @@ -146,20 +147,20 @@ namespace Content.Client.UserInterface (ObserveButton = new Button { Text = Loc.GetString("Observe"), - StyleClasses = {NanoStyle.StyleClassButtonBig} + StyleClasses = {StyleNano.StyleClassButtonBig} }), (StartTime = new Label { SizeFlagsHorizontal = SizeFlags.FillExpand, Align = Label.AlignMode.Right, FontColorOverride = Color.DarkGray, - StyleClasses = {NanoStyle.StyleClassLabelBig} + StyleClasses = {StyleNano.StyleClassLabelBig} }), (ReadyButton = new Button { ToggleMode = true, Text = Loc.GetString("Ready Up"), - StyleClasses = {NanoStyle.StyleClassButtonBig} + StyleClasses = {StyleNano.StyleClassButtonBig} }), } } @@ -188,7 +189,7 @@ namespace Content.Client.UserInterface hBox.AddChild(new PanelContainer { - PanelOverride = new StyleBoxFlat {BackgroundColor = NanoStyle.NanoGold}, CustomMinimumSize = (2, 0) + PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold}, CustomMinimumSize = (2, 0) }); { diff --git a/Content.Client/UserInterface/NanoHeading.cs b/Content.Client/UserInterface/NanoHeading.cs index 30dde27fc5..d0ac77e9e7 100644 --- a/Content.Client/UserInterface/NanoHeading.cs +++ b/Content.Client/UserInterface/NanoHeading.cs @@ -1,3 +1,4 @@ +using Content.Client.UserInterface.Stylesheets; using Robust.Client.UserInterface.Controls; using Robust.Shared.Maths; @@ -14,7 +15,7 @@ namespace Content.Client.UserInterface { Children = {(_label = new Label { - StyleClasses = {NanoStyle.StyleClassLabelHeading} + StyleClasses = {StyleNano.StyleClassLabelHeading} })} }; AddChild(_panel); diff --git a/Content.Client/UserInterface/Stylesheets/IStylesheetManager.cs b/Content.Client/UserInterface/Stylesheets/IStylesheetManager.cs new file mode 100644 index 0000000000..2082ffb216 --- /dev/null +++ b/Content.Client/UserInterface/Stylesheets/IStylesheetManager.cs @@ -0,0 +1,12 @@ +using Robust.Client.UserInterface; + +namespace Content.Client.UserInterface.Stylesheets +{ + public interface IStylesheetManager + { + Stylesheet SheetNano { get; } + Stylesheet SheetSpace { get; } + + void Initialize(); + } +} diff --git a/Content.Client/UserInterface/Stylesheets/StyleBase.cs b/Content.Client/UserInterface/Stylesheets/StyleBase.cs new file mode 100644 index 0000000000..10562fad2f --- /dev/null +++ b/Content.Client/UserInterface/Stylesheets/StyleBase.cs @@ -0,0 +1,47 @@ +using Content.Client.Utility; +using Robust.Client.Graphics.Drawing; +using Robust.Client.Interfaces.ResourceManagement; +using Robust.Client.UserInterface; + +namespace Content.Client.UserInterface.Stylesheets +{ + public abstract class StyleBase + { + public const string ClassHighDivider = "HighDivider"; + public const string StyleClassLabelHeading = "LabelHeading"; + public const string StyleClassLabelSubText = "LabelSubText"; + + public abstract Stylesheet Stylesheet { get; } + + protected StyleRule[] BaseRules { get; } + + protected StyleBoxTexture BaseButton { get; } + + protected StyleBase(IResourceCache resCache) + { + var notoSans12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 12); + + // Button styles. + var buttonTex = resCache.GetTexture("/Nano/button.svg.96dpi.png"); + BaseButton = new StyleBoxTexture + { + Texture = buttonTex, + }; + BaseButton.SetPatchMargin(StyleBox.Margin.All, 10); + BaseButton.SetPadding(StyleBox.Margin.All, 1); + BaseButton.SetContentMarginOverride(StyleBox.Margin.Vertical, 2); + BaseButton.SetContentMarginOverride(StyleBox.Margin.Horizontal, 14); + + BaseRules = new[] + { + // Default font. + new StyleRule( + new SelectorElement(null, null, null, null), + new[] + { + new StyleProperty("font", notoSans12), + }), + }; + } + } +} diff --git a/Content.Client/UserInterface/NanoStyle.cs b/Content.Client/UserInterface/Stylesheets/StyleNano.cs similarity index 96% rename from Content.Client/UserInterface/NanoStyle.cs rename to Content.Client/UserInterface/Stylesheets/StyleNano.cs index 97cdd91310..e182012a55 100644 --- a/Content.Client/UserInterface/NanoStyle.cs +++ b/Content.Client/UserInterface/Stylesheets/StyleNano.cs @@ -1,29 +1,29 @@ -using Content.Client.GameObjects.EntitySystems; +using System.Linq; +using Content.Client.GameObjects.EntitySystems; using Content.Client.Utility; using Robust.Client.Graphics.Drawing; using Robust.Client.Interfaces.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; -using Robust.Shared.IoC; using Robust.Shared.Maths; -namespace Content.Client.UserInterface +namespace Content.Client.UserInterface.Stylesheets { - public sealed class NanoStyle + public sealed class StyleNano : StyleBase { public const string StyleClassSliderRed = "Red"; public const string StyleClassSliderGreen = "Green"; public const string StyleClassSliderBlue = "Blue"; - public const string StyleClassLabelHeading = "LabelHeading"; public const string StyleClassLabelHeadingBigger = "LabelHeadingBigger"; - public const string StyleClassLabelSubText = "LabelSubText"; public const string StyleClassLabelKeyText = "LabelKeyText"; public const string StyleClassLabelSecondaryColor = "LabelSecondaryColor"; public const string StyleClassLabelBig = "LabelBig"; public const string StyleClassButtonBig = "ButtonBig"; + public static readonly Color NanoGold = Color.FromHex("#A88B5E"); + public static readonly Color ButtonColorDefault = Color.FromHex("#464966"); public static readonly Color ButtonColorHovered = Color.FromHex("#575b7f"); public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45"); @@ -36,12 +36,10 @@ namespace Content.Client.UserInterface public const string StyleClassItemStatus = "ItemStatus"; - public Stylesheet Stylesheet { get; } + public override Stylesheet Stylesheet { get; } - public NanoStyle() + public StyleNano(IResourceCache resCache) : base(resCache) { - var resCache = IoCManager.Resolve(); - var notoSans8 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 8); var notoSans10 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 10); var notoSans12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 12); var notoSansBold12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Bold.ttf", 12); @@ -69,16 +67,10 @@ namespace Content.Client.UserInterface var textureInvertedTriangle = resCache.GetTexture("/Nano/inverted_triangle.svg.png"); // Button styles. - var buttonTex = resCache.GetTexture("/Nano/button.svg.96dpi.png"); - var buttonNormal = new StyleBoxTexture + var buttonNormal = new StyleBoxTexture(BaseButton) { - Texture = buttonTex, Modulate = ButtonColorDefault }; - buttonNormal.SetPatchMargin(StyleBox.Margin.All, 10); - buttonNormal.SetPadding(StyleBox.Margin.All, 1); - buttonNormal.SetContentMarginOverride(StyleBox.Margin.Vertical, 2); - buttonNormal.SetContentMarginOverride(StyleBox.Margin.Horizontal, 14); var buttonHover = new StyleBoxTexture(buttonNormal) { @@ -248,16 +240,8 @@ namespace Content.Client.UserInterface var sliderFillRed = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Red}; var sliderFillBlue = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Blue}; - Stylesheet = new Stylesheet(new[] + Stylesheet = new Stylesheet(BaseRules.Concat(new[] { - // Default font. - new StyleRule( - new SelectorElement(null, null, null, null), - new[] - { - new StyleProperty("font", notoSans12), - }), - // Window title. new StyleRule( new SelectorElement(typeof(Label), new[] {SS14Window.StyleClassWindowTitle}, null, null), @@ -721,7 +705,12 @@ namespace Content.Client.UserInterface { new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center), }), - }); + + new StyleRule(new SelectorElement(typeof(PanelContainer), new []{ ClassHighDivider}, null, null), new [] + { + new StyleProperty(PanelContainer.StylePropertyPanel, new StyleBoxFlat { BackgroundColor = NanoGold, ContentMarginBottomOverride = 2, ContentMarginLeftOverride = 2}), + }) + }).ToList()); } } } diff --git a/Content.Client/UserInterface/Stylesheets/StyleSpace.cs b/Content.Client/UserInterface/Stylesheets/StyleSpace.cs new file mode 100644 index 0000000000..9e4b318c6c --- /dev/null +++ b/Content.Client/UserInterface/Stylesheets/StyleSpace.cs @@ -0,0 +1,107 @@ +using System.Linq; +using Content.Client.Utility; +using Robust.Client.Graphics.Drawing; +using Robust.Client.Interfaces.ResourceManagement; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.Controls; +using Robust.Shared.Maths; + +namespace Content.Client.UserInterface.Stylesheets +{ + public class StyleSpace : StyleBase + { + public static readonly Color SpaceRed = Color.FromHex("#9b2236"); + + public static readonly Color ButtonColorDefault = Color.FromHex("#464966"); + public static readonly Color ButtonColorHovered = Color.FromHex("#575b7f"); + public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45"); + public static readonly Color ButtonColorDisabled = Color.FromHex("#30313c"); + + public override Stylesheet Stylesheet { get; } + + public StyleSpace(IResourceCache resCache) : base(resCache) + { + var notoSans10 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 10); + var notoSansBold16 = resCache.GetFont("/Nano/NotoSans/NotoSans-Bold.ttf", 16); + + // Button styles. + var buttonNormal = new StyleBoxTexture(BaseButton) + { + Modulate = ButtonColorDefault + }; + + var buttonHover = new StyleBoxTexture(buttonNormal) + { + Modulate = ButtonColorHovered + }; + + var buttonPressed = new StyleBoxTexture(buttonNormal) + { + Modulate = ButtonColorPressed + }; + + var buttonDisabled = new StyleBoxTexture(buttonNormal) + { + Modulate = ButtonColorDisabled + }; + + + Stylesheet = new Stylesheet(BaseRules.Concat(new StyleRule[] + { + // Big Label + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeading}, null, null), new[] + { + new StyleProperty(Label.StylePropertyFont, notoSansBold16), + new StyleProperty(Label.StylePropertyFontColor, SpaceRed), + }), + + // Small Label + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[] + { + new StyleProperty(Label.StylePropertyFont, notoSans10), + new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray), + }), + + new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {ClassHighDivider}, null, null), new[] + { + new StyleProperty(PanelContainer.StylePropertyPanel, + new StyleBoxFlat + { + BackgroundColor = SpaceRed, ContentMarginBottomOverride = 2, ContentMarginLeftOverride = 2 + }), + }), + + // Regular buttons! + new StyleRule(new SelectorElement(typeof(ContainerButton), new[] { ContainerButton.StyleClassButton }, null, new[] {ContainerButton.StylePseudoClassNormal}), new[] + { + new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonNormal), + }), + new StyleRule(new SelectorElement(typeof(ContainerButton), new[] { ContainerButton.StyleClassButton }, null, new[] {ContainerButton.StylePseudoClassHover}), new[] + { + new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonHover), + }), + new StyleRule(new SelectorElement(typeof(ContainerButton), new[] { ContainerButton.StyleClassButton }, null, new[] {ContainerButton.StylePseudoClassPressed}), new[] + { + new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonPressed), + }), + new StyleRule(new SelectorElement(typeof(ContainerButton), new[] { ContainerButton.StyleClassButton }, null, new[] {ContainerButton.StylePseudoClassDisabled}), new[] + { + new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonDisabled), + }), + + new StyleRule(new SelectorElement(typeof(Label), new[] { Button.StyleClassButton }, null, null), new[] + { + new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center), + }), + + new StyleRule(new SelectorChild( + new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), + new SelectorElement(typeof(Label), null, null, null)), + new[] + { + new StyleProperty("font-color", Color.FromHex("#E5E5E581")), + }), + }).ToList()); + } + } +} diff --git a/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs b/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs new file mode 100644 index 0000000000..49147d841e --- /dev/null +++ b/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs @@ -0,0 +1,26 @@ +using Robust.Client.Interfaces.ResourceManagement; +using Robust.Client.Interfaces.UserInterface; +using Robust.Client.UserInterface; +using Robust.Shared.IoC; + +namespace Content.Client.UserInterface.Stylesheets +{ + public sealed class StylesheetManager : IStylesheetManager + { +#pragma warning disable 649 + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; + [Dependency] private readonly IResourceCache _resourceCache; +#pragma warning restore 649 + + public Stylesheet SheetNano { get; private set; } + public Stylesheet SheetSpace { get; private set; } + + public void Initialize() + { + SheetNano = new StyleNano(_resourceCache).Stylesheet; + SheetSpace = new StyleSpace(_resourceCache).Stylesheet; + + _userInterfaceManager.Stylesheet = SheetNano; + } + } +}