Improve keyboard/controller-based menu navigation by separating each row into its own structure.
This commit is contained in:
+5
-2
@@ -10,8 +10,9 @@ class Menu{
|
||||
friend class Player;
|
||||
static bool MOUSE_NAVIGATION;
|
||||
static std::map<MenuType,Menu>menus;
|
||||
std::vector<MenuButton>buttons;
|
||||
int selection=-1;
|
||||
|
||||
std::map<int/*Y*/,std::vector<MenuButton>>buttons; //Buttons are stored in rows followed by their column order.
|
||||
vi2d selection={-1,-1};
|
||||
vf2d size; //Size in tiles (24x24), every menu will be tile-based
|
||||
public:
|
||||
Menu();
|
||||
@@ -26,5 +27,7 @@ private:
|
||||
void MenuSelect(Crawler*game);
|
||||
static const Menu InitializeTestMenu();
|
||||
static const Menu InitializeTestSubMenu();
|
||||
|
||||
void KeyboardButtonNavigation(Crawler*game);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user