use the same scope trick to kill the dialog before scrolling...

...as used for unit list maybe later remove these {} if show() is
improved to unrender automaticaly
This commit is contained in:
Ali El Gariani 2007-07-06 20:05:24 +00:00
parent ef90332813
commit bf52254eb9

View file

@ -371,7 +371,7 @@ namespace events{
umenu.set_menu(items, &sorter);
umenu.add_pane(&unit_preview);
selected = umenu.show();
}
} // this will kill the dialog before scrolling
if(selected >= 0 && selected < int(locations_list.size())) {
const gamemap::location& loc = locations_list[selected];
@ -462,10 +462,14 @@ namespace events{
items.push_back(str.str());
}
gui::dialog slist(*gui_, "", "", gui::OK_ONLY);
slist.set_menu(items, &sorter);
const int res = slist.show();
gui_->scroll_to_leader(units_, res+1);
int selected = 0;
{
gui::dialog slist(*gui_, "", "", gui::OK_ONLY);
slist.set_menu(items, &sorter);
selected = slist.show();
} // this will kill the dialog before scrolling
gui_->scroll_to_leader(units_, selected+1);
}
void menu_handler::save_game(const std::string& message, gui::DIALOG_TYPE dialog_type,