Skip to content

Commit

Permalink
fuck yes thank god
Browse files Browse the repository at this point in the history
  • Loading branch information
MilonPL committed Sep 21, 2024
1 parent 3cc7fd4 commit 876c21e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Content.Client/Commands/ShowHealthBarsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Content.Shared.Damage.Prototypes;
using Content.Shared.Overlays;
using Robust.Client.Player;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
using System.Linq;

namespace Content.Client.Commands;
Expand Down Expand Up @@ -34,7 +36,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var showHealthBarsComponent = new ShowHealthBarsComponent
{
DamageContainers = args.ToList(),
DamageContainers = args.Select(arg => new ProtoId<DamageContainerPrototype>(arg)).ToList(),
HealthStatusIcon = null,
NetSyncEnabled = false
};
Expand Down
8 changes: 5 additions & 3 deletions Content.Shared/Overlays/ShowHealthBarsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Shared.StatusIcon;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Shared.Overlays;

Expand All @@ -15,8 +14,11 @@ public sealed partial class ShowHealthBarsComponent : Component
/// <summary>
/// Displays health bars of the damage containers.
/// </summary>
[DataField("damageContainers", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageContainerPrototype>))]
public List<string> DamageContainers = new();
[DataField]
public List<ProtoId<DamageContainerPrototype>> DamageContainers = new()
{
"Biological"
};

[DataField]
public ProtoId<HealthIconPrototype>? HealthStatusIcon = "HealthIconFine";
Expand Down
9 changes: 6 additions & 3 deletions Content.Shared/Overlays/ShowHealthIconsComponent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Content.Shared.Damage.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Prototypes;

namespace Content.Shared.Overlays;

Expand All @@ -13,6 +13,9 @@ public sealed partial class ShowHealthIconsComponent : Component
/// <summary>
/// Displays health status icons of the damage containers.
/// </summary>
[DataField("damageContainers", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageContainerPrototype>))]
public List<string> DamageContainers = new();
[DataField]
public List<ProtoId<DamageContainerPrototype>> DamageContainers = new()
{
"Biological"
};
}
6 changes: 0 additions & 6 deletions Resources/Prototypes/Entities/Clothing/Eyes/hud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
categories: [ HideSpawnMenu ]
components:
- type: ShowHealthBars
damageContainers:
- Biological
- type: ShowHealthIcons
damageContainers:
- Biological

- type: entity
parent: ClothingEyesBase
Expand Down Expand Up @@ -223,8 +219,6 @@
sprite: Clothing/Eyes/Hud/syndagent.rsi
- type: ShowSyndicateIcons
- type: ShowHealthBars
damageContainers:
- Biological

- type: entity
parent: [ClothingEyesGlassesSunglasses, ShowSecurityIcons]
Expand Down
2 changes: 0 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,6 @@
- type: Construction
node: syndicatemedical
- type: ShowHealthBars
damageContainers:
- Biological
- type: InteractionPopup
interactSuccessString: petting-success-syndicate-cyborg
interactFailureString: petting-failure-syndicate-cyborg
Expand Down

0 comments on commit 876c21e

Please sign in to comment.