@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -230,6 +230,7 @@
|
||||
stealthy: true
|
||||
- type: ToggleClothing
|
||||
action: ActionToggleNinjaGloves
|
||||
disableOnUnequip: true
|
||||
- type: NinjaGloves
|
||||
abilities:
|
||||
- components:
|
||||
|
||||
@@ -452,6 +452,7 @@
|
||||
delay: 1.0
|
||||
- type: ToggleClothing
|
||||
action: ActionToggleJusticeHelm
|
||||
mustEquip: false
|
||||
- type: ItemTogglePointLight
|
||||
- type: ToggleableLightVisuals
|
||||
clothingVisuals:
|
||||
|
||||
@@ -155,6 +155,7 @@
|
||||
# phase cloak
|
||||
- type: ToggleClothing
|
||||
action: ActionTogglePhaseCloak
|
||||
disableOnUnequip: true
|
||||
- type: ComponentToggler
|
||||
parent: true
|
||||
components:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user