change ShowHealthBars and ShowHealthIcons to use protoId (#32355)
use protoId
This commit is contained in:
@@ -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;
|
||||
@@ -34,7 +36,7 @@ public sealed class ShowHealthBarsCommand : LocalizedCommands
|
||||
{
|
||||
var showHealthBarsComponent = new ShowHealthBarsComponent
|
||||
{
|
||||
DamageContainers = args.ToList(),
|
||||
DamageContainers = args.Select(arg => new ProtoId<DamageContainerPrototype>(arg)).ToList(),
|
||||
HealthStatusIcon = null,
|
||||
NetSyncEnabled = false
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@ using Content.Shared.Damage.Prototypes;
|
||||
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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: ShowHealthBars
|
||||
damageContainers:
|
||||
- Biological
|
||||
- type: ShowHealthIcons
|
||||
damageContainers:
|
||||
- Biological
|
||||
|
||||
- type: entity
|
||||
parent: ClothingEyesBase
|
||||
@@ -223,8 +219,6 @@
|
||||
sprite: Clothing/Eyes/Hud/syndagent.rsi
|
||||
- type: ShowSyndicateIcons
|
||||
- type: ShowHealthBars
|
||||
damageContainers:
|
||||
- Biological
|
||||
|
||||
- type: entity
|
||||
parent: [ClothingEyesGlassesSunglasses, ShowSecurityIcons]
|
||||
|
||||
@@ -391,8 +391,6 @@
|
||||
- type: Construction
|
||||
node: syndicatemedical
|
||||
- type: ShowHealthBars
|
||||
damageContainers:
|
||||
- Biological
|
||||
- type: InteractionPopup
|
||||
interactSuccessString: petting-success-syndicate-cyborg
|
||||
interactFailureString: petting-failure-syndicate-cyborg
|
||||
|
||||
Reference in New Issue
Block a user