]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Toggle clothing fix (#32826)
authorArZarLordOfMango <96249677+ArZarLordOfMango@users.noreply.github.com>
Tue, 19 Nov 2024 20:31:37 +0000 (21:31 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Nov 2024 20:31:37 +0000 (21:31 +0100)
* toggle clothing fix

* some adding

Content.Shared/Clothing/Components/ToggleClothingComponent.cs
Content.Shared/Clothing/EntitySystems/ToggleClothingSystem.cs
Resources/Prototypes/Entities/Clothing/Hands/gloves.yml
Resources/Prototypes/Entities/Clothing/Head/helmets.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml
Resources/Prototypes/Entities/Clothing/Shoes/magboots.yml

index 04bc3ed4e83d0e9b4d297f85bda0dcc8b657efae..f827cbfea8d791ec342e120e153cfcb10360dd2e 100644 (file)
@@ -33,6 +33,12 @@ public sealed partial class ToggleClothingComponent : Component
     /// </summary>
     [DataField]
     public bool DisableOnUnequip;
+
+    /// <summary>
+    /// If true, the clothes must equip for adding action.
+    /// </summary>
+    [DataField]
+    public bool MustEquip = true;
 }
 
 /// <summary>
index 9889376c9d417c1200f5ca850f7554d9330d1b0d..8d6e3e3de65c51ad5d1a196a2a1d9ac28b8f2eb0 100644 (file)
@@ -39,8 +39,12 @@ public sealed class ToggleClothingSystem : EntitySystem
 
     private void OnGetActions(Entity<ToggleClothingComponent> ent, ref GetItemActionsEvent args)
     {
+        if (args.InHands && ent.Comp.MustEquip)
+            return;
+
         var ev = new ToggleClothingCheckEvent(args.User);
         RaiseLocalEvent(ent, ref ev);
+
         if (!ev.Cancelled)
             args.AddAction(ent.Comp.ActionEntity);
     }
index 16777cd6900890a718a2f4301f78ab3c25d5a7f6..1dd1e0ba04261d35f746d6cf0820599b4fdf6caa 100644 (file)
     stealthy: true
   - type: ToggleClothing
     action: ActionToggleNinjaGloves
+    disableOnUnequip: true
   - type: NinjaGloves
     abilities:
     - components:
index 11643c076d84cc70e6da70a3a207863a5fd6a07c..f06f20249b466f6e7f7a57694ea093d3c5e4286d 100644 (file)
     delay: 1.0
   - type: ToggleClothing
     action: ActionToggleJusticeHelm
+    mustEquip: false
   - type: ItemTogglePointLight
   - type: ToggleableLightVisuals
     clothingVisuals:
index a58c2a3fdd4f85869b6ad820b809b8f862260c2f..f78694a0fabe94281f824176228cf6e7961c891a 100644 (file)
   # phase cloak
   - type: ToggleClothing
     action: ActionTogglePhaseCloak
+    disableOnUnequip: true
   - type: ComponentToggler
     parent: true
     components:
index 0250671acfc5d9d1b3eefdd72dc0cbcddef65efe..ab8084c91c0d762d3c9ba5d92e7e16a453764c5e 100644 (file)
@@ -14,6 +14,7 @@
     sprite: Clothing/Shoes/Boots/magboots.rsi
   - type: ToggleClothing
     action: ActionToggleMagboots
+    mustEquip: false
   - type: ToggleVerb
     text: toggle-magboots-verb-get-data-text
   - type: ComponentToggler