From 6724a9e6abbc4b3c3ca5337ef157b41b589156cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Sun, 6 Sep 2020 17:16:08 +0200 Subject: [PATCH 01/16] Fix jenkins build --- .../Components/LightBehaviourComponent.cs | 13 +++++-------- .../Components/LightBehaviourComponent.cs | 5 ++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Content.Client/GameObjects/Components/LightBehaviourComponent.cs b/Content.Client/GameObjects/Components/LightBehaviourComponent.cs index 83ff452c0e..4e50dd2905 100644 --- a/Content.Client/GameObjects/Components/LightBehaviourComponent.cs +++ b/Content.Client/GameObjects/Components/LightBehaviourComponent.cs @@ -1,5 +1,4 @@ - -using System; +using System; using System.Collections.Generic; using Robust.Client.GameObjects; using Robust.Shared.Animations; @@ -13,8 +12,6 @@ using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Interfaces.Serialization; using Robust.Client.Animations; -using Robust.Shared.Interfaces.GameObjects; -using Microsoft.CodeAnalysis.CSharp.Syntax; using Robust.Client.GameObjects.Components.Animations; using System.Linq; @@ -43,7 +40,7 @@ namespace Content.Client.GameObjects.Components protected IRobustRandom RobustRandom = default; private float _maxTime = default; - + public virtual void ExposeData(ObjectSerializer serializer) { serializer.DataField(this, x => x.ID, "id", string.Empty); @@ -83,7 +80,7 @@ namespace Content.Client.GameObjects.Components MaxTime = MaxDuration; } - owner.Length = TimeSpan.FromSeconds(MaxTime); + owner.Length = TimeSpan.FromSeconds(MaxTime); } public override (int KeyFrameIndex, float FramePlayingTime) InitPlayback() @@ -344,7 +341,7 @@ namespace Content.Client.GameObjects.Components /// A component which applies a specific behaviour to a PointLightComponent on its owner. /// [RegisterComponent] - public class LightBehaviourComponent : SharedLightBehaviourComponent + public class LightBehaviourComponent : SharedLightBehaviourComponent { private const string KeyPrefix = nameof(LightBehaviourComponent); @@ -387,7 +384,7 @@ namespace Content.Client.GameObjects.Components container.LightBehaviour.Initialize(_lightComponent); } - // we need to initialize all behaviours before starting any + // we need to initialize all behaviours before starting any foreach (var container in _animations) { if (container.LightBehaviour.Enabled) diff --git a/Content.Server/GameObjects/Components/LightBehaviourComponent.cs b/Content.Server/GameObjects/Components/LightBehaviourComponent.cs index 0ab3b8951c..d36a4caa79 100644 --- a/Content.Server/GameObjects/Components/LightBehaviourComponent.cs +++ b/Content.Server/GameObjects/Components/LightBehaviourComponent.cs @@ -1,5 +1,4 @@ - -using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects; using Content.Shared.GameObjects.Components; namespace Content.Server.GameObjects.Components @@ -8,7 +7,7 @@ namespace Content.Server.GameObjects.Components /// A component which applies a specific behaviour to a PointLightComponent on its owner. /// [RegisterComponent] - public class LightBehaviourComponent : SharedLightBehaviourComponent + public class LightBehaviourComponent : SharedLightBehaviourComponent { } From 071a961d005afe4625ae12df805b976c85f37380 Mon Sep 17 00:00:00 2001 From: Exp Date: Sun, 6 Sep 2020 19:08:04 +0200 Subject: [PATCH 02/16] Disables Tile Prying Can't reach msg (#2030) --- .../GameObjects/Components/Interactable/TilePryingComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs b/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs index 9d88c4a0a2..848c8ceba6 100644 --- a/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs @@ -41,7 +41,7 @@ namespace Content.Server.GameObjects.Components.Interactable var coordinates = mapGrid.GridTileToLocal(tile.GridIndices); - if (!user.InRangeUnobstructed(coordinates, popup: true)) + if (!user.InRangeUnobstructed(coordinates, popup: false)) return; var tileDef = (ContentTileDefinition)_tileDefinitionManager[tile.Tile.TypeId]; From 204b50c201794362c29a0864ea8b1894c9aae09d Mon Sep 17 00:00:00 2001 From: derek Date: Mon, 7 Sep 2020 01:17:24 -0700 Subject: [PATCH 03/16] Change OpenUI into ToggleUI on the client side. (#2036) --- .../Storage/ClientStorageComponent.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs index 4c5d5dce36..2cf1b964c4 100644 --- a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs +++ b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs @@ -34,7 +34,7 @@ namespace Content.Client.GameObjects.Components.Storage base.OnAdd(); Window = new StorageWindow() - {StorageEntity = this, Title = Owner.Name}; + { StorageEntity = this, Title = Owner.Name }; } public override void OnRemove() @@ -55,7 +55,7 @@ namespace Content.Client.GameObjects.Components.Storage break; //Opens the UI case OpenStorageUIMessage _: - OpenUI(); + ToggleUI(); break; case CloseStorageUIMessage _: CloseUI(); @@ -76,11 +76,14 @@ namespace Content.Client.GameObjects.Components.Storage } /// - /// Opens the storage UI + /// Opens the storage UI if closed. Closes it if opened. /// - private void OpenUI() + private void ToggleUI() { - Window.Open(); + if (Window.IsOpen) + Window.Close(); + else + Window.Open(); } private void CloseUI() @@ -107,8 +110,8 @@ namespace Content.Client.GameObjects.Components.Storage private Label Information; public ClientStorageComponent StorageEntity; - private StyleBoxFlat _HoveredBox = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.35f)}; - private StyleBoxFlat _unHoveredBox = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.0f)}; + private StyleBoxFlat _HoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.35f) }; + private StyleBoxFlat _unHoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.0f) }; protected override Vector2? CustomSize => (180, 320); From 08e9fad4e19a77f453ce110ad7044c92886b9a9b Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 7 Sep 2020 09:25:49 +0200 Subject: [PATCH 04/16] Keybind is now a word. --- SpaceStation14.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings index 6e40eed366..70e73486b8 100644 --- a/SpaceStation14.sln.DotSettings +++ b/SpaceStation14.sln.DotSettings @@ -76,6 +76,8 @@ True True True + True + True True True True From a1c1769d23aa203c303859d92a6d801586ca7ff4 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 7 Sep 2020 10:52:54 +0200 Subject: [PATCH 05/16] Rework button styling to add a "caution" button type. It's red. --- .../UserInterface/Stylesheets/StyleBase.cs | 2 + .../UserInterface/Stylesheets/StyleNano.cs | 136 +++++++----------- .../UserInterface/Stylesheets/StyleSpace.cs | 105 +++++--------- 3 files changed, 88 insertions(+), 155 deletions(-) diff --git a/Content.Client/UserInterface/Stylesheets/StyleBase.cs b/Content.Client/UserInterface/Stylesheets/StyleBase.cs index 939c23ecb5..eaa74072ec 100644 --- a/Content.Client/UserInterface/Stylesheets/StyleBase.cs +++ b/Content.Client/UserInterface/Stylesheets/StyleBase.cs @@ -17,6 +17,8 @@ namespace Content.Client.UserInterface.Stylesheets public const string ButtonOpenLeft = "OpenLeft"; public const string ButtonOpenBoth = "OpenBoth"; + public const string ButtonCaution = "Caution"; + public abstract Stylesheet Stylesheet { get; } protected StyleRule[] BaseRules { get; } diff --git a/Content.Client/UserInterface/Stylesheets/StyleNano.cs b/Content.Client/UserInterface/Stylesheets/StyleNano.cs index 475ba6d33f..d71f56a74e 100644 --- a/Content.Client/UserInterface/Stylesheets/StyleNano.cs +++ b/Content.Client/UserInterface/Stylesheets/StyleNano.cs @@ -31,6 +31,11 @@ namespace Content.Client.UserInterface.Stylesheets public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45"); public static readonly Color ButtonColorDisabled = Color.FromHex("#30313c"); + public static readonly Color ButtonColorCautionDefault = Color.FromHex("#d31a1a"); + public static readonly Color ButtonColorCautionHovered = Color.FromHex("#e83838"); + public static readonly Color ButtonColorCautionPressed = Color.FromHex("#3e6c45"); + public static readonly Color ButtonColorCautionDisabled = Color.FromHex("#822626"); + //Used by the APC and SMES menus public const string StyleClassPowerStateNone = "PowerStateNone"; public const string StyleClassPowerStateLow = "PowerStateLow"; @@ -70,30 +75,6 @@ namespace Content.Client.UserInterface.Stylesheets var textureInvertedTriangle = resCache.GetTexture("/Textures/Interface/Nano/inverted_triangle.svg.png"); - static (StyleBox, StyleBox, StyleBox, StyleBox) ButtonPermutations(StyleBoxTexture @base) - { - var normal = new StyleBoxTexture(@base) {Modulate = ButtonColorDefault}; - var hover = new StyleBoxTexture(@base) {Modulate = ButtonColorHovered}; - var pressed = new StyleBoxTexture(@base) {Modulate = ButtonColorPressed}; - var disabled = new StyleBoxTexture(@base) {Modulate = ButtonColorDisabled}; - - return (normal, hover, pressed, disabled); - } - - // Button styles. - var (buttonNormal, buttonHover, buttonPressed, buttonDisabled) - = ButtonPermutations(BaseButton); - - var (buttonRNormal, buttonRHover, buttonRPressed, buttonRDisabled) - = ButtonPermutations(BaseButtonOpenRight); - - var (buttonLNormal, buttonLHover, buttonLPressed, buttonLDisabled) - = ButtonPermutations(BaseButtonOpenLeft); - - var (buttonBNormal, buttonBHover, buttonBPressed, buttonBDisabled) - = ButtonPermutations(BaseButtonOpenBoth); - - var lineEditTex = resCache.GetTexture("/Textures/Interface/Nano/lineedit.png"); var lineEdit = new StyleBoxTexture { @@ -297,80 +278,60 @@ namespace Content.Client.UserInterface.Stylesheets new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#753131")), }), - // 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), - }), + // Shapes for the buttons. + Element().Class(ContainerButton.StyleClassButton) + .Prop(ContainerButton.StylePropertyStyleBox, BaseButton), + + Element().Class(ContainerButton.StyleClassButton) + .Class(ButtonOpenRight) + .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonOpenRight), + + Element().Class(ContainerButton.StyleClassButton) + .Class(ButtonOpenLeft) + .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonOpenLeft), + + Element().Class(ContainerButton.StyleClassButton) + .Class(ButtonOpenBoth) + .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonOpenBoth), new StyleRule(new SelectorElement(typeof(Label), new[] { Button.StyleClassButton }, null, null), new[] { new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center), }), - // Right open buttons. - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenRight) + // Colors for the buttons. + Element().Class(ContainerButton.StyleClassButton) .Pseudo(ContainerButton.StylePseudoClassNormal) - .Prop(ContainerButton.StylePropertyStyleBox, buttonRNormal), + .Prop(Control.StylePropertyModulateSelf, ButtonColorDefault), - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenRight) + Element().Class(ContainerButton.StyleClassButton) .Pseudo(ContainerButton.StylePseudoClassHover) - .Prop(ContainerButton.StylePropertyStyleBox, buttonRHover), + .Prop(Control.StylePropertyModulateSelf, ButtonColorHovered), - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenRight) + Element().Class(ContainerButton.StyleClassButton) .Pseudo(ContainerButton.StylePseudoClassPressed) - .Prop(ContainerButton.StylePropertyStyleBox, buttonRPressed), + .Prop(Control.StylePropertyModulateSelf, ButtonColorPressed), - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenRight) + Element().Class(ContainerButton.StyleClassButton) .Pseudo(ContainerButton.StylePseudoClassDisabled) - .Prop(ContainerButton.StylePropertyStyleBox, buttonRDisabled), + .Prop(Control.StylePropertyModulateSelf, ButtonColorDisabled), - // Left open buttons. - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenLeft) + // Colors for the caution buttons. + Element().Class(ContainerButton.StyleClassButton).Class(ButtonCaution) .Pseudo(ContainerButton.StylePseudoClassNormal) - .Prop(ContainerButton.StylePropertyStyleBox, buttonLNormal), + .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDefault), - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenLeft) + Element().Class(ContainerButton.StyleClassButton).Class(ButtonCaution) .Pseudo(ContainerButton.StylePseudoClassHover) - .Prop(ContainerButton.StylePropertyStyleBox, buttonLHover), + .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionHovered), - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenLeft) + Element().Class(ContainerButton.StyleClassButton).Class(ButtonCaution) .Pseudo(ContainerButton.StylePseudoClassPressed) - .Prop(ContainerButton.StylePropertyStyleBox, buttonLPressed), + .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionPressed), - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenLeft) + Element().Class(ContainerButton.StyleClassButton).Class(ButtonCaution) .Pseudo(ContainerButton.StylePseudoClassDisabled) - .Prop(ContainerButton.StylePropertyStyleBox, buttonLDisabled), - - // "Both" open buttons - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenBoth) - .Pseudo(ContainerButton.StylePseudoClassNormal) - .Prop(ContainerButton.StylePropertyStyleBox, buttonBNormal), - - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenBoth) - .Pseudo(ContainerButton.StylePseudoClassHover) - .Prop(ContainerButton.StylePropertyStyleBox, buttonBHover), - - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenBoth) - .Pseudo(ContainerButton.StylePseudoClassPressed) - .Prop(ContainerButton.StylePropertyStyleBox, buttonBPressed), - - Element().Class(ContainerButton.StyleClassButton).Class(ButtonOpenBoth) - .Pseudo(ContainerButton.StylePseudoClassDisabled) - .Prop(ContainerButton.StylePropertyStyleBox, buttonBDisabled), - + .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDisabled), new StyleRule(new SelectorChild( new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), @@ -649,25 +610,28 @@ namespace Content.Client.UserInterface.Stylesheets }), // Those top menu buttons. + Element() + .Prop(Button.StylePropertyStyleBox, BaseButton), + new StyleRule( new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassNormal}), new[] { - new StyleProperty(Button.StylePropertyStyleBox, buttonNormal), + new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorDefault), }), new StyleRule( new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassPressed}), new[] { - new StyleProperty(Button.StylePropertyStyleBox, buttonPressed), + new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorPressed), }), new StyleRule( new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassHover}), new[] { - new StyleProperty(Button.StylePropertyStyleBox, buttonHover), + new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorHovered), }), new StyleRule( @@ -758,21 +722,25 @@ namespace Content.Client.UserInterface.Stylesheets }), // OptionButton + new StyleRule(new SelectorElement(typeof(OptionButton), null, null, null), new[] + { + new StyleProperty(ContainerButton.StylePropertyStyleBox, BaseButton), + }), new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassNormal}), new[] { - new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonNormal), + new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDefault), }), new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassHover}), new[] { - new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonHover), + new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorHovered), }), new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassPressed}), new[] { - new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonPressed), + new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorPressed), }), new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), new[] { - new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonDisabled), + new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDisabled), }), new StyleRule(new SelectorElement(typeof(TextureRect), new[] {OptionButton.StyleClassOptionTriangle}, null, null), new[] diff --git a/Content.Client/UserInterface/Stylesheets/StyleSpace.cs b/Content.Client/UserInterface/Stylesheets/StyleSpace.cs index 696321ab7c..29a0676a20 100644 --- a/Content.Client/UserInterface/Stylesheets/StyleSpace.cs +++ b/Content.Client/UserInterface/Stylesheets/StyleSpace.cs @@ -18,6 +18,11 @@ namespace Content.Client.UserInterface.Stylesheets public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45"); public static readonly Color ButtonColorDisabled = Color.FromHex("#30313c"); + public static readonly Color ButtonColorCautionDefault = Color.FromHex("#d31a1a"); + public static readonly Color ButtonColorCautionHovered = Color.FromHex("#e83838"); + public static readonly Color ButtonColorCautionPressed = Color.FromHex("#3e6c45"); + public static readonly Color ButtonColorCautionDisabled = Color.FromHex("#822626"); + public override Stylesheet Stylesheet { get; } public StyleSpace(IResourceCache resCache) : base(resCache) @@ -25,29 +30,6 @@ namespace Content.Client.UserInterface.Stylesheets var notoSans10 = resCache.GetFont("/Textures/Interface/Nano/NotoSans/NotoSans-Regular.ttf", 10); var notoSansBold16 = resCache.GetFont("/Textures/Interface/Nano/NotoSans/NotoSans-Bold.ttf", 16); - static (StyleBox, StyleBox, StyleBox, StyleBox) ButtonPermutations(StyleBoxTexture @base) - { - var normal = new StyleBoxTexture(@base) {Modulate = ButtonColorDefault}; - var hover = new StyleBoxTexture(@base) {Modulate = ButtonColorHovered}; - var pressed = new StyleBoxTexture(@base) {Modulate = ButtonColorPressed}; - var disabled = new StyleBoxTexture(@base) {Modulate = ButtonColorDisabled}; - - return (normal, hover, pressed, disabled); - } - - // Button styles. - var (buttonNormal, buttonHover, buttonPressed, buttonDisabled) - = ButtonPermutations(BaseButton); - - var (buttonRNormal, buttonRHover, buttonRPressed, buttonRDisabled) - = ButtonPermutations(BaseButtonOpenRight); - - var (buttonLNormal, buttonLHover, buttonLPressed, buttonLDisabled) - = ButtonPermutations(BaseButtonOpenLeft); - - var (buttonBNormal, buttonBHover, buttonBPressed, buttonBDisabled) - = ButtonPermutations(BaseButtonOpenBoth); - Stylesheet = new Stylesheet(BaseRules.Concat(new StyleRule[] { Element