]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Ashen hud item status slot fix (#31411)
authorZachary Yona <58833995+Magicalus@users.noreply.github.com>
Tue, 22 Apr 2025 18:40:58 +0000 (14:40 -0400)
committerGitHub <noreply@github.com>
Tue, 22 Apr 2025 18:40:58 +0000 (14:40 -0400)
* new patchMargin variable added, horizontals fixed

* All sides now work, system is fully integarated

---------

Co-authored-by: Zachary Yona <magicalusf@gmail.com>
Content.Client/UserInterface/Systems/Inventory/Controls/ItemStatusPanel.xaml.cs
Resources/Prototypes/themes.yml

index 95951fa1b0d8febe5f91129c422ac617970acbfa..f7f6f2b561370f83cde1e41767f92b6010376b95 100644 (file)
@@ -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;
     }
index 3952687255a68fa37da69573648bb5b5c2f0a392..1c17362d1c43a0a0c909b0479a639c6398602f44 100644 (file)
@@ -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/
     disabledFore: "#FFF5EE"
     _itemstatus_content_margin_right: "#06060604"
     _itemstatus_content_margin_left: "#06060604"
+    _itemstatus_patch_margin: "#07060505"