Toggle clothing fix (#32826)

* toggle clothing fix

* some adding
This commit is contained in:
ArZarLordOfMango
2024-11-19 21:31:37 +01:00
committed by GitHub
parent 0e2e6a001f
commit a949cf33e9
6 changed files with 14 additions and 0 deletions

View 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>

View 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);
}

View File

@@ -230,6 +230,7 @@
stealthy: true
- type: ToggleClothing
action: ActionToggleNinjaGloves
disableOnUnequip: true
- type: NinjaGloves
abilities:
- components:

View File

@@ -452,6 +452,7 @@
delay: 1.0
- type: ToggleClothing
action: ActionToggleJusticeHelm
mustEquip: false
- type: ItemTogglePointLight
- type: ToggleableLightVisuals
clothingVisuals:

View File

@@ -155,6 +155,7 @@
# phase cloak
- type: ToggleClothing
action: ActionTogglePhaseCloak
disableOnUnequip: true
- type: ComponentToggler
parent: true
components:

View 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