2026-03-01 12:16:08 +08:00
# pragma once
# include "UIScene.h"
# include "IUIScene_AbstractContainerMenu.h"
class AbstractContainerMenu ;
class UIScene_AbstractContainerMenu : public UIScene , public virtual IUIScene_AbstractContainerMenu
{
private :
ESceneSection m_focusSection ;
bool m_bIgnoreInput ;
2026-03-02 00:04:54 +08:00
# ifdef _WINDOWS64
bool m_bMouseDragSlider ;
2026-03-03 04:02:35 +08:00
bool m_bHasMousePosition ;
int m_lastMouseX ;
int m_lastMouseY ;
2026-03-02 00:04:54 +08:00
# endif
2026-03-01 12:16:08 +08:00
protected :
UIControl m_controlMainPanel ;
UIControl_SlotList m_slotListHotbar , m_slotListInventory ;
UIControl_Cursor m_cursorPath ;
UIControl_Label m_labelInventory , m_labelBrewingStand ;
UIControl m_controlBackgroundPanel ;
UI_BEGIN_MAP_ELEMENTS_AND_NAMES ( UIScene )
UI_MAP_ELEMENT ( m_controlMainPanel , " MainPanel " )
UI_BEGIN_MAP_CHILD_ELEMENTS ( m_controlMainPanel )
UI_MAP_ELEMENT ( m_controlBackgroundPanel , " BackgroundPanel " )
UI_MAP_ELEMENT ( m_slotListHotbar , " hotbarList " )
UI_MAP_ELEMENT ( m_slotListInventory , " inventoryList " )
UI_MAP_ELEMENT ( m_cursorPath , " cursor " )
UI_MAP_ELEMENT ( m_labelInventory , " inventoryLabel " )
UI_END_MAP_CHILD_ELEMENTS ( )
UI_END_MAP_ELEMENTS_AND_NAMES ( )
2026-03-02 17:37:16 +07:00
2026-03-01 12:16:08 +08:00
public :
UIScene_AbstractContainerMenu ( int iPad , UILayer * parentLayer ) ;
~ UIScene_AbstractContainerMenu ( ) ;
virtual void handleDestroy ( ) ;
int getPad ( ) { return m_iPad ; }
bool getIgnoreInput ( ) { return m_bIgnoreInput ; }
void setIgnoreInput ( bool bVal ) { m_bIgnoreInput = bVal ; }
protected :
virtual void PlatformInitialize ( int iPad , int startIndex ) ;
virtual void InitDataAssociations ( int iPad , AbstractContainerMenu * menu , int startIndex = 0 ) ;
virtual bool doesSectionTreeHaveFocus ( ESceneSection eSection ) { return false ; }
virtual void setSectionFocus ( ESceneSection eSection , int iPad ) ;
void setFocusToPointer ( int iPad ) ;
2026-03-03 03:04:10 +08:00
void SetPointerText ( vector < HtmlString > * description , bool newSlot ) ;
2026-03-02 17:37:16 +07:00
virtual shared_ptr < ItemInstance > getSlotItem ( ESceneSection eSection , int iSlot ) ;
2026-03-03 03:04:10 +08:00
virtual Slot * getSlot ( ESceneSection eSection , int iSlot ) ;
2026-03-01 12:16:08 +08:00
virtual bool isSlotEmpty ( ESceneSection eSection , int iSlot ) ;
virtual void adjustPointerForSafeZone ( ) ;
virtual UIControl * getSection ( ESceneSection eSection ) { return NULL ; }
2026-03-03 03:04:10 +08:00
virtual int GetBaseSlotCount ( ) { return 0 ; }
2026-03-01 12:16:08 +08:00
public :
virtual void tick ( ) ;
2026-03-03 03:04:10 +08:00
// 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!)
virtual void updateTooltips ( ) { IUIScene_AbstractContainerMenu : : UpdateTooltips ( ) ; }
2026-03-02 17:37:16 +07:00
2026-03-01 12:16:08 +08:00
virtual void render ( S32 width , S32 height , C4JRender : : eViewportType viewpBort ) ;
virtual void customDraw ( IggyCustomDrawCallbackRegion * region ) ;
// INPUT
virtual void handleInput ( int iPad , int key , bool repeat , bool pressed , bool released , bool & handled ) ;
} ;