the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 45 lines 1.5 kB view raw
1#pragma once 2 3#include "AbstractContainerMenu.h" 4 5class CraftingContainer; 6class Container; 7 8class InventoryMenu : public AbstractContainerMenu 9{ 10private: 11 Player *owner; 12 13 // 4J Stu Made these public for UI menus, perhaps should make friend class? 14public: 15 static const int RESULT_SLOT; 16 static const int CRAFT_SLOT_START; 17 static const int CRAFT_SLOT_END; 18 static const int ARMOR_SLOT_START; 19 static const int ARMOR_SLOT_END; 20 static const int INV_SLOT_START; 21 static const int INV_SLOT_END; 22 static const int USE_ROW_SLOT_START; 23 static const int USE_ROW_SLOT_END; 24 25public: 26 shared_ptr<CraftingContainer> craftSlots; 27 shared_ptr<Container> resultSlots; 28 bool active; 29 30 InventoryMenu(shared_ptr<Inventory> inventory, bool active, Player *player); 31 32private: 33 void _init(shared_ptr<Inventory> inventory, bool active); 34 35public: 36 virtual void slotsChanged(); // 4J used to take a shared_ptr<Container> but wasn't using it, so removed to simplify things 37 virtual void removed(shared_ptr<Player> player); 38 virtual bool stillValid(shared_ptr<Player> player); 39 virtual shared_ptr<ItemInstance> quickMoveStack(shared_ptr<Player> player, int slotIndex); 40 virtual bool mayCombine(Slot *slot, shared_ptr<ItemInstance> item); 41 virtual bool canTakeItemForPickAll(shared_ptr<ItemInstance> carried, Slot *target); 42 43 // 4J ADDED, 44 virtual shared_ptr<ItemInstance> clicked(int slotIndex, int buttonNum, int clickType, shared_ptr<Player> player, bool looped = false); 45};