]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Criminal Record Icons below Job Icons (#26203)
authorGolinth <amh2023@gmail.com>
Mon, 18 Mar 2024 01:37:00 +0000 (20:37 -0500)
committerGitHub <noreply@github.com>
Mon, 18 Mar 2024 01:37:00 +0000 (21:37 -0400)
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
Content.Shared/StatusIcon/StatusIconPrototype.cs
Resources/Prototypes/StatusEffects/security.yml
Resources/Prototypes/StatusIcon/antag.yml

index 1cfb4c2a558761bf7e8aba7381e8a5185d40b807..156212c55d3876f71a1488c7ecd85f664ee7ffa8 100644 (file)
@@ -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;
 
                 }
index a313f55c057e0640637747eb403616ac58b3efab..428ca950823734fa8779827e812a40aff46f613e 100644 (file)
@@ -40,6 +40,12 @@ public partial class StatusIconData : IComparable<StatusIconData>
     /// </summary>
     [DataField]
     public StatusIconLayer Layer = StatusIconLayer.Base;
+
+    /// <summary>
+    /// Offset of the status icon, up and down only.
+    /// </summary>
+    [DataField]
+    public int Offset = 0;
 }
 
 /// <summary>
index 46e1eb9e08678de1e2c1838fe98506c047fb0529..51d087104d52216f9930e2d1ef880e9cde7ebaa8 100644 (file)
@@ -1,8 +1,9 @@
 - type: statusIcon
   id: SecurityIcon
   abstract: true
-  priority: 1
-  locationPreference: Left
+  priority: 2
+  offset: 1
+  locationPreference: Right
 
 - type: statusIcon
   parent: SecurityIcon
index 3b64517530b8b86996dd1ac9f0ed6438cf5a56f0..757ec0354b07495a433fe96edfbec626ac0e9fdd 100644 (file)
@@ -21,7 +21,7 @@
 
 - type: statusIcon
   id: MindShieldIcon
-  priority: 2
+  priority: 1
   locationPreference: Right
   layer: Mod
   icon: