From bced73f67657246bc167531414ea0be5a5bba6bf Mon Sep 17 00:00:00 2001 From: Golinth Date: Fri, 16 Feb 2024 09:58:28 -0600 Subject: [PATCH] Kill Seperated Mindshield Icons (#25303) * 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 | 14 ++++++++++---- .../StatusIcon/StatusIconPrototype.cs | 12 ++++++++++++ Resources/Prototypes/StatusIcon/antag.yml | 5 +++-- .../Misc/job_icons.rsi/MindShield.png | Bin 198 -> 4452 bytes .../Interface/Misc/job_icons.rsi/meta.json | 2 +- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Content.Client/StatusIcon/StatusIconOverlay.cs b/Content.Client/StatusIcon/StatusIconOverlay.cs index 3e7161b1fb..0d13baef93 100644 --- a/Content.Client/StatusIcon/StatusIconOverlay.cs +++ b/Content.Client/StatusIcon/StatusIconOverlay.cs @@ -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); diff --git a/Content.Shared/StatusIcon/StatusIconPrototype.cs b/Content.Shared/StatusIcon/StatusIconPrototype.cs index 1523ff4e0a..a313f55c05 100644 --- a/Content.Shared/StatusIcon/StatusIconPrototype.cs +++ b/Content.Shared/StatusIcon/StatusIconPrototype.cs @@ -34,6 +34,12 @@ public partial class StatusIconData : IComparable { return Priority.CompareTo(other?.Priority ?? int.MaxValue); } + + /// + /// The layer the icon is displayed on. Mod is drawn above Base. Base | Mod + /// + [DataField] + public StatusIconLayer Layer = StatusIconLayer.Base; } /// @@ -63,3 +69,9 @@ public enum StatusIconLocationPreference : byte Left, Right, } + +public enum StatusIconLayer : byte +{ + Base, + Mod, +} diff --git a/Resources/Prototypes/StatusIcon/antag.yml b/Resources/Prototypes/StatusIcon/antag.yml index a3fb072722..0a052ce16d 100644 --- a/Resources/Prototypes/StatusIcon/antag.yml +++ b/Resources/Prototypes/StatusIcon/antag.yml @@ -23,14 +23,15 @@ 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 diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/MindShield.png b/Resources/Textures/Interface/Misc/job_icons.rsi/MindShield.png index 3049f3e50fb191c57f2e998cce388e598b871158..d3df5fe6277177f5106ca40b1fa39ad7349548a0 100644 GIT binary patch literal 4452 zcmeHKeQXqE8sD}`YgtPvEkP8WZV~8(+4EX0HU`k00BucVzDIu6A!P?%PP+K>DxkIX6CDpURe9&l^MRyRmxGRwIJgb z(%U%FQFht6`Kbll|H|)}eM93wQ!ldR+1jDMyjZ{V%y3(xU`c7g%C&dA-1*7RrTdT6 z6xu7kkEi<;us^;?l&3 z);)9#>B#BtS)6}&im~iE{pjb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GvrTy`zdl=WU-#A?0iXzkUJk&&`2S06rfv1`$c g%qDzE)541(%fH(ff_IBE<{9pSm9>E*6-^KP0-}Z?FaQ7m delta 170 zcmaE&bc}I=NGZx^prw85kH?(j9#r85lP9bN@+X1@buyJR*x382Ao@Fyrz3 z6)8Z$Xipc%5RKsE6b7c*AJ+X>kdl>&4L!&-t);OgQvIL=n?sRLz|jN)`>Q-X!s+vy zx(o~!XfQCQcnTZ{Xy7}*b)i%-n%SIDt>GP;o12@mTH5Okef9x%To$`l&EaI=n`IbK T^}L1!Xb*#@tDnm{r-UW|>(Mr! diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json b/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json index bf919198f5..df37d244cf 100644 --- a/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json +++ b/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json @@ -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,