Inventory Pointers

Inventory Pointers
There are two arrays set up as pointers to InventoryDef[] and WindowDef[] arrays, for the purpose of making modular functions that will be compatible with any window type. static InventoryDef*[6] InvPointer = { &Inventory[0][0]; &Crafting[0][0]; &Weapon; &Item; &Equipment; &Chest[0][0]; };

static WindowDef*[6] HudPointer = { &InventoryWindow; &CraftWindow; &WeaponWindow; &ItemWindow; &EquipmentWindow; &ChestWindow; }; The order is important - if adding windows, ensure that both the InventoryDef array and the WindowDef array are in the same index position for both pointers.

There is a list of defined names for usage in functions: WINDOW_NONE - 0 WINDOW_INVENTORY - 1 WINDOW_CRAFTING - 2 WINDOW_WEAPON - 3 WINDOW_EQUIPMENT - 4 WINDOW_ITEM - 5 WINDOW_CHEST - 6

Which is then called as Window-1.