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 Content.Shared.Overlays;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Content.Client.Commands;
|
namespace Content.Client.Commands;
|
||||||
@@ -34,7 +36,7 @@ public sealed class ShowHealthBarsCommand : LocalizedCommands
|
|||||||
{
|
{
|
||||||
var showHealthBarsComponent = new ShowHealthBarsComponent
|
var showHealthBarsComponent = new ShowHealthBarsComponent
|
||||||
{
|
{
|
||||||
DamageContainers = args.ToList(),
|
DamageContainers = args.Select(arg => new ProtoId<DamageContainerPrototype>(arg)).ToList(),
|
||||||
HealthStatusIcon = null,
|
HealthStatusIcon = null,
|
||||||
NetSyncEnabled = false
|
NetSyncEnabled = false
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using Content.Shared.Damage.Prototypes;
|
|||||||
using Content.Shared.StatusIcon;
|
using Content.Shared.StatusIcon;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
|
||||||
|
|
||||||
namespace Content.Shared.Overlays;
|
namespace Content.Shared.Overlays;
|
||||||
|
|
||||||
@@ -15,8 +14,11 @@ public sealed partial class ShowHealthBarsComponent : Component
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Displays health bars of the damage containers.
|
/// Displays health bars of the damage containers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("damageContainers", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageContainerPrototype>))]
|
[DataField]
|
||||||
public List<string> DamageContainers = new();
|
public List<ProtoId<DamageContainerPrototype>> DamageContainers = new()
|
||||||
|
{
|
||||||
|
"Biological"
|
||||||
|
};
|
||||||
|
|
||||||
[DataField]
|
[DataField]
|
||||||
public ProtoId<HealthIconPrototype>? HealthStatusIcon = "HealthIconFine";
|
public ProtoId<HealthIconPrototype>? HealthStatusIcon = "HealthIconFine";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Shared.Damage.Prototypes;
|
using Content.Shared.Damage.Prototypes;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Shared.Overlays;
|
namespace Content.Shared.Overlays;
|
||||||
|
|
||||||
@@ -13,6 +13,9 @@ public sealed partial class ShowHealthIconsComponent : Component
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Displays health status icons of the damage containers.
|
/// Displays health status icons of the damage containers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("damageContainers", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageContainerPrototype>))]
|
[DataField]
|
||||||
public List<string> DamageContainers = new();
|
public List<ProtoId<DamageContainerPrototype>> DamageContainers = new()
|
||||||
|
{
|
||||||
|
"Biological"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,7 @@
|
|||||||
categories: [ HideSpawnMenu ]
|
categories: [ HideSpawnMenu ]
|
||||||
components:
|
components:
|
||||||
- type: ShowHealthBars
|
- type: ShowHealthBars
|
||||||
damageContainers:
|
|
||||||
- Biological
|
|
||||||
- type: ShowHealthIcons
|
- type: ShowHealthIcons
|
||||||
damageContainers:
|
|
||||||
- Biological
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingEyesBase
|
parent: ClothingEyesBase
|
||||||
@@ -223,8 +219,6 @@
|
|||||||
sprite: Clothing/Eyes/Hud/syndagent.rsi
|
sprite: Clothing/Eyes/Hud/syndagent.rsi
|
||||||
- type: ShowSyndicateIcons
|
- type: ShowSyndicateIcons
|
||||||
- type: ShowHealthBars
|
- type: ShowHealthBars
|
||||||
damageContainers:
|
|
||||||
- Biological
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: [ClothingEyesGlassesSunglasses, ShowSecurityIcons]
|
parent: [ClothingEyesGlassesSunglasses, ShowSecurityIcons]
|
||||||
|
|||||||
@@ -391,8 +391,6 @@
|
|||||||
- type: Construction
|
- type: Construction
|
||||||
node: syndicatemedical
|
node: syndicatemedical
|
||||||
- type: ShowHealthBars
|
- type: ShowHealthBars
|
||||||
damageContainers:
|
|
||||||
- Biological
|
|
||||||
- type: InteractionPopup
|
- type: InteractionPopup
|
||||||
interactSuccessString: petting-success-syndicate-cyborg
|
interactSuccessString: petting-success-syndicate-cyborg
|
||||||
interactFailureString: petting-failure-syndicate-cyborg
|
interactFailureString: petting-failure-syndicate-cyborg
|
||||||
|
|||||||
Reference in New Issue
Block a user