]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Plates & Cash gridinv visuals (#24075)
authorPsychpsyo <60073468+Psychpsyo@users.noreply.github.com>
Sun, 14 Jan 2024 16:44:17 +0000 (17:44 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Jan 2024 16:44:17 +0000 (11:44 -0500)
Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs
Content.Shared/Item/ItemComponent.cs
Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/plate.yml
Resources/Prototypes/Entities/Objects/Misc/space_cash.yml
Resources/Textures/Objects/Economy/cash.rsi/cash.png
Resources/Textures/Objects/Economy/cash.rsi/cash_10.png
Resources/Textures/Objects/Economy/cash.rsi/cash_100.png
Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png
Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png
Resources/Textures/Objects/Economy/cash.rsi/cash_500.png

index 0ca1797965fa1deb3d63600bbb7955cc17ef98a2..8b51a3f219b2e90380cc5a7024ed41578c263912 100644 (file)
@@ -157,8 +157,8 @@ public sealed class ItemGridPiece : Control
         }
 
         // typically you'd divide by two, but since the textures are half a tile, this is done implicitly
-        var iconPosition = new Vector2((boundingGrid.Width + 1) * size.X ,
-            (boundingGrid.Height + 1) * size.Y);
+        var iconPosition = new Vector2((boundingGrid.Width + 1) * size.X + itemComponent.StoredOffset.X * 2,
+            (boundingGrid.Height + 1) * size.Y + itemComponent.StoredOffset.Y * 2);
         var iconRotation = Location.Rotation + Angle.FromDegrees(itemComponent.StoredRotation);
 
         if (itemComponent.StoredSprite is { } storageSprite)
index 1ef6592b08129abac8a949bffe3ca4bf4c001683..9fadfa0783c1609f6fdf7faa508aded5b8e66878 100644 (file)
@@ -54,6 +54,12 @@ public sealed partial class ItemComponent : Component
     /// </summary>
     [DataField, AutoNetworkedField]
     public float StoredRotation = 0;
+
+    /// <summary>
+    /// An additional offset, in pixels, applied to the visual depiction of the item when displayed in the storage UI.
+    /// </summary>
+    [DataField, AutoNetworkedField]
+    public Vector2i StoredOffset;
 }
 
 /// <summary>
index a6ddd725b008612120fc74b237fde131496af2c2..63c47df67e79207e4fceb8a873632307c834a601 100644 (file)
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: plate
+  - type: Item
+    shape:
+    - 0,0,1,0
+    storedOffset: 0,-6
   - type: DamageOnLand
     damage:
       types:
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: plate-trash
+  - type: Item
+    shape:
+    - 0,0,1,0
+    storedOffset: 0,-6
   - type: Tag
     tags:
     - Trash
@@ -76,6 +84,8 @@
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: plate-small
+  - type: Item
+    storedOffset: 0,-3
 # Needs the full thing because inherting is dumb sometimes.
   - type: Destructible
     thresholds:
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: plate-small-trash
+  - type: Item
+    storedOffset: 0,-3
 
 # Plastic Plate
 
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: plate-plastic
+  - type: Item
+    shape:
+    - 0,0,1,0
+    storedOffset: 0,-6
   - type: Tag
     tags:
     - Trash
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: plate-small-plastic
+  - type: Item
+    shape:
+    - 0,0,1,0
+    storedOffset: 0,-3
   - type: Tag
     tags:
     - Trash
   - type: Sprite
     sprite: Objects/Consumable/Food/plates.rsi
     state: tin
+  - type: Item
+    size: Small
+    shape:
+    - 0,0,1,0
+    storedOffset: 0,-3
   - type: Tag
     tags:
     - Trash
index 5925d3a8482b84f63503479168590e496cfddbb1..27e19bc3bd9468efc32341cbfe9c3a5c52596494 100644 (file)
@@ -4,6 +4,10 @@
   name: spesos
   description: You gotta have money.
   components:
+  - type: Item
+    shape:
+    - 0,0,1,0
+    storedOffset: 0,-2
   - type: Material
   - type: PhysicalComposition
     materialComposition:
index 3aad68162c08f3da27d18471cfb2df429468f5f5..42e7b863e685d9974b0f2cf88fe948c507cc45d9 100644 (file)
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash.png differ
index 2613a7508b2d6f5e40dd304df7a302fcd9bc43f3..05c477501682b5b2bd84e241465690655a617e43 100644 (file)
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_10.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_10.png differ
index 294fd8aafe9a0d8529f31634995ceb8bb24e7a7d..5862df67911ce2da6e85c5123eeb62f753eb3812 100644 (file)
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_100.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_100.png differ
index f0334f24c0eecce3d2383533bfbf759dc34d8ace..6a5688cd866d413a9e40239c01388bd43c060164 100644 (file)
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png differ
index ad723d598b85cec23e544372a87b63c3c7a80e76..389f00ce1593c4b2949549e763bd4050733f6379 100644 (file)
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png differ
index 0ae0f2e454e4c73150eba96b71a25d25f4bfe24c..5d68d914bfe725f19216c45bc268dc6376d0946f 100644 (file)
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_500.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_500.png differ