From aecdcf8a09c8e420f15f062bdf9e504f70abab96 Mon Sep 17 00:00:00 2001 From: SimpleStation14 Date: Mon, 22 Apr 2024 05:44:03 -0400 Subject: [PATCH] Cherry-picked commit 45d6c03407e41d92caa368e1db826efd6d828b66 from space-wizards/space-station-14/master --- Content.Client/Antag/AntagStatusIconSystem.cs | 1 + Content.Client/Zombies/ZombieSystem.cs | 14 +++++++++++++- .../Zombies/InitialInfectedComponent.cs | 16 ++++++++++++++++ Resources/Prototypes/StatusIcon/antag.yml | 7 +++++++ .../Misc/job_icons.rsi/InitialInfected.png | Bin 0 -> 4268 bytes .../Interface/Misc/job_icons.rsi/meta.json | 3 +++ 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Content.Shared/Zombies/InitialInfectedComponent.cs create mode 100644 Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png diff --git a/Content.Client/Antag/AntagStatusIconSystem.cs b/Content.Client/Antag/AntagStatusIconSystem.cs index 5d87837893c..804ae21ad4a 100644 --- a/Content.Client/Antag/AntagStatusIconSystem.cs +++ b/Content.Client/Antag/AntagStatusIconSystem.cs @@ -22,6 +22,7 @@ public override void Initialize() SubscribeLocalEvent(GetRevIcon); SubscribeLocalEvent(GetIcon); SubscribeLocalEvent(GetIcon); + SubscribeLocalEvent(GetIcon); } /// diff --git a/Content.Client/Zombies/ZombieSystem.cs b/Content.Client/Zombies/ZombieSystem.cs index bd89e978c70..7c1fb38e744 100644 --- a/Content.Client/Zombies/ZombieSystem.cs +++ b/Content.Client/Zombies/ZombieSystem.cs @@ -15,6 +15,7 @@ public override void Initialize() SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnCanDisplayStatusIcons); + SubscribeLocalEvent(OnCanDisplayStatusIcons); } private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args) @@ -36,7 +37,18 @@ private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartu /// private void OnCanDisplayStatusIcons(EntityUid uid, ZombieComponent component, ref CanDisplayStatusIconsEvent args) { - if (HasComp(args.User) || HasComp(args.User)) + if (HasComp(args.User) || HasComp(args.User) || HasComp(args.User)) + return; + + if (component.IconVisibleToGhost && HasComp(args.User)) + return; + + args.Cancelled = true; + } + + private void OnCanDisplayStatusIcons(EntityUid uid, InitialInfectedComponent component, CanDisplayStatusIconsEvent args) + { + if (HasComp(args.User) && !HasComp(args.User)) return; if (component.IconVisibleToGhost && HasComp(args.User)) diff --git a/Content.Shared/Zombies/InitialInfectedComponent.cs b/Content.Shared/Zombies/InitialInfectedComponent.cs new file mode 100644 index 00000000000..3200dd7f5ee --- /dev/null +++ b/Content.Shared/Zombies/InitialInfectedComponent.cs @@ -0,0 +1,16 @@ +using Content.Shared.Antag; +using Content.Shared.StatusIcon; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Zombies; + +[RegisterComponent, NetworkedComponent] +public sealed partial class InitialInfectedComponent : Component, IAntagStatusIconComponent +{ + [DataField("initialInfectedStatusIcon")] + public ProtoId StatusIcon { get; set; } = "InitialInfectedFaction"; + + [DataField] + public bool IconVisibleToGhost { get; set; } = true; +} diff --git a/Resources/Prototypes/StatusIcon/antag.yml b/Resources/Prototypes/StatusIcon/antag.yml index 3b64517530b..41bb0957416 100644 --- a/Resources/Prototypes/StatusIcon/antag.yml +++ b/Resources/Prototypes/StatusIcon/antag.yml @@ -5,6 +5,13 @@ sprite: /Textures/Interface/Misc/job_icons.rsi state: Zombie +- type: statusIcon + id: InitialInfectedFaction + priority: 11 + icon: + sprite: /Textures/Interface/Misc/job_icons.rsi + state: InitialInfected + - type: statusIcon id: RevolutionaryFaction priority: 11 diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png b/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png new file mode 100644 index 0000000000000000000000000000000000000000..3684fc448892d31bcbec4e9ed4eae0ae169c16e0 GIT binary patch literal 4268 zcmeH~eQ*=#(X-y~v0l`}Ak}_7bn|;emcc-D$CbTI{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