HolsterAction.BeforeAdd
#
Declarationpublic virtual void BeforeAdd(ItemContainer container, Boolean& cancelAdd)
#
ParametersName | Description |
---|---|
container | Container requesting the add |
cancelAdd | Forbid adding indicator |
#
DescriptionMethod run before item is added to inventory
#
Usagenamespace NullSave.GDTK.Inventory{ public class ExampleAction : ItemPlugin {
public override bool isAction => true;
public override string title => "(Action) Example";
public override string description => "Example action for BeforeAdd";
public int itemLimit = 20;
// In some cases you may wish to prevent an item from being added // This override on plugins allows you to do so. public override void BeforeAdd(ItemContainer container, ref bool cancelAdd) { cancelAdd = container.items.Count >= itemLimit; }
}}