mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 17:37:54 +00:00
Change default action of delete/dismiss buttons when deleting the last item.
Now stop closing the dialog, because it may have other functions even with no items, and this also prevent closing when using filtered view only showing the item(s) to delete (which is much more common, who delete/dismiss everything?)
This commit is contained in:
parent
c59e1f5a7d
commit
2226e84d88
@ -814,12 +814,14 @@ void dialog::action(dialog_process_info& info)
|
||||
if(selection >= 0) {
|
||||
menu_ref.erase_item(selection);
|
||||
}
|
||||
if(menu_ref.nitems() == 0) {
|
||||
set_result(CLOSE_DIALOG);
|
||||
} else {
|
||||
set_result(CONTINUE_DIALOG);
|
||||
info.first_time = true;
|
||||
}
|
||||
// was used before to auto close empty menu
|
||||
//if(menu_ref.nitems() == 0) {
|
||||
// set_result(CLOSE_DIALOG);
|
||||
//} else {
|
||||
|
||||
set_result(CONTINUE_DIALOG);
|
||||
info.first_time = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user