diff --git a/Content.Client/Commands/ToggleHealthBarsCommand.cs b/Content.Client/Commands/ToggleHealthBarsCommand.cs index b1cc811ec4..3842325f94 100644 --- a/Content.Client/Commands/ToggleHealthBarsCommand.cs +++ b/Content.Client/Commands/ToggleHealthBarsCommand.cs @@ -29,14 +29,14 @@ namespace Content.Client.Commands return; } - if (!_entityManager.TryGetComponent(playerEntity, out var glassComp)) + if (!_entityManager.TryGetComponent(playerEntity, out var glassComp)) { - _entityManager.AddComponent((EntityUid) playerEntity); + _entityManager.AddComponent((EntityUid) playerEntity); shell.WriteLine("Enabled health overlay."); return; } - _entityManager.RemoveComponent((EntityUid) playerEntity); + _entityManager.RemoveComponent((EntityUid) playerEntity); shell.WriteLine("Disabled health overlay."); return; } diff --git a/Content.Client/Overlays/ShowHealthIconsSystem.cs b/Content.Client/Overlays/ShowHealthIconsSystem.cs index 6ed9d6a41d..777af55c9c 100644 --- a/Content.Client/Overlays/ShowHealthIconsSystem.cs +++ b/Content.Client/Overlays/ShowHealthIconsSystem.cs @@ -18,7 +18,7 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem DamageContainers = new(); [ValidatePrototypeId] - private const string HealthIconFine = "HealthIconFine"; + private const string HealthIconFine = "HealthIconLife"; // WD EDIT public override void Initialize() { diff --git a/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs b/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs index 287d6f394e..201448bedb 100644 --- a/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs +++ b/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs @@ -9,6 +9,7 @@ using Robust.Client.Graphics; using Robust.Shared.Enums; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +using Robust.Shared.Timing; namespace Content.Client.EntityHealthBar; @@ -23,21 +24,29 @@ public sealed class EntityHealthBarOverlay : Overlay private readonly MobStateSystem _mobStateSystem; private readonly MobThresholdSystem _mobThresholdSystem; private readonly Texture _barTexture; - private readonly ShaderInstance _shader; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; public List DamageContainers = new(); + // for icon frame change timer + int iconFrame = 1; + double delayTime = 0.25; - public EntityHealthBarOverlay(IEntityManager entManager, IPrototypeManager protoManager) + public EntityHealthBarOverlay(IEntityManager entManager) { _entManager = entManager; _transform = _entManager.EntitySysManager.GetEntitySystem(); _mobStateSystem = _entManager.EntitySysManager.GetEntitySystem(); _mobThresholdSystem = _entManager.EntitySysManager.GetEntitySystem(); - var sprite = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/health_bar.rsi"), "icon"); + var sprite = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/health_status.rsi"), "background"); _barTexture = _entManager.EntitySysManager.GetEntitySystem().Frame0(sprite); - _shader = protoManager.Index("shaded").Instance(); + Timer.SpawnRepeating(TimeSpan.FromSeconds(delayTime), () => + { + if (iconFrame < 8) + iconFrame++; + else + iconFrame = 1; + }, new System.Threading.CancellationToken()); } protected override void Draw(in OverlayDrawArgs args) @@ -47,10 +56,11 @@ public sealed class EntityHealthBarOverlay : Overlay var spriteQuery = _entManager.GetEntityQuery(); var xformQuery = _entManager.GetEntityQuery(); + var _spriteSys = _entManager.EntitySysManager.GetEntitySystem(); + const float scale = 1f; var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale)); var rotationMatrix = Matrix3.CreateRotation(-rotation); - handle.UseShader(_shader); foreach (var (mob, dmg) in _entManager.EntityQuery(true)) { @@ -74,13 +84,19 @@ public sealed class EntityHealthBarOverlay : Overlay // Use the sprite itself if we know its bounds. This means short or tall sprites don't get overlapped // by the bar. float yOffset; + float xIconOffset; + float yIconOffset; if (spriteQuery.TryGetComponent(mob.Owner, out var sprite)) { - yOffset = sprite.Bounds.Height + 15f; + yOffset = sprite.Bounds.Height + 12f; + yIconOffset = sprite.Bounds.Height + 7f; + xIconOffset = sprite.Bounds.Width + 7f; } else { yOffset = 1f; + yIconOffset = 1f; + xIconOffset = 1f; } // Position above the entity (we've already applied the matrix transform to the entity itself) @@ -89,7 +105,39 @@ public sealed class EntityHealthBarOverlay : Overlay yOffset / EyeManager.PixelsPerMeter); // Draw the underlying bar texture - handle.DrawTexture(_barTexture, position); + if (sprite != null && !sprite.ContainerOccluded) + handle.DrawTexture(_barTexture, position); + else + continue; + + // Draw state icon + if (dmg.DamageContainerID == "Biological") + { + string current_state; + if (_mobStateSystem.IsAlive(mob.Owner, mob)) + { + current_state = "life_state"; + } + else + { + if (_mobStateSystem.IsCritical(mob.Owner, mob) && + _mobThresholdSystem.TryGetThresholdForState(mob.Owner, MobState.Critical, + out var critThreshold)) + current_state = "defib_state"; + else + current_state = "dead_state"; + } + + var icon_sprite = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/health_state.rsi"), + current_state); + Texture _stateIcon = _spriteSys.RsiStateLike(icon_sprite) + .GetFrame(0, GetIconFrame(_spriteSys.RsiStateLike(icon_sprite))); + + var icon_position = new Vector2(xIconOffset / EyeManager.PixelsPerMeter, + yIconOffset / EyeManager.PixelsPerMeter); + + handle.DrawTexture(_stateIcon, icon_position); + } // we are all progressing towards death every day (float ratio, bool inCrit) deathProgress = CalcProgress(mob.Owner, mob, dmg); @@ -97,12 +145,12 @@ public sealed class EntityHealthBarOverlay : Overlay var color = GetProgressColor(deathProgress.ratio, deathProgress.inCrit); // Hardcoded width of the progress bar because it doesn't match the texture. - const float startX = 2f; - const float endX = 22f; + const float startX = 1f; + const float endX = 15f; var xProgress = (endX - startX) * deathProgress.ratio + startX; - var box = new Box2(new Vector2(startX, 3f) / EyeManager.PixelsPerMeter, new Vector2(xProgress, 4f) / EyeManager.PixelsPerMeter); + var box = new Box2(new Vector2(startX, 0f) / EyeManager.PixelsPerMeter, new Vector2(xProgress, 2f) / EyeManager.PixelsPerMeter); box = box.Translated(position); handle.DrawRect(box, color); } @@ -111,6 +159,30 @@ public sealed class EntityHealthBarOverlay : Overlay handle.SetTransform(Matrix3.Identity); } + private int GetIconFrame(IRsiStateLike sprite) + { + var _spriteSys = _entManager.EntitySysManager.GetEntitySystem(); + + if (sprite.AnimationFrameCount <= 1) + return 0; + + var currentFrame = iconFrame; + var result = 0; + while (true) + { + if (currentFrame > 0 && currentFrame > sprite.AnimationFrameCount) + { + currentFrame -= sprite.AnimationFrameCount; + } + else + { + result = currentFrame - 1; + break; + } + } + return result; + } + /// /// Returns a ratio between 0 and 1, and whether the entity is in crit. /// @@ -121,7 +193,7 @@ public sealed class EntityHealthBarOverlay : Overlay if (!_mobThresholdSystem.TryGetThresholdForState(uid, MobState.Critical, out var threshold)) return (1, false); - var ratio = 1 - ((FixedPoint2)(dmg.TotalDamage / threshold)).Float(); + var ratio = 1 - ((FixedPoint2) (dmg.TotalDamage / threshold)).Float(); return (ratio, false); } diff --git a/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs b/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs index b521027409..fd1127b16a 100644 --- a/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs +++ b/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs @@ -10,7 +10,6 @@ namespace Content.Client.EntityHealthBar public sealed class ShowHealthBarsSystem : EntitySystem { [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IPrototypeManager _protoMan = default!; [Dependency] private readonly IOverlayManager _overlayMan = default!; private EntityHealthBarOverlay _overlay = default!; @@ -18,16 +17,16 @@ namespace Content.Client.EntityHealthBar { base.Initialize(); - SubscribeLocalEvent(OnInit); - SubscribeLocalEvent(OnRemove); - SubscribeLocalEvent(OnPlayerAttached); - SubscribeLocalEvent(OnPlayerDetached); + SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnRemove); + SubscribeLocalEvent(OnPlayerAttached); + SubscribeLocalEvent(OnPlayerDetached); SubscribeLocalEvent(OnRoundRestart); - _overlay = new(EntityManager, _protoMan); + _overlay = new(EntityManager); } - private void OnInit(EntityUid uid, ShowHealthBarsComponent component, ComponentInit args) + private void OnInit(EntityUid uid, ShowWhiteHealthBarsComponent component, ComponentInit args) { if (_player.LocalPlayer?.ControlledEntity == uid) { @@ -37,7 +36,7 @@ namespace Content.Client.EntityHealthBar } - private void OnRemove(EntityUid uid, ShowHealthBarsComponent component, ComponentRemove args) + private void OnRemove(EntityUid uid, ShowWhiteHealthBarsComponent component, ComponentRemove args) { if (_player.LocalPlayer?.ControlledEntity == uid) { @@ -45,13 +44,13 @@ namespace Content.Client.EntityHealthBar } } - private void OnPlayerAttached(EntityUid uid, ShowHealthBarsComponent component, PlayerAttachedEvent args) + private void OnPlayerAttached(EntityUid uid, ShowWhiteHealthBarsComponent component, PlayerAttachedEvent args) { _overlayMan.AddOverlay(_overlay); _overlay.DamageContainers = component.DamageContainers; } - private void OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, PlayerDetachedEvent args) + private void OnPlayerDetached(EntityUid uid, ShowWhiteHealthBarsComponent component, PlayerDetachedEvent args) { _overlayMan.RemoveOverlay(_overlay); } diff --git a/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs b/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs new file mode 100644 index 0000000000..70cd8df5fc --- /dev/null +++ b/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs @@ -0,0 +1,149 @@ +using Content.Shared.Humanoid; +using Content.Shared.Inventory; +using Content.Shared.PDA; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; +using Robust.Shared.Enums; +using Robust.Shared.Prototypes; +using Robust.Shared.Utility; +using Content.Shared.Access.Components; +using Content.Shared.Roles; +using System.Diagnostics.CodeAnalysis; +using System.Numerics; + +namespace Content.Client.EntityJobInfo; + +public sealed class EntityJobInfoOverlay : Overlay +{ + private readonly IEntityManager _entManager; + private readonly SharedTransformSystem _transform; + private readonly IPrototypeManager _prototypeManager; + private readonly InventorySystem _inventorySystem; + private readonly ShaderInstance _shader; + public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; + + public EntityJobInfoOverlay(IEntityManager entManager, IPrototypeManager protoManager, InventorySystem inventorySystem) + { + _entManager = entManager; + _prototypeManager = protoManager; + _inventorySystem = inventorySystem; + _transform = _entManager.EntitySysManager.GetEntitySystem(); + _shader = protoManager.Index("unshaded").Instance(); + } + + protected override void Draw(in OverlayDrawArgs args) + { + var handle = args.WorldHandle; + var rotation = args.Viewport.Eye?.Rotation ?? Angle.Zero; + var spriteQuery = _entManager.GetEntityQuery(); + var xformQuery = _entManager.GetEntityQuery(); + + const float scale = 1f; + var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale)); + var rotationMatrix = Matrix3.CreateRotation(-rotation); + handle.UseShader(_shader); + + foreach (var hum in _entManager.EntityQuery(true)) + { + if (!xformQuery.TryGetComponent(hum.Owner, out var xform) || + xform.MapID != args.MapId) + { + continue; + } + + var worldPosition = _transform.GetWorldPosition(xform); + var worldMatrix = Matrix3.CreateTranslation(worldPosition); + + Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld); + Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty); + + handle.SetTransform(matty); + + var icon = "NoId"; + var icon_job = GetIcon(hum.Owner); + if (icon_job != null) + icon = icon_job; + + var sprite_icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/job_icons.rsi"), icon); + var _iconTexture = _entManager.EntitySysManager.GetEntitySystem().Frame0(sprite_icon); + + // Use the sprite itself if we know its bounds. This means short or tall sprites don't get overlapped + // by the bar. + float yOffset; + float xOffset; + if (spriteQuery.TryGetComponent(hum.Owner, out var sprite)) + { + yOffset = sprite.Bounds.Height + 7f; //sprite.Bounds.Height + 7f; + xOffset = sprite.Bounds.Width - 17f; //sprite.Bounds.Width + 7f; + } + else + { + yOffset = 1f; + xOffset = 1f; + } + + // Position above the entity (we've already applied the matrix transform to the entity itself) + // Offset by the texture size for every do_after we have. + var position = new Vector2(xOffset / EyeManager.PixelsPerMeter, + yOffset / EyeManager.PixelsPerMeter); + + // Draw the underlying bar texture + if (sprite != null && !sprite.ContainerOccluded) + handle.DrawTexture(_iconTexture, position); + } + + handle.UseShader(null); + handle.SetTransform(Matrix3.Identity); + } + + private string? GetIcon(EntityUid uid) + { + if (_inventorySystem.TryGetSlotEntity(uid, "id", out var idUid)) + { + // PDA + if (_entManager.TryGetComponent(idUid, out PdaComponent? pda) && + _entManager.TryGetComponent(pda.ContainedId, out IdCardComponent? idCard)) + { + if (TryMatchJobTitleToIcon(idCard.JobTitle, out string? icon)) + return icon; + } + // ID Card + if (_entManager.TryGetComponent(idUid, out IdCardComponent? id)) + { + if (TryMatchJobTitleToIcon(id.JobTitle, out string? icon)) + return icon; + } + } + + return null; + } + + private string GetNameAndJob(IdCardComponent id) + { + var jobSuffix = string.IsNullOrWhiteSpace(id.JobTitle) ? string.Empty : $" ({id.JobTitle})"; + + var val = string.IsNullOrWhiteSpace(id.FullName) + ? Loc.GetString("access-id-card-component-owner-name-job-title-text", + ("jobSuffix", jobSuffix)) + : Loc.GetString("access-id-card-component-owner-full-name-job-title-text", + ("fullName", id.FullName), + ("jobSuffix", jobSuffix)); + + return val; + } + + private bool TryMatchJobTitleToIcon(string? jobTitle, [NotNullWhen(true)] out string? jobIcon) + { + foreach (var job in _prototypeManager.EnumeratePrototypes()) + { + if (job.LocalizedName == jobTitle) + { + jobIcon = job.Icon; + return true; + } + } + + jobIcon = "CustomId"; + return true; // For 'CustomId' icon we need send 'true' result; + } +} diff --git a/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs b/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs new file mode 100644 index 0000000000..f8d6e75199 --- /dev/null +++ b/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs @@ -0,0 +1,65 @@ +using Content.Shared.EntityJobInfo; +using Content.Shared.GameTicking; +using Robust.Client.Player; +using Robust.Client.Graphics; +using Robust.Client.GameObjects; +using Robust.Shared.Prototypes; +using Content.Shared.Inventory; +using Robust.Shared.Player; + +namespace Content.Client.EntityJobInfo +{ + public sealed class ShowJobInfoSystem : EntitySystem + { + [Dependency] private readonly IPlayerManager _player = default!; + [Dependency] private readonly IPrototypeManager _protoMan = default!; + [Dependency] private readonly IOverlayManager _overlayMan = default!; + [Dependency] private readonly InventorySystem _inventorySystem = default!; + + private EntityJobInfoOverlay _overlay = default!; + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnRemove); + SubscribeLocalEvent(OnPlayerAttached); + SubscribeLocalEvent(OnPlayerDetached); + SubscribeLocalEvent(OnRoundRestart); + + _overlay = new(EntityManager, _protoMan, _inventorySystem); + } + + private void OnInit(EntityUid uid, ShowJobInfoComponent component, ComponentInit args) + { + if (_player.LocalPlayer?.ControlledEntity == uid) + { + _overlayMan.AddOverlay(_overlay); + } + + + } + private void OnRemove(EntityUid uid, ShowJobInfoComponent component, ComponentRemove args) + { + if (_player.LocalPlayer?.ControlledEntity == uid) + { + _overlayMan.RemoveOverlay(_overlay); + } + } + + private void OnPlayerAttached(EntityUid uid, ShowJobInfoComponent component, PlayerAttachedEvent args) + { + _overlayMan.AddOverlay(_overlay); + } + + private void OnPlayerDetached(EntityUid uid, ShowJobInfoComponent component, PlayerDetachedEvent args) + { + _overlayMan.RemoveOverlay(_overlay); + } + + private void OnRoundRestart(RoundRestartCleanupEvent args) + { + _overlayMan.RemoveOverlay(_overlay); + } + } +} diff --git a/Content.Shared/Overlays/ShowHealthBarsComponent.cs b/Content.Shared/Overlays/ShowHealthBarsComponent.cs index 5dd8ecd3d6..48e3162269 100644 --- a/Content.Shared/Overlays/ShowHealthBarsComponent.cs +++ b/Content.Shared/Overlays/ShowHealthBarsComponent.cs @@ -8,7 +8,7 @@ namespace Content.Shared.Overlays; /// This component allows you to see health bars above damageable mobs. /// [RegisterComponent, NetworkedComponent] -public sealed partial class ShowWhiteHealthBarsComponent : Component +public sealed partial class ShowHealthBarsComponent : Component { /// /// Displays health bars of the damage containers. diff --git a/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs b/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs index f12f536f46..8a39931c7d 100644 --- a/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs +++ b/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs @@ -7,7 +7,7 @@ namespace Content.Shared.Clothing { [DataField("component", required: true)] [AlwaysPushInheritance] - public ComponentRegistry Components { get; } = new(); + public ComponentRegistry Components { get; set; } = new(); [ViewVariables(VVAccess.ReadWrite)] public bool IsActive = false; diff --git a/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs b/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs index 8413a4a432..f82cd566d7 100644 --- a/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs +++ b/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs @@ -26,9 +26,9 @@ public sealed class ClothingGrantingSystem : EntitySystem if (!clothing.Slots.HasFlag(args.SlotFlags)) return; - if (component.Components.Count > 1) + if (component.Components.Count > 8) { - Logger.Error("Although a component registry supports multiple components, we cannot bookkeep more than 1 component for ClothingGrantComponent at this time."); + Logger.Error("Although a component registry supports multiple components, we cannot bookkeep more than 8 component for ClothingGrantComponent at this time."); return; } diff --git a/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs b/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs index 6a13805692..1013f5b1ee 100644 --- a/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs +++ b/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs @@ -8,11 +8,10 @@ namespace Content.Shared.EntityHealthBar /// This component allows you to see health bars above damageable mobs. /// [RegisterComponent] - public sealed partial class ShowHealthBarsComponent : Component + public sealed partial class ShowWhiteHealthBarsComponent : Component { /// - /// If null, displays all health bars. - /// If not null, displays health bars of only that damage container. + /// Displays health bars of the damage containers. /// [DataField("damageContainers", customTypeSerializer: typeof(PrototypeIdListSerializer))] diff --git a/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs b/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs new file mode 100644 index 0000000000..9f9126a0ae --- /dev/null +++ b/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Shared.EntityJobInfo; + +/// +/// This component allows you to see job icon from entity(char) +/// +[RegisterComponent] +public sealed partial class ShowJobInfoComponent : Component +{ +} + diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/clothing/eyes/huds.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/clothing/eyes/huds.ftl new file mode 100644 index 0000000000..c08199dc0b --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/clothing/eyes/huds.ftl @@ -0,0 +1,2 @@ +ent-ClothingEyesHudAdvanced = расширенный визор + .desc = Расширенный девайс, позволяющий видеть должность и состояние здоровья сущности. diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml b/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml index 302e50c8fb..d77f7a55bc 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml @@ -8,10 +8,6 @@ sprite: Clothing/Eyes/Hud/diag.rsi - type: Clothing sprite: Clothing/Eyes/Hud/diag.rsi -# - type: ShowHealthBars -# damageContainers: -# - Inorganic -# - Silicon - type: ClothingGrantComponent component: - type: ShowWhiteHealthBars @@ -32,9 +28,9 @@ # - type: ShowHealthBars # damageContainers: # - Biological -# - type: ShowHealthIcons -# damageContainers: -# - Biological + - type: ShowHealthIcons + damageContainers: + - Biological - type: ClothingGrantComponent component: - type: ShowWhiteHealthBars @@ -118,9 +114,9 @@ # - type: ShowHealthBars # damageContainers: # - Biological -# - type: ShowHealthIcons -# damageContainers: -# - Biological + - type: ShowHealthIcons + damageContainers: + - Biological - type: ClothingGrantComponent component: - type: ShowWhiteHealthBars @@ -141,9 +137,9 @@ # - type: ShowHealthBars # damageContainers: # - Biological -# - type: ShowHealthIcons -# damageContainers: -# - Biological + - type: ShowHealthIcons + damageContainers: + - Biological - type: ClothingGrantComponent component: - type: ShowWhiteHealthBars @@ -181,13 +177,14 @@ damageContainers: - Biological - Inorganic + - Silicon # - type: ShowHealthBars # damageContainers: # - Biological # - Inorganic -# - type: ShowHealthIcons -# damageContainers: -# - Biological + - type: ShowHealthIcons + damageContainers: + - Biological - type: ShowSyndicateIcons - type: entity @@ -205,15 +202,16 @@ # damageContainers: # - Biological # - Inorganic -# - type: ShowHealthIcons -# damageContainers: -# - Biological + - type: ShowHealthIcons + damageContainers: + - Biological - type: ClothingGrantComponent component: - type: ShowWhiteHealthBars damageContainers: - Biological - Inorganic + - Silicon - type: ShowHungerIcons - type: ShowThirstIcons - type: ShowSyndicateIcons diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml index 4a45717b79..12a495541e 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml @@ -220,6 +220,12 @@ access: [["Medical"], ["Command"], ["Research"]] - type: Inventory templateId: borgDutch + - type: ShowHealthIcons + damageContainers: + - Biological + - type: ShowWhiteHealthBars + damageContainers: + - Biological - type: entity id: BorgChassisService diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml index ae6549c071..de20451463 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml @@ -352,9 +352,9 @@ # - type: ShowHealthBars # damageContainers: # - Biological -# - type: ShowHealthIcons -# damageContainers: -# - Biological + - type: ShowHealthIcons + damageContainers: + - Biological - type: ShowWhiteHealthBars damageContainers: - Biological diff --git a/Resources/Prototypes/StatusEffects/health.yml b/Resources/Prototypes/StatusEffects/health.yml index 2ab90e7582..8516c9aee9 100644 --- a/Resources/Prototypes/StatusEffects/health.yml +++ b/Resources/Prototypes/StatusEffects/health.yml @@ -1,7 +1,7 @@ - type: statusIcon id: HealthIconFine - priority: 1 + priority: 0 icon: sprite: Interface/Misc/health_icons.rsi state: Fine - locationPreference: Right \ No newline at end of file + locationPreference: Right diff --git a/Resources/Textures/Interface/Misc/health_state.rsi/dead_state.png b/Resources/Textures/Interface/Misc/health_state.rsi/dead_state.png new file mode 100644 index 0000000000..18a1824b8c Binary files /dev/null and b/Resources/Textures/Interface/Misc/health_state.rsi/dead_state.png differ diff --git a/Resources/Textures/Interface/Misc/health_state.rsi/defib_state.png b/Resources/Textures/Interface/Misc/health_state.rsi/defib_state.png new file mode 100644 index 0000000000..a8f454afb7 Binary files /dev/null and b/Resources/Textures/Interface/Misc/health_state.rsi/defib_state.png differ diff --git a/Resources/Textures/Interface/Misc/health_state.rsi/life_state.png b/Resources/Textures/Interface/Misc/health_state.rsi/life_state.png new file mode 100644 index 0000000000..3ee76be3a3 Binary files /dev/null and b/Resources/Textures/Interface/Misc/health_state.rsi/life_state.png differ diff --git a/Resources/Textures/Interface/Misc/health_state.rsi/meta.json b/Resources/Textures/Interface/Misc/health_state.rsi/meta.json new file mode 100644 index 0000000000..57afde0d3c --- /dev/null +++ b/Resources/Textures/Interface/Misc/health_state.rsi/meta.json @@ -0,0 +1,18 @@ +{ + "license": "CC-BY-SA-3.0", + "copyright": "https://github.com/tgstation/tgstation/blob/10f1193ed286281a868e5824428938addbc045af/icons/mob/huds/hud.dmi", + "version": 1, + "size": { "y": 8, "x": 8 }, + "states": [ + { + "name": "dead_state" + }, + { + "name": "life_state" + }, + { + "name": "defib_state", + "delays": [[0.1, 0.1, 0.1, 0.1, 0.1, 0.1]] + } + ] +} diff --git a/Resources/Textures/Interface/Misc/health_status.rsi/background.png b/Resources/Textures/Interface/Misc/health_status.rsi/background.png new file mode 100644 index 0000000000..0a54b3d924 Binary files /dev/null and b/Resources/Textures/Interface/Misc/health_status.rsi/background.png differ diff --git a/Resources/Textures/Interface/Misc/health_status.rsi/meta.json b/Resources/Textures/Interface/Misc/health_status.rsi/meta.json new file mode 100644 index 0000000000..e0a595e624 --- /dev/null +++ b/Resources/Textures/Interface/Misc/health_status.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "size": { + "y": 3, + "x": 16 + }, + "license": "CC-BY-SA-3.0", + "copyright": "https://github.com/tgstation/tgstation/blob/886ca0f8dddf83ecaf10c92ff106172722352192/icons/effects/progessbar.dmi", + "states": [ + { + "name": "background" + } + ] +} diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/CustomId.png b/Resources/Textures/Interface/Misc/job_icons.rsi/CustomId.png new file mode 100644 index 0000000000..3c562130c7 Binary files /dev/null and b/Resources/Textures/Interface/Misc/job_icons.rsi/CustomId.png differ diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json b/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json index da00077fbd..299e2f09f5 100644 --- a/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json +++ b/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json @@ -8,6 +8,9 @@ "y": 8 }, "states": [ + { + "name": "CustomId" + }, { "name": "Detective" },