Menu is updated in mainloop so it won't stay open (because noone updates it)
SVN-Revision: 5892
{
Menu* menu = Menu::current();
if(menu) {
- menu->update();
-
if(menu == game_menu.get()) {
switch (game_menu->check()) {
case MNID_CONTINUE:
int
Menu::check()
{
- if (hit_item != -1)
- return items[hit_item]->id;
+ if (hit_item != -1) {
+ int id = items[hit_item]->id;
+ hit_item = -1; //Clear event when checked out.. (we would end up in a loop when we try to leave "fake" submenu like Addons or Contrib)
+ return id;
+ }
else
return -1;
}
Scripting::update_debugger();
Scripting::TimeScheduler::instance->update(game_time);
current_screen->update(elapsed_time);
+ if (Menu::current() != NULL)
+ Menu::current()->update();
if(screen_fade.get() != NULL)
screen_fade->update(elapsed_time);
Console::instance->update(elapsed_time);
Menu* menu = Menu::current();
if(menu) {
- menu->update();
-
if(menu == main_menu.get()) {
switch (main_menu->check()) {
case MNID_STARTGAME:
if(!in_level) {
Menu* menu = Menu::current();
if(menu != NULL) {
- menu->update();
-
if(menu == worldmap_menu.get()) {
switch (worldmap_menu->check())
{