Keyboard/Controller input left direction bugfix. Using setter/getter for mouse navigation to handl storing of position whenever mouse navigation is called.
This commit is contained in:
+4
-1
@@ -23,13 +23,13 @@ enum MenuType{
|
||||
class Menu:IAttributable{
|
||||
friend class Crawler;
|
||||
friend class Player;
|
||||
static bool MOUSE_NAVIGATION;
|
||||
|
||||
float buttonHoldTime=0;
|
||||
std::map<int/*Y*/,std::vector<MenuComponent*>>buttons; //Buttons are stored in rows followed by their column order.
|
||||
std::map<int/*Y*/,std::vector<MenuComponent*>>keyboardButtons; //Button ordered storage for keyboard/menu
|
||||
std::vector<MenuComponent*>displayComponents; //Components that are only for displaying purposes.
|
||||
vi2d selection={-1,-1};
|
||||
vi2d lastActiveMousePos={};
|
||||
|
||||
MenuComponent*draggingComponent=nullptr;
|
||||
Renderable r,overlay;
|
||||
@@ -52,6 +52,8 @@ public:
|
||||
vf2d size; //Size in tiles (24x24), every menu will be tile-based
|
||||
|
||||
static Theme&GetCurrentTheme();
|
||||
bool UsingMouseNavigation();
|
||||
void SetMouseNavigation(bool mouseNavigation);
|
||||
|
||||
private:
|
||||
Menu(vf2d pos,vf2d size);
|
||||
@@ -76,6 +78,7 @@ private:
|
||||
bool HandleOutsideDisabledButtonSelection(MenuComponent*disabledButton);
|
||||
|
||||
Pixel GetRenderColor();
|
||||
static bool MOUSE_NAVIGATION;
|
||||
};
|
||||
|
||||
struct MenuFuncData{
|
||||
|
||||
Reference in New Issue
Block a user