From 21de5e9a08929e8c710030b887c081bf6afc9649 Mon Sep 17 00:00:00 2001 From: Golinth Date: Sun, 17 Mar 2024 20:37:00 -0500 Subject: [PATCH] Criminal Record Icons below Job Icons (#26203) SS13 Criminal Record Icon Location REAL Adds a new Offset DataField to the StatusIcon Prototype. It effects status icon location on a per-pixel level. Not sure what else it could be used for, but hey, nothing wrong with generalizing. Also moves the mindshield icon priority to one, to fix an unreported bug with them covering non-job icons. --- Content.Client/StatusIcon/StatusIconOverlay.cs | 4 ++-- Content.Shared/StatusIcon/StatusIconPrototype.cs | 6 ++++++ Resources/Prototypes/StatusEffects/security.yml | 5 +++-- Resources/Prototypes/StatusIcon/antag.yml | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Content.Client/StatusIcon/StatusIconOverlay.cs b/Content.Client/StatusIcon/StatusIconOverlay.cs index 1cfb4c2a55..156212c55d 100644 --- a/Content.Client/StatusIcon/StatusIconOverlay.cs +++ b/Content.Client/StatusIcon/StatusIconOverlay.cs @@ -93,7 +93,7 @@ public sealed class StatusIconOverlay : Overlay accOffsetL += texture.Height; countL++; } - yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetL / EyeManager.PixelsPerMeter; + yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetL - proto.Offset) / EyeManager.PixelsPerMeter; xOffset = -(bounds.Width + sprite.Offset.X) / 2f; } @@ -106,7 +106,7 @@ public sealed class StatusIconOverlay : Overlay accOffsetR += texture.Height; countR++; } - yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetR / EyeManager.PixelsPerMeter; + yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetR - proto.Offset) / EyeManager.PixelsPerMeter; xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter; } diff --git a/Content.Shared/StatusIcon/StatusIconPrototype.cs b/Content.Shared/StatusIcon/StatusIconPrototype.cs index a313f55c05..428ca95082 100644 --- a/Content.Shared/StatusIcon/StatusIconPrototype.cs +++ b/Content.Shared/StatusIcon/StatusIconPrototype.cs @@ -40,6 +40,12 @@ public partial class StatusIconData : IComparable /// [DataField] public StatusIconLayer Layer = StatusIconLayer.Base; + + /// + /// Offset of the status icon, up and down only. + /// + [DataField] + public int Offset = 0; } /// diff --git a/Resources/Prototypes/StatusEffects/security.yml b/Resources/Prototypes/StatusEffects/security.yml index 46e1eb9e08..51d087104d 100644 --- a/Resources/Prototypes/StatusEffects/security.yml +++ b/Resources/Prototypes/StatusEffects/security.yml @@ -1,8 +1,9 @@ - type: statusIcon id: SecurityIcon abstract: true - priority: 1 - locationPreference: Left + priority: 2 + offset: 1 + locationPreference: Right - type: statusIcon parent: SecurityIcon diff --git a/Resources/Prototypes/StatusIcon/antag.yml b/Resources/Prototypes/StatusIcon/antag.yml index 3b64517530..757ec0354b 100644 --- a/Resources/Prototypes/StatusIcon/antag.yml +++ b/Resources/Prototypes/StatusIcon/antag.yml @@ -21,7 +21,7 @@ - type: statusIcon id: MindShieldIcon - priority: 2 + priority: 1 locationPreference: Right layer: Mod icon: -- 2.51.2