ORK.Game.ActiveGroup.Leader.Inventory.ContentChanged += ContentChangedHandler;
void ContentChangedHandler(Inventory inventory, int quantity, IInventoryShortcut shortcut, bool showNotification, bool showConsole)
{
Debug.Log(shortcut.GUID);
}
I'm noticing that the GUID field of the IInventoryShortcut is blank, making me think this maybe isn't an actual reference to the item in player inventory. Is there a way to use this IInventoryShortcut to get the ItemShortcut reference in the actual item in the player inventory? For example I tried this:
ORK.Game.ActiveGroup.Leader.Inventory.Items.Get(shortcut)
It looks like you're new here. If you want to get involved, click one of these buttons!
Generally, you can cast any IShortcut instance (i.e. also IInventoryShortcut, which is just an extension of it) to the type you need in 2 ways:
ItemShortcut item = inventoryShortcut as ItemShortcut;
if(item != null)
{
// do stuff
}
Or:
if(inventoryShortcut is ItemShortcut)
{
ItemShortcut item = (ItemShortcut)inventoryShortcut;
// do stuff
}
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!