@ -141,7 +141,6 @@ class Menu:public IAttributable{
friend class EntityStats ;
friend class EntityStats ;
float buttonHoldTime = 0 ;
float buttonHoldTime = 0 ;
std : : weak_ptr < MenuComponent > selection ;
vi2d lastActiveMousePos = { } ;
vi2d lastActiveMousePos = { } ;
int componentCount = 0 ;
int componentCount = 0 ;
@ -217,12 +216,11 @@ public:
static Renderable & GetPatchPart ( int x , int y ) ;
static Renderable & GetPatchPart ( int x , int y ) ;
void RecalculateComponentCount ( ) ;
void RecalculateComponentCount ( ) ;
void SetDefaultButt on ( std : : weak_ptr < MenuComponent > button ) ;
void SetSelecti on ( std : : string_view button ) ;
void SetSelection ( std : : weak_ptr < MenuComponent > button ) ;
void SetSelection ( std : : weak_ptr < MenuComponent > button ) ;
const std : : weak_ptr < MenuComponent > GetSelection ( ) const ;
const std : : weak_ptr < MenuComponent > GetSelection ( ) const ;
private :
private :
Menu ( vf2d pos , vf2d size ) ;
Menu ( vf2d pos , vf2d size ) ;
std : : weak_ptr < MenuComponent > defaultButton ;
static MenuType lastMenuTypeCreated ;
static MenuType lastMenuTypeCreated ;
static std : : string lastRegisteredComponent ;
static std : : string lastRegisteredComponent ;
void HoverMenuSelect ( AiL * game ) ;
void HoverMenuSelect ( AiL * game ) ;
@ -231,7 +229,7 @@ private:
//Mandatory before any menu operations! This creates and sets up the menu in memory.
//Mandatory before any menu operations! This creates and sets up the menu in memory.
static Menu * CreateMenu ( MenuType type , vf2d pos , vf2d size ) ;
static Menu * CreateMenu ( MenuType type , vf2d pos , vf2d size ) ;
void SetupKeyboardNavigation ( MenuInputGroups inputGroups , ButtonNavigationGroups navigationGroups ) ;
void SetupKeyboardNavigation ( MenuDataFunc onOpen , Menu InputGroups inputGroups , ButtonNavigationGroups navigationGroups ) ;
void KeyboardButtonNavigation ( AiL * game , vf2d menuPos ) ;
void KeyboardButtonNavigation ( AiL * game , vf2d menuPos ) ;
static void DrawScaledWindowBackground ( AiL * game , vf2d menuPos , vf2d size , Pixel renderColor ) ;
static void DrawScaledWindowBackground ( AiL * game , vf2d menuPos , vf2d size , Pixel renderColor ) ;
static void DrawTiledWindowBackground ( AiL * game , vf2d menuPos , vf2d size , Pixel renderColor ) ;
static void DrawTiledWindowBackground ( AiL * game , vf2d menuPos , vf2d size , Pixel renderColor ) ;
@ -245,6 +243,7 @@ private:
MenuType type ;
MenuType type ;
MenuInputGroups inputGroups ;
MenuInputGroups inputGroups ;
ButtonNavigationGroups navigationGroups ;
ButtonNavigationGroups navigationGroups ;
MenuOpenFunc onOpenFunc ;
static bool MOUSE_NAVIGATION ;
static bool MOUSE_NAVIGATION ;
bool cover ; //A black cover for when a menu pops up to fade out the stuff behind it.
bool cover ; //A black cover for when a menu pops up to fade out the stuff behind it.