From: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
Date: Sun, 14 Jan 2024 16:44:17 +0000 (+0100)
Subject: Plates & Cash gridinv visuals (#24075)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a747e6dda407cc93f8184be0712941606b19263e;p=space-station-14.git
Plates & Cash gridinv visuals (#24075)
---
diff --git a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs
index 0ca1797965..8b51a3f219 100644
--- a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs
+++ b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs
@@ -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)
diff --git a/Content.Shared/Item/ItemComponent.cs b/Content.Shared/Item/ItemComponent.cs
index 1ef6592b08..9fadfa0783 100644
--- a/Content.Shared/Item/ItemComponent.cs
+++ b/Content.Shared/Item/ItemComponent.cs
@@ -54,6 +54,12 @@ public sealed partial class ItemComponent : Component
///
[DataField, AutoNetworkedField]
public float StoredRotation = 0;
+
+ ///
+ /// An additional offset, in pixels, applied to the visual depiction of the item when displayed in the storage UI.
+ ///
+ [DataField, AutoNetworkedField]
+ public Vector2i StoredOffset;
}
///
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/plate.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/plate.yml
index a6ddd725b0..63c47df67e 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/plate.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/plate.yml
@@ -15,6 +15,10 @@
- type: Sprite
sprite: Objects/Consumable/Food/plates.rsi
state: plate
+ - type: Item
+ shape:
+ - 0,0,1,0
+ storedOffset: 0,-6
- type: DamageOnLand
damage:
types:
@@ -60,6 +64,10 @@
- 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:
@@ -106,6 +116,8 @@
- type: Sprite
sprite: Objects/Consumable/Food/plates.rsi
state: plate-small-trash
+ - type: Item
+ storedOffset: 0,-3
# Plastic Plate
@@ -118,6 +130,10 @@
- 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
@@ -131,6 +147,10 @@
- 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
@@ -146,6 +166,11 @@
- 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
diff --git a/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml b/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml
index 5925d3a848..27e19bc3bd 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml
@@ -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:
diff --git a/Resources/Textures/Objects/Economy/cash.rsi/cash.png b/Resources/Textures/Objects/Economy/cash.rsi/cash.png
index 3aad68162c..42e7b863e6 100644
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash.png differ
diff --git a/Resources/Textures/Objects/Economy/cash.rsi/cash_10.png b/Resources/Textures/Objects/Economy/cash.rsi/cash_10.png
index 2613a7508b..05c4775016 100644
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_10.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_10.png differ
diff --git a/Resources/Textures/Objects/Economy/cash.rsi/cash_100.png b/Resources/Textures/Objects/Economy/cash.rsi/cash_100.png
index 294fd8aafe..5862df6791 100644
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_100.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_100.png differ
diff --git a/Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png b/Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png
index f0334f24c0..6a5688cd86 100644
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_1000.png differ
diff --git a/Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png b/Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png
index ad723d598b..389f00ce15 100644
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_1000000.png differ
diff --git a/Resources/Textures/Objects/Economy/cash.rsi/cash_500.png b/Resources/Textures/Objects/Economy/cash.rsi/cash_500.png
index 0ae0f2e454..5d68d914bf 100644
Binary files a/Resources/Textures/Objects/Economy/cash.rsi/cash_500.png and b/Resources/Textures/Objects/Economy/cash.rsi/cash_500.png differ