From: Krunklehorn <42424291+Krunklehorn@users.noreply.github.com> Date: Thu, 18 Apr 2024 03:20:44 +0000 (-0400) Subject: Refactor status icons take 2, cyborgs don't see criminal status (#26207) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=460b588de5b1fc2aa8b1c8272ba1a90d99378731;p=space-station-14.git Refactor status icons take 2, cyborgs don't see criminal status (#26207) * Initial commit. * review --------- Co-authored-by: metalgearsloth Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> --- diff --git a/Content.Client/Overlays/ShowCriminalRecordIconsSystem.cs b/Content.Client/Overlays/ShowCriminalRecordIconsSystem.cs new file mode 100644 index 0000000000..8f23cd510c --- /dev/null +++ b/Content.Client/Overlays/ShowCriminalRecordIconsSystem.cs @@ -0,0 +1,28 @@ +using Content.Shared.Overlays; +using Content.Shared.Security.Components; +using Content.Shared.StatusIcon; +using Content.Shared.StatusIcon.Components; +using Robust.Shared.Prototypes; + +namespace Content.Client.Overlays; + +public sealed class ShowCriminalRecordIconsSystem : EquipmentHudSystem +{ + [Dependency] private readonly IPrototypeManager _prototype = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnGetStatusIconsEvent); + } + + private void OnGetStatusIconsEvent(EntityUid uid, CriminalRecordComponent component, ref GetStatusIconsEvent ev) + { + if (!IsActive || ev.InContainer) + return; + + if (_prototype.TryIndex(component.StatusIcon.Id, out var iconPrototype)) + ev.StatusIcons.Add(iconPrototype); + } +} diff --git a/Content.Client/Overlays/ShowHungerIconsSystem.cs b/Content.Client/Overlays/ShowHungerIconsSystem.cs index 58551b30c2..b1c0f3a1a0 100644 --- a/Content.Client/Overlays/ShowHungerIconsSystem.cs +++ b/Content.Client/Overlays/ShowHungerIconsSystem.cs @@ -1,14 +1,13 @@ +using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.Components; using Content.Shared.Overlays; -using Content.Shared.StatusIcon; using Content.Shared.StatusIcon.Components; -using Robust.Shared.Prototypes; namespace Content.Client.Overlays; public sealed class ShowHungerIconsSystem : EquipmentHudSystem { - [Dependency] private readonly IPrototypeManager _prototypeMan = default!; + [Dependency] private readonly HungerSystem _hunger = default!; public override void Initialize() { @@ -17,42 +16,12 @@ public sealed class ShowHungerIconsSystem : EquipmentHudSystem(OnGetStatusIconsEvent); } - private void OnGetStatusIconsEvent(EntityUid uid, HungerComponent hungerComponent, ref GetStatusIconsEvent args) + private void OnGetStatusIconsEvent(EntityUid uid, HungerComponent component, ref GetStatusIconsEvent ev) { - if (!IsActive || args.InContainer) + if (!IsActive || ev.InContainer) return; - var hungerIcons = DecideHungerIcon(uid, hungerComponent); - - args.StatusIcons.AddRange(hungerIcons); - } - - private IReadOnlyList DecideHungerIcon(EntityUid uid, HungerComponent hungerComponent) - { - var result = new List(); - - switch (hungerComponent.CurrentThreshold) - { - case HungerThreshold.Overfed: - if (_prototypeMan.TryIndex("HungerIconOverfed", out var overfed)) - { - result.Add(overfed); - } - break; - case HungerThreshold.Peckish: - if (_prototypeMan.TryIndex("HungerIconPeckish", out var peckish)) - { - result.Add(peckish); - } - break; - case HungerThreshold.Starving: - if (_prototypeMan.TryIndex("HungerIconStarving", out var starving)) - { - result.Add(starving); - } - break; - } - - return result; + if (_hunger.TryGetStatusIconPrototype(component, out var iconPrototype)) + ev.StatusIcons.Add(iconPrototype); } } diff --git a/Content.Client/Overlays/ShowJobIconsSystem.cs b/Content.Client/Overlays/ShowJobIconsSystem.cs new file mode 100644 index 0000000000..e24b99f3e8 --- /dev/null +++ b/Content.Client/Overlays/ShowJobIconsSystem.cs @@ -0,0 +1,60 @@ +using Content.Shared.Access.Components; +using Content.Shared.Access.Systems; +using Content.Shared.Overlays; +using Content.Shared.PDA; +using Content.Shared.StatusIcon; +using Content.Shared.StatusIcon.Components; +using Robust.Shared.Prototypes; + +namespace Content.Client.Overlays; + +public sealed class ShowJobIconsSystem : EquipmentHudSystem +{ + [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly AccessReaderSystem _accessReader = default!; + + [ValidatePrototypeId] + private const string JobIconForNoId = "JobIconNoId"; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnGetStatusIconsEvent); + } + + private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref GetStatusIconsEvent ev) + { + if (!IsActive || ev.InContainer) + return; + + var iconId = JobIconForNoId; + + if (_accessReader.FindAccessItemsInventory(uid, out var items)) + { + foreach (var item in items) + { + // ID Card + if (TryComp(item, out var id)) + { + iconId = id.JobIcon; + break; + } + + // PDA + if (TryComp(item, out var pda) + && pda.ContainedId != null + && TryComp(pda.ContainedId, out id)) + { + iconId = id.JobIcon; + break; + } + } + } + + if (_prototype.TryIndex(iconId, out var iconPrototype)) + ev.StatusIcons.Add(iconPrototype); + else + Log.Error($"Invalid job icon prototype: {iconPrototype}"); + } +} diff --git a/Content.Client/Overlays/ShowMindShieldIconsSystem.cs b/Content.Client/Overlays/ShowMindShieldIconsSystem.cs new file mode 100644 index 0000000000..8bf39b875f --- /dev/null +++ b/Content.Client/Overlays/ShowMindShieldIconsSystem.cs @@ -0,0 +1,28 @@ +using Content.Shared.Mindshield.Components; +using Content.Shared.Overlays; +using Content.Shared.StatusIcon; +using Content.Shared.StatusIcon.Components; +using Robust.Shared.Prototypes; + +namespace Content.Client.Overlays; + +public sealed class ShowMindShieldIconsSystem : EquipmentHudSystem +{ + [Dependency] private readonly IPrototypeManager _prototype = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnGetStatusIconsEvent); + } + + private void OnGetStatusIconsEvent(EntityUid uid, MindShieldComponent component, ref GetStatusIconsEvent ev) + { + if (!IsActive || ev.InContainer) + return; + + if (_prototype.TryIndex(component.MindShieldStatusIcon.Id, out var iconPrototype)) + ev.StatusIcons.Add(iconPrototype); + } +} diff --git a/Content.Client/Overlays/ShowSecurityIconsSystem.cs b/Content.Client/Overlays/ShowSecurityIconsSystem.cs deleted file mode 100644 index 7a4abd05e0..0000000000 --- a/Content.Client/Overlays/ShowSecurityIconsSystem.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Content.Shared.Access.Components; -using Content.Shared.Access.Systems; -using Content.Shared.Mindshield.Components; -using Content.Shared.Overlays; -using Content.Shared.PDA; -using Content.Shared.Security.Components; -using Content.Shared.StatusIcon; -using Content.Shared.StatusIcon.Components; -using Robust.Shared.Prototypes; - -namespace Content.Client.Overlays; - -public sealed class ShowSecurityIconsSystem : EquipmentHudSystem -{ - [Dependency] private readonly IPrototypeManager _prototypeMan = default!; - [Dependency] private readonly AccessReaderSystem _accessReader = default!; - - [ValidatePrototypeId] - private const string JobIconForNoId = "JobIconNoId"; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnGetStatusIconsEvent); - } - - private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref GetStatusIconsEvent @event) - { - if (!IsActive || @event.InContainer) - { - return; - } - - var securityIcons = DecideSecurityIcon(uid); - - @event.StatusIcons.AddRange(securityIcons); - } - - private IReadOnlyList DecideSecurityIcon(EntityUid uid) - { - var result = new List(); - - var jobIconToGet = JobIconForNoId; - if (_accessReader.FindAccessItemsInventory(uid, out var items)) - { - foreach (var item in items) - { - // ID Card - if (TryComp(item, out IdCardComponent? id)) - { - jobIconToGet = id.JobIcon; - break; - } - - // PDA - if (TryComp(item, out PdaComponent? pda) - && pda.ContainedId != null - && TryComp(pda.ContainedId, out id)) - { - jobIconToGet = id.JobIcon; - break; - } - } - } - - if (_prototypeMan.TryIndex(jobIconToGet, out var jobIcon)) - result.Add(jobIcon); - else - Log.Error($"Invalid job icon prototype: {jobIcon}"); - - if (TryComp(uid, out var comp)) - { - if (_prototypeMan.TryIndex(comp.MindShieldStatusIcon.Id, out var icon)) - result.Add(icon); - } - - if (TryComp(uid, out var record)) - { - if(_prototypeMan.TryIndex(record.StatusIcon.Id, out var criminalIcon)) - result.Add(criminalIcon); - } - - return result; - } -} diff --git a/Content.Client/Overlays/ShowSyndicateIconsSystem.cs b/Content.Client/Overlays/ShowSyndicateIconsSystem.cs index a640726685..660ef198e1 100644 --- a/Content.Client/Overlays/ShowSyndicateIconsSystem.cs +++ b/Content.Client/Overlays/ShowSyndicateIconsSystem.cs @@ -1,10 +1,11 @@ using Content.Shared.Overlays; -using Content.Shared.StatusIcon.Components; using Content.Shared.NukeOps; using Content.Shared.StatusIcon; +using Content.Shared.StatusIcon.Components; using Robust.Shared.Prototypes; namespace Content.Client.Overlays; + public sealed class ShowSyndicateIconsSystem : EquipmentHudSystem { [Dependency] private readonly IPrototypeManager _prototype = default!; @@ -16,28 +17,13 @@ public sealed class ShowSyndicateIconsSystem : EquipmentHudSystem(OnGetStatusIconsEvent); } - private void OnGetStatusIconsEvent(EntityUid uid, NukeOperativeComponent nukeOperativeComponent, ref GetStatusIconsEvent args) + private void OnGetStatusIconsEvent(EntityUid uid, NukeOperativeComponent component, ref GetStatusIconsEvent ev) { - if (!IsActive || args.InContainer) - { + if (!IsActive || ev.InContainer) return; - } - - var syndicateIcons = SyndicateIcon(uid, nukeOperativeComponent); - - args.StatusIcons.AddRange(syndicateIcons); - } - - private IReadOnlyList SyndicateIcon(EntityUid uid, NukeOperativeComponent nukeOperativeComponent) - { - var result = new List(); - - if (_prototype.TryIndex(nukeOperativeComponent.SyndStatusIcon, out var syndicateicon)) - { - result.Add(syndicateicon); - } - return result; + if (_prototype.TryIndex(component.SyndStatusIcon, out var iconPrototype)) + ev.StatusIcons.Add(iconPrototype); } } diff --git a/Content.Client/Overlays/ShowThirstIconsSystem.cs b/Content.Client/Overlays/ShowThirstIconsSystem.cs index f9d6d0ab25..b08aa4340b 100644 --- a/Content.Client/Overlays/ShowThirstIconsSystem.cs +++ b/Content.Client/Overlays/ShowThirstIconsSystem.cs @@ -1,14 +1,13 @@ +using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.Components; using Content.Shared.Overlays; -using Content.Shared.StatusIcon; using Content.Shared.StatusIcon.Components; -using Robust.Shared.Prototypes; namespace Content.Client.Overlays; public sealed class ShowThirstIconsSystem : EquipmentHudSystem { - [Dependency] private readonly IPrototypeManager _prototypeMan = default!; + [Dependency] private readonly ThirstSystem _thirst = default!; public override void Initialize() { @@ -17,42 +16,12 @@ public sealed class ShowThirstIconsSystem : EquipmentHudSystem(OnGetStatusIconsEvent); } - private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent thirstComponent, ref GetStatusIconsEvent args) + private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent component, ref GetStatusIconsEvent ev) { - if (!IsActive || args.InContainer) + if (!IsActive || ev.InContainer) return; - var thirstIcons = DecideThirstIcon(uid, thirstComponent); - - args.StatusIcons.AddRange(thirstIcons); - } - - private IReadOnlyList DecideThirstIcon(EntityUid uid, ThirstComponent thirstComponent) - { - var result = new List(); - - switch (thirstComponent.CurrentThirstThreshold) - { - case ThirstThreshold.OverHydrated: - if (_prototypeMan.TryIndex("ThirstIconOverhydrated", out var overhydrated)) - { - result.Add(overhydrated); - } - break; - case ThirstThreshold.Thirsty: - if (_prototypeMan.TryIndex("ThirstIconThirsty", out var thirsty)) - { - result.Add(thirsty); - } - break; - case ThirstThreshold.Parched: - if (_prototypeMan.TryIndex("ThirstIconParched", out var parched)) - { - result.Add(parched); - } - break; - } - - return result; + if (_thirst.TryGetStatusIconPrototype(component, out var iconPrototype)) + ev.StatusIcons.Add(iconPrototype!); } } diff --git a/Content.Shared/Inventory/InventorySystem.Relay.cs b/Content.Shared/Inventory/InventorySystem.Relay.cs index c43a588507..b418a1d416 100644 --- a/Content.Shared/Inventory/InventorySystem.Relay.cs +++ b/Content.Shared/Inventory/InventorySystem.Relay.cs @@ -38,12 +38,14 @@ public partial class InventorySystem SubscribeLocalEvent(RelayInventoryEvent); // ComponentActivatedClientSystems - SubscribeLocalEvent>(RelayInventoryEvent); + SubscribeLocalEvent>(RelayInventoryEvent); SubscribeLocalEvent>(RelayInventoryEvent); SubscribeLocalEvent>(RelayInventoryEvent); SubscribeLocalEvent>(RelayInventoryEvent); SubscribeLocalEvent>(RelayInventoryEvent); + SubscribeLocalEvent>(RelayInventoryEvent); SubscribeLocalEvent>(RelayInventoryEvent); + SubscribeLocalEvent>(RelayInventoryEvent); SubscribeLocalEvent>(OnGetEquipmentVerbs); } diff --git a/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs b/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs index 89aae57074..4de4e4d5fe 100644 --- a/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs @@ -1,17 +1,22 @@ +using System.Diagnostics.CodeAnalysis; using Content.Shared.Alert; using Content.Shared.Damage; using Content.Shared.Mobs.Systems; using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Rejuvenate; +using Content.Shared.StatusIcon; +using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; +using Robust.Shared.Utility; namespace Content.Shared.Nutrition.EntitySystems; public sealed class HungerSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly DamageableSystem _damageable = default!; @@ -19,10 +24,27 @@ public sealed class HungerSystem : EntitySystem [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!; [Dependency] private readonly SharedJetpackSystem _jetpack = default!; + [ValidatePrototypeId] + private const string HungerIconOverfedId = "HungerIconOverfed"; + + [ValidatePrototypeId] + private const string HungerIconPeckishId = "HungerIconPeckish"; + + [ValidatePrototypeId] + private const string HungerIconStarvingId = "HungerIconStarving"; + + private StatusIconPrototype? _hungerIconOverfed; + private StatusIconPrototype? _hungerIconPeckish; + private StatusIconPrototype? _hungerIconStarving; + public override void Initialize() { base.Initialize(); + DebugTools.Assert(_prototype.TryIndex(HungerIconOverfedId, out _hungerIconOverfed) && + _prototype.TryIndex(HungerIconPeckishId, out _hungerIconPeckish) && + _prototype.TryIndex(HungerIconStarvingId, out _hungerIconStarving)); + SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnShutdown); SubscribeLocalEvent(OnRefreshMovespeed); @@ -194,6 +216,27 @@ public sealed class HungerSystem : EntitySystem } } + public bool TryGetStatusIconPrototype(HungerComponent component, [NotNullWhen(true)] out StatusIconPrototype? prototype) + { + switch (component.CurrentThreshold) + { + case HungerThreshold.Overfed: + prototype = _hungerIconOverfed; + break; + case HungerThreshold.Peckish: + prototype = _hungerIconPeckish; + break; + case HungerThreshold.Starving: + prototype = _hungerIconStarving; + break; + default: + prototype = null; + break; + } + + return prototype != null; + } + public override void Update(float frameTime) { base.Update(frameTime); diff --git a/Content.Shared/Nutrition/EntitySystems/ThirstSystem.cs b/Content.Shared/Nutrition/EntitySystems/ThirstSystem.cs index 29218f5719..8ea7d9140c 100644 --- a/Content.Shared/Nutrition/EntitySystems/ThirstSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/ThirstSystem.cs @@ -3,9 +3,12 @@ using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Rejuvenate; +using Content.Shared.StatusIcon; using JetBrains.Annotations; +using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; +using Robust.Shared.Utility; namespace Content.Shared.Nutrition.EntitySystems; @@ -13,15 +16,33 @@ namespace Content.Shared.Nutrition.EntitySystems; public sealed class ThirstSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly MovementSpeedModifierSystem _movement = default!; [Dependency] private readonly SharedJetpackSystem _jetpack = default!; + [ValidatePrototypeId] + private const string ThirstIconOverhydratedId = "ThirstIconOverhydrated"; + + [ValidatePrototypeId] + private const string ThirstIconThirstyId = "ThirstIconThirsty"; + + [ValidatePrototypeId] + private const string ThirstIconParchedId = "ThirstIconParched"; + + private StatusIconPrototype? _thirstIconOverhydrated = null; + private StatusIconPrototype? _thirstIconThirsty = null; + private StatusIconPrototype? _thirstIconParched = null; + public override void Initialize() { base.Initialize(); + DebugTools.Assert(_prototype.TryIndex(ThirstIconOverhydratedId, out _thirstIconOverhydrated) && + _prototype.TryIndex(ThirstIconThirstyId, out _thirstIconThirsty) && + _prototype.TryIndex(ThirstIconParchedId, out _thirstIconParched)); + SubscribeLocalEvent(OnRefreshMovespeed); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnRejuvenate); @@ -107,6 +128,28 @@ public sealed class ThirstSystem : EntitySystem } } + public bool TryGetStatusIconPrototype(ThirstComponent component, out StatusIconPrototype? prototype) + { + switch (component.CurrentThirstThreshold) + { + case ThirstThreshold.OverHydrated: + prototype = _thirstIconOverhydrated; + return true; + + case ThirstThreshold.Thirsty: + prototype = _thirstIconThirsty; + return true; + + case ThirstThreshold.Parched: + prototype = _thirstIconParched; + return true; + + default: + prototype = null; + return false; + } + } + private void UpdateEffects(EntityUid uid, ThirstComponent component) { if (IsMovementThreshold(component.LastThirstThreshold) != IsMovementThreshold(component.CurrentThirstThreshold) && diff --git a/Content.Shared/Overlays/ShowCriminalRecordIconsComponent.cs b/Content.Shared/Overlays/ShowCriminalRecordIconsComponent.cs new file mode 100644 index 0000000000..cb0759be3e --- /dev/null +++ b/Content.Shared/Overlays/ShowCriminalRecordIconsComponent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Overlays; + +/// +/// This component allows you to see criminal record status of mobs. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class ShowCriminalRecordIconsComponent : Component { } diff --git a/Content.Shared/Overlays/ShowHungerIconsComponent.cs b/Content.Shared/Overlays/ShowHungerIconsComponent.cs index bf1fb2dc19..b3841bd80f 100644 --- a/Content.Shared/Overlays/ShowHungerIconsComponent.cs +++ b/Content.Shared/Overlays/ShowHungerIconsComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; namespace Content.Shared.Overlays; /// -/// This component allows you to see the hungriness of mobs. +/// This component allows you to see the hungriness of mobs. /// [RegisterComponent, NetworkedComponent] public sealed partial class ShowHungerIconsComponent : Component { } diff --git a/Content.Shared/Overlays/ShowSecurityIconsComponent.cs b/Content.Shared/Overlays/ShowJobIconsComponent.cs similarity index 51% rename from Content.Shared/Overlays/ShowSecurityIconsComponent.cs rename to Content.Shared/Overlays/ShowJobIconsComponent.cs index ec268174d1..aae9739506 100644 --- a/Content.Shared/Overlays/ShowSecurityIconsComponent.cs +++ b/Content.Shared/Overlays/ShowJobIconsComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; namespace Content.Shared.Overlays; /// -/// This component allows you to see job icons above mobs. +/// This component allows you to see job icons above mobs. /// [RegisterComponent, NetworkedComponent] -public sealed partial class ShowSecurityIconsComponent : Component { } +public sealed partial class ShowJobIconsComponent : Component { } diff --git a/Content.Shared/Overlays/ShowMindShieldIconsComponent.cs b/Content.Shared/Overlays/ShowMindShieldIconsComponent.cs new file mode 100644 index 0000000000..624d5ab8ef --- /dev/null +++ b/Content.Shared/Overlays/ShowMindShieldIconsComponent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Overlays; + +/// +/// This component allows you to see mindshield icons above mobs. +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class ShowMindShieldIconsComponent : Component { } diff --git a/Content.Shared/Overlays/ShowSyndicateIconsComponent.cs b/Content.Shared/Overlays/ShowSyndicateIconsComponent.cs index 74a67db694..a63eae8e46 100644 --- a/Content.Shared/Overlays/ShowSyndicateIconsComponent.cs +++ b/Content.Shared/Overlays/ShowSyndicateIconsComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; namespace Content.Shared.Overlays; /// -/// +/// This component allows you to identify members of the Syndicate faction. /// [RegisterComponent, NetworkedComponent] public sealed partial class ShowSyndicateIconsComponent : Component {} diff --git a/Content.Shared/Overlays/ShowThirstIconsComponent.cs b/Content.Shared/Overlays/ShowThirstIconsComponent.cs index 905ab07fe2..1914034e9e 100644 --- a/Content.Shared/Overlays/ShowThirstIconsComponent.cs +++ b/Content.Shared/Overlays/ShowThirstIconsComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; namespace Content.Shared.Overlays; /// -/// This component allows you to see the thirstiness of mobs. +/// This component allows you to see the thirstiness of mobs. /// [RegisterComponent, NetworkedComponent] public sealed partial class ShowThirstIconsComponent : Component { } diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml index 24944f02dd..7ad21ba93a 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml @@ -156,7 +156,7 @@ - WhitelistChameleon - type: entity - parent: ClothingEyesBase + parent: [ClothingEyesBase, ShowSecurityIcons] id: ClothingEyesGlassesSecurity name: security glasses description: Upgraded sunglasses that provide flash immunity and a security HUD. @@ -178,7 +178,6 @@ - type: GuideHelp guides: - Security - - type: ShowSecurityIcons - type: IdentityBlocker coverage: EYES diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml b/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml index 1b01ce1514..9c29b17b34 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml @@ -1,3 +1,13 @@ +- type: entity + id: ShowSecurityIcons + abstract: true + noSpawn: true + components: + - type: ShowJobIcons + - type: ShowMindShieldIcons + - type: ShowCriminalRecordIcons + + - type: entity parent: ClothingEyesBase id: ClothingEyesHudDiagnostic @@ -17,7 +27,7 @@ parent: ClothingEyesBase id: ClothingEyesHudMedical name: medical hud - description: A heads-up display that scans the humanoids in view and provides accurate data about their health status. + description: A heads-up display that scans the humanoids in view and provides accurate data about their health status. components: - type: Sprite sprite: Clothing/Eyes/Hud/med.rsi @@ -34,7 +44,7 @@ - HudMedical - type: entity - parent: ClothingEyesBase + parent: [ClothingEyesBase, ShowSecurityIcons] id: ClothingEyesHudSecurity name: security hud description: A heads-up display that scans the humanoids in view and provides accurate data about their ID status and security records. @@ -43,7 +53,6 @@ sprite: Clothing/Eyes/Hud/sec.rsi - type: Clothing sprite: Clothing/Eyes/Hud/sec.rsi - - type: ShowSecurityIcons - type: Tag tags: - HudSecurity @@ -138,7 +147,7 @@ - type: ShowThirstIcons - type: entity - parent: ClothingEyesBase + parent: [ClothingEyesBase, ShowSecurityIcons] id: ClothingEyesHudMedSec name: medsec hud description: An eye display that looks like a mixture of medical and security huds. @@ -150,13 +159,12 @@ - type: Construction graph: HudMedSec node: medsecHud - - type: ShowSecurityIcons - type: ShowHealthBars damageContainers: - Biological - type: entity - parent: ClothingEyesBase + parent: [ClothingEyesBase, ShowSecurityIcons] id: ClothingEyesHudMultiversal name: multiversal hud description: Filler @@ -165,7 +173,6 @@ sprite: Clothing/Eyes/Hud/medsecengi.rsi - type: Clothing sprite: Clothing/Eyes/Hud/medsecengi.rsi - - type: ShowSecurityIcons - type: ShowHealthBars damageContainers: - Biological @@ -176,7 +183,7 @@ - type: ShowSyndicateIcons - type: entity - parent: ClothingEyesBase + parent: [ClothingEyesBase, ShowSecurityIcons] id: ClothingEyesHudOmni name: omni hud description: Filler @@ -185,7 +192,6 @@ sprite: Clothing/Eyes/Hud/omni.rsi - type: Clothing sprite: Clothing/Eyes/Hud/omni.rsi - - type: ShowSecurityIcons - type: ShowHealthBars damageContainers: - Biological @@ -198,7 +204,7 @@ - type: ShowSyndicateIcons - type: entity - parent: ClothingEyesBase + parent: [ClothingEyesBase, ShowSecurityIcons] id: ClothingEyesHudSyndicate name: syndicate visor description: The syndicate's professional head-up display, designed for better detection of humanoids and their subsequent elimination. @@ -208,7 +214,6 @@ - type: Clothing sprite: Clothing/Eyes/Hud/synd.rsi - type: ShowSyndicateIcons - - type: ShowSecurityIcons - type: entity parent: ClothingEyesBase @@ -227,11 +232,9 @@ - Biological - type: entity - parent: ClothingEyesGlassesSunglasses + parent: [ClothingEyesGlassesSunglasses, ShowSecurityIcons] id: ClothingEyesGlassesHiddenSecurity suffix: Syndicate - components: - - type: ShowSecurityIcons - type: entity parent: ClothingEyesHudMedical diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 9ca99f9982..9907c5f71f 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -227,7 +227,8 @@ - AllAccess - type: AccessReader access: [["Command"], ["Research"]] - - type: ShowSecurityIcons + - type: ShowJobIcons + - type: ShowMindShieldIcons - type: entity id: BaseBorgChassisSyndicate