the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 74 lines 2.7 kB view raw
1#pragma once 2 3#include "UIScene.h" 4#include "IUIScene_AbstractContainerMenu.h" 5 6class AbstractContainerMenu; 7 8class UIScene_AbstractContainerMenu : public UIScene, public virtual IUIScene_AbstractContainerMenu 9{ 10private: 11 ESceneSection m_focusSection; 12 bool m_bIgnoreInput; 13#ifdef _WINDOWS64 14 bool m_bMouseDragSlider; 15 bool m_bHasMousePosition; 16 int m_lastMouseX; 17 int m_lastMouseY; 18#endif 19 20protected: 21 UIControl m_controlMainPanel; 22 UIControl_SlotList m_slotListHotbar, m_slotListInventory; 23 UIControl_Cursor m_cursorPath; 24 UIControl_Label m_labelInventory, m_labelBrewingStand; 25 UIControl m_controlBackgroundPanel; 26 27 UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) 28 UI_MAP_ELEMENT( m_controlMainPanel, "MainPanel" ) 29 UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlMainPanel ) 30 UI_MAP_ELEMENT( m_controlBackgroundPanel, "BackgroundPanel" ) 31 UI_MAP_ELEMENT( m_slotListHotbar, "hotbarList") 32 UI_MAP_ELEMENT( m_slotListInventory, "inventoryList") 33 UI_MAP_ELEMENT( m_cursorPath, "cursor") 34 UI_MAP_ELEMENT( m_labelInventory, "inventoryLabel") 35 UI_END_MAP_CHILD_ELEMENTS() 36 UI_END_MAP_ELEMENTS_AND_NAMES() 37 38public: 39 UIScene_AbstractContainerMenu(int iPad, UILayer *parentLayer); 40 ~UIScene_AbstractContainerMenu(); 41 42 virtual void handleDestroy(); 43 44 int getPad() { return m_iPad; } 45 bool getIgnoreInput() { return m_bIgnoreInput; } 46 void setIgnoreInput(bool bVal) { m_bIgnoreInput=bVal; } 47 48protected: 49 virtual void PlatformInitialize(int iPad, int startIndex); 50 virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); 51 virtual bool doesSectionTreeHaveFocus(ESceneSection eSection) { return false; } 52 virtual void setSectionFocus(ESceneSection eSection, int iPad); 53 void setFocusToPointer(int iPad); 54 void SetPointerText(vector<HtmlString> *description, bool newSlot); 55 virtual shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot); 56 virtual Slot *getSlot(ESceneSection eSection, int iSlot); 57 virtual bool isSlotEmpty(ESceneSection eSection, int iSlot); 58 virtual void adjustPointerForSafeZone(); 59 60 virtual UIControl *getSection(ESceneSection eSection) { return NULL; } 61 virtual int GetBaseSlotCount() { return 0; } 62 63public: 64 virtual void tick(); 65 66 // 4J - TomK If update tooltips is called then make sure the correct parent is invoked! (both UIScene AND IUIScene_AbstractContainerMenu have an instance of said function!) 67 virtual void updateTooltips() { IUIScene_AbstractContainerMenu::UpdateTooltips(); } 68 69 virtual void render(S32 width, S32 height, C4JRender::eViewportType viewpBort); 70 virtual void customDraw(IggyCustomDrawCallbackRegion *region); 71 72 // INPUT 73 virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); 74};