]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
change ShowHealthBars and ShowHealthIcons to use protoId (#32355)
authorMilon <plmilonpl@gmail.com>
Sat, 2 Nov 2024 16:59:38 +0000 (17:59 +0100)
committerGitHub <noreply@github.com>
Sat, 2 Nov 2024 16:59:38 +0000 (17:59 +0100)
use protoId

Content.Client/Commands/ShowHealthBarsCommand.cs
Content.Shared/Overlays/ShowHealthBarsComponent.cs
Content.Shared/Overlays/ShowHealthIconsComponent.cs
Resources/Prototypes/Entities/Clothing/Eyes/hud.yml
Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml

index 0811f9666378d50e6169710cd0d9a6a1bf792940..6ea9d06c8c3df0ad09966ff7a2c3df69e5cace4c 100644 (file)
@@ -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
             };
index 4642c5936a7dcd2b01f5909d37c83d6ca6022783..cb4f0fe7dd49170cc90a251070060b9dca7d5003 100644 (file)
@@ -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";
index c2526c2f401539e3dfe7c7763e100fc105139b4a..aa12c9887a8e18a83467ecb38ac7771c1105fd5f 100644 (file)
@@ -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"
+    };
 }
index 9e881bf9c218c59bb4953e05f0d1cd13cc1c1452..300c938bc90f78cd5fbe65142bfd1d0b521a3e90 100644 (file)
   categories: [ HideSpawnMenu ]
   components:
   - type: ShowHealthBars
-    damageContainers:
-    - Biological
   - type: ShowHealthIcons
-    damageContainers:
-    - Biological
 
 - type: entity
   parent: ClothingEyesBase
     sprite: Clothing/Eyes/Hud/syndagent.rsi
   - type: ShowSyndicateIcons
   - type: ShowHealthBars
-    damageContainers:
-    - Biological
 
 - type: entity
   parent: [ClothingEyesGlassesSunglasses, ShowSecurityIcons]
index d1d530ae81b728ace8b5f0bae376833100ef2b19..6a8f1e5abb08303be361dd4b9981597f2156e153 100644 (file)
     - type: Construction
       node: syndicatemedical
     - type: ShowHealthBars
-      damageContainers:
-      - Biological
     - type: InteractionPopup
       interactSuccessString: petting-success-syndicate-cyborg
       interactFailureString: petting-failure-syndicate-cyborg