]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Kill Seperated Mindshield Icons (#25303)
authorGolinth <amh2023@gmail.com>
Fri, 16 Feb 2024 15:58:28 +0000 (09:58 -0600)
committerGitHub <noreply@github.com>
Fri, 16 Feb 2024 15:58:28 +0000 (10:58 -0500)
* Unghettoify mindshield icons

Adds support for layers in status icons, through the StatusIconLayer enum and the new "layer" datafield. Defaults to the Base layer where functionally remains unchanged.

* TG icon for shield

probably better than the shitty one I made in paint

* forgor meta.json

I forgor

* Emo review

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Content.Client/StatusIcon/StatusIconOverlay.cs
Content.Shared/StatusIcon/StatusIconPrototype.cs
Resources/Prototypes/StatusIcon/antag.yml
Resources/Textures/Interface/Misc/job_icons.rsi/MindShield.png
Resources/Textures/Interface/Misc/job_icons.rsi/meta.json

index 3e7161b1fb5f00a1bbe13a5b3053dd9dda7b9407..0d13baef936515da1ab0304ef7f364766d0e958c 100644 (file)
@@ -84,21 +84,27 @@ public sealed class StatusIconOverlay : Overlay
                 {
                     if (accOffsetL + texture.Height > sprite.Bounds.Height * EyeManager.PixelsPerMeter)
                         break;
-                    accOffsetL += texture.Height;
+                    if (proto.Layer == StatusIconLayer.Base)
+                    {
+                        accOffsetL += texture.Height;
+                        countL++;
+                    }
                     yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetL / EyeManager.PixelsPerMeter;
                     xOffset = -(bounds.Width + sprite.Offset.X) / 2f;
 
-                    countL++;
                 }
                 else
                 {
                     if (accOffsetR + texture.Height > sprite.Bounds.Height * EyeManager.PixelsPerMeter)
                         break;
-                    accOffsetR += texture.Height;
+                    if (proto.Layer == StatusIconLayer.Base)
+                    {
+                        accOffsetR += texture.Height;
+                        countR++;
+                    }
                     yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetR / EyeManager.PixelsPerMeter;
                     xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter;
 
-                    countR++;
                 }
 
                 var position = new Vector2(xOffset, yOffset);
index 1523ff4e0adf0974a8743ecffce93ab21b458ffd..a313f55c057e0640637747eb403616ac58b3efab 100644 (file)
@@ -34,6 +34,12 @@ public partial class StatusIconData : IComparable<StatusIconData>
     {
         return Priority.CompareTo(other?.Priority ?? int.MaxValue);
     }
+
+    /// <summary>
+    /// The layer the icon is displayed on. Mod is drawn above Base. Base | Mod
+    /// </summary>
+    [DataField]
+    public StatusIconLayer Layer = StatusIconLayer.Base;
 }
 
 /// <summary>
@@ -63,3 +69,9 @@ public enum StatusIconLocationPreference : byte
     Left,
     Right,
 }
+
+public enum StatusIconLayer : byte
+{
+    Base,
+    Mod,
+}
index a3fb07272277b2748dfa7bfb50a2fbe71533ace5..0a052ce16daf35dccb16432b96d8ae3daa1a8412 100644 (file)
   id: MindShieldIcon
   priority: 2
   locationPreference: Right
+  layer: Mod
   icon:
     sprite: Interface/Misc/job_icons.rsi
     state: MindShield
-    
+
 - type: statusIcon
   id: SyndicateFaction
   priority: 0
-  locationPreference: Left 
+  locationPreference: Left
   icon:
     sprite: Interface/Misc/job_icons.rsi
     state: Syndicate
index 3049f3e50fb191c57f2e998cce388e598b871158..d3df5fe6277177f5106ca40b1fa39ad7349548a0 100644 (file)
Binary files a/Resources/Textures/Interface/Misc/job_icons.rsi/MindShield.png and b/Resources/Textures/Interface/Misc/job_icons.rsi/MindShield.png differ
index bf919198f593108086c4844de9c512acf68ffff8..df37d244cfe3a9422b5b5eac631762c82f8d1013 100644 (file)
@@ -1,7 +1,7 @@
 {
     "version": 1,
     "license": "CC-BY-SA-3.0",
-    "copyright": "Taken from https://github.com/vgstation-coders/vgstation13/blob/e71d6c4fba5a51f99b81c295dcaec4fc2f58fb19/icons/mob/screen1.dmi | Brigmedic icon made by PuroSlavKing (Github) | Zombie icon made by RamZ | Zookeper by netwy (discort) | Rev and Head Rev icon taken from https://tgstation13.org/wiki/HUD and edited by coolmankid12345 (Discord) | Mindshield icon made by Psychpsyo (Github)",
+    "copyright": "Taken from https://github.com/vgstation-coders/vgstation13/blob/e71d6c4fba5a51f99b81c295dcaec4fc2f58fb19/icons/mob/screen1.dmi | Brigmedic icon made by PuroSlavKing (Github) | Zombie icon made by RamZ | Zookeper by netwy (discort) | Rev and Head Rev icon taken from https://tgstation13.org/wiki/HUD and edited by coolmankid12345 (Discord) | Mindshield icon taken from https://github.com/tgstation/tgstation/blob/master/icons/mob/huds/hud.dmi and edited by Golinth (Github)",
 
     "size": {
         "x": 8,