Class InventorySlotClaims
Windows that, while open, take a right-click on an inventory slot for themselves: the Commerce module's trade window puts the item on the table instead of equipping or using it.
public static class InventorySlotClaims
- Inheritance
-
InventorySlotClaims
- Inherited Members
Remarks
The inventory asks the claims first and falls back to its own meaning (equip, use) when none takes the click,
so a game without the module keeps an ordinary bag. A claim answers true only when it handled the click.
Registered once, before the first scene loads ([RuntimeInitializeOnLoadMethod]), as with
CharacterMenuEntries.
Methods
Register(string, Func<int, bool>)
Adds (or replaces, by id) a claim on right-clicked inventory slots.
public static void Register(string id, Func<int, bool> tryClaimRightClick)
Parameters
TryClaimRightClick(int)
True when an open window took the right-click on slotIndex.
public static bool TryClaimRightClick(int slotIndex)
Parameters
slotIndexint
Returns
Unregister(string)
Removes a claim; false when there was none with that id.
public static bool Unregister(string id)
Parameters
idstring