0

Inventory context menu not working with items which have multiple types

MiTschMR 4 weeks ago in Inventory 0

Hey all

I have made a tutorial for an inventory context menu a little while ago. Now I have discovered, that it doesn't work when an item has multiple types assigned to it. It works fine when it is only a single type. 

Here is the link to the tutorial: https://docs.mitschmr-studios.io/gc-api-guides/inventory-context-menu-support

I check for the equipped state of an item with the following code: 


Item item = InventoryManager.Instance.itemsCatalogue[uuid];
Item itemEquipped = null;
            
if (item.itemTypes >= 0)
{
    itemEquipped = InventoryManager.Instance.GetEquip(HookPlayer.Instance.gameObject, Convert.ToInt32(Math.Log(item.itemTypes, 2)));
}

This code can be found in the method SetButtonVisibility(), which enables the buttons depending on the properties of the item. If I modify the code to show i.e. the Equip button and click on it, it does nothing. There seems to be some misinterpreting from my side, but I can't figure it out. 

Any help is much appreciated.


If you need more information, feel free to ask. 

MiTschMR

Unity version:
2019.4.8f1
Game Creator version:
1.1.9