arrange_left(),
active_item()
{
+ MenuManager::instance().m_all_menus.push_back(this);
+
hit_item = -1;
menuaction = MENU_ACTION_NONE;
delete_character = 0;
Menu::~Menu()
{
+ MenuManager::instance().m_all_menus.remove(this);
+
+ if (MenuManager::instance().current() == this)
+ MenuManager::instance().m_current = nullptr;
+
+ if (MenuManager::instance().get_previous() == this)
+ MenuManager::instance().m_previous = nullptr;
}
void
effect_progress = 1.0f;
if (close) {
- MenuManager::instance().current(0);
+ MenuManager::instance().m_current = 0;
close = false;
}
}
public:
std::vector<Menu*> m_last_menus;
- std::vector<Menu*> m_all_menus;
+ std::list<Menu*> m_all_menus;
+ /** Used only for transition effects */
Menu* m_previous;
+
Menu* m_current;
+ friend class Menu;
+
public:
MenuManager();
~MenuManager();
return m_current;
}
-
- /** Return the current active menu or NULL if none is active */
- void current(Menu* menu)
- {
- m_current = menu;
- }
-
private:
MenuManager(const MenuManager&);
MenuManager& operator=(const MenuManager&);