From 063bbfa77c198eb6af9d8e22633eb18b20e40648 Mon Sep 17 00:00:00 2001 From: Zachary Yona <58833995+Magicalus@users.noreply.github.com> Date: Tue, 22 Apr 2025 14:40:58 -0400 Subject: [PATCH] Ashen hud item status slot fix (#31411) * new patchMargin variable added, horizontals fixed * All sides now work, system is fully integarated --------- Co-authored-by: Zachary Yona --- .../Inventory/Controls/ItemStatusPanel.xaml.cs | 17 +++++++++++++---- Resources/Prototypes/themes.yml | 7 +++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Inventory/Controls/ItemStatusPanel.xaml.cs b/Content.Client/UserInterface/Systems/Inventory/Controls/ItemStatusPanel.xaml.cs index 95951fa1b0..f7f6f2b561 100644 --- a/Content.Client/UserInterface/Systems/Inventory/Controls/ItemStatusPanel.xaml.cs +++ b/Content.Client/UserInterface/Systems/Inventory/Controls/ItemStatusPanel.xaml.cs @@ -38,6 +38,7 @@ public sealed partial class ItemStatusPanel : Control StyleBox.Margin cutOut; StyleBox.Margin flat; Thickness contentMargin; + Thickness patchMargin; switch (location) { @@ -61,15 +62,23 @@ public sealed partial class ItemStatusPanel : Control Contents.Margin = contentMargin; + //Important to note for patchMargin! + //Because of hand ui flipping, left and right instead correspond to outside and inside respectively. + patchMargin = MarginFromThemeColor("_itemstatus_patch_margin"); + var panel = (StyleBoxTexture) Panel.PanelOverride!; panel.Texture = texture; - panel.SetPatchMargin(flat, 4); - panel.SetPatchMargin(cutOut, 7); + panel.SetPatchMargin(cutOut, patchMargin.Left); + panel.SetPatchMargin(flat, patchMargin.Right); + panel.SetPatchMargin(StyleBox.Margin.Top, patchMargin.Top); + panel.SetPatchMargin(StyleBox.Margin.Bottom, patchMargin.Bottom); var panelHighlight = (StyleBoxTexture) HighlightPanel.PanelOverride!; panelHighlight.Texture = textureHighlight; - panelHighlight.SetPatchMargin(flat, 4); - panelHighlight.SetPatchMargin(cutOut, 7); + panelHighlight.SetPatchMargin(cutOut, patchMargin.Left); + panelHighlight.SetPatchMargin(flat, patchMargin.Right); + panelHighlight.SetPatchMargin(StyleBox.Margin.Top, patchMargin.Top); + panelHighlight.SetPatchMargin(StyleBox.Margin.Bottom, patchMargin.Bottom); _side = location; } diff --git a/Resources/Prototypes/themes.yml b/Resources/Prototypes/themes.yml index 3952687255..1c17362d1c 100644 --- a/Resources/Prototypes/themes.yml +++ b/Resources/Prototypes/themes.yml @@ -14,6 +14,7 @@ disabledFore: "#5A5A5A" _itemstatus_content_margin_right: "#06060404" _itemstatus_content_margin_left: "#04060604" + _itemstatus_patch_margin: "#07060404" - type: uiTheme id: SS14PlasmafireTheme path: /Textures/Interface/Plasmafire/ @@ -30,6 +31,7 @@ disabledFore: "#FFF5EE" _itemstatus_content_margin_right: "#06060404" _itemstatus_content_margin_left: "#04060604" + _itemstatus_patch_margin: "#07060404" - type: uiTheme id: SS14SlimecoreTheme path: /Textures/Interface/Slimecore/ @@ -46,6 +48,7 @@ disabledFore: "#FFF5EE" _itemstatus_content_margin_right: "#06060404" _itemstatus_content_margin_left: "#04060604" + _itemstatus_patch_margin: "#07060404" - type: uiTheme id: SS14ClockworkTheme path: /Textures/Interface/Clockwork/ @@ -62,6 +65,7 @@ disabledFore: "#FFF5EE" _itemstatus_content_margin_right: "#06060404" _itemstatus_content_margin_left: "#04060604" + _itemstatus_patch_margin: "#07060404" - type: uiTheme id: SS14RetroTheme path: /Textures/Interface/Retro/ @@ -78,6 +82,7 @@ disabledFore: "#FFF5EE" _itemstatus_content_margin_right: "#06060404" _itemstatus_content_margin_left: "#04060604" + _itemstatus_patch_margin: "#07060404" - type: uiTheme id: SS14MinimalistTheme path: /Textures/Interface/Minimalist/ @@ -94,6 +99,7 @@ disabledFore: "#5A5A5A" _itemstatus_content_margin_right: "#06060604" _itemstatus_content_margin_left: "#06060604" + _itemstatus_patch_margin: "#07060404" - type: uiTheme id: SS14AshenTheme path: /Textures/Interface/Ashen/ @@ -110,3 +116,4 @@ disabledFore: "#FFF5EE" _itemstatus_content_margin_right: "#06060604" _itemstatus_content_margin_left: "#06060604" + _itemstatus_patch_margin: "#07060505" -- 2.51.2