mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 16:01:17 +00:00
Exported event finalization.
This commit is contained in:
parent
e6a47f2353
commit
08caebe6de
@ -3864,6 +3864,19 @@ namespace game_events {
|
||||
}
|
||||
}
|
||||
|
||||
void commit()
|
||||
{
|
||||
if(pump_manager::count() == 1) {
|
||||
commit_wmi_commands();
|
||||
commit_new_handlers();
|
||||
}
|
||||
// Dialogs can only be shown if the display is not locked
|
||||
if (!resources::screen->video().update_locked()) {
|
||||
show_wml_errors();
|
||||
show_wml_messages();
|
||||
}
|
||||
}
|
||||
|
||||
bool pump()
|
||||
{
|
||||
assert(manager_running);
|
||||
@ -3917,17 +3930,9 @@ namespace game_events {
|
||||
if(process_event(handler, ev))
|
||||
result = true;
|
||||
}
|
||||
if(pump_manager::count() == 1) {
|
||||
// only commit new event handlers when finished iterating over event_handlers
|
||||
commit_wmi_commands();
|
||||
commit_new_handlers();
|
||||
}
|
||||
|
||||
// Dialogs can only be shown if the display is not locked
|
||||
if (!resources::screen->video().update_locked()) {
|
||||
show_wml_errors();
|
||||
show_wml_messages();
|
||||
}
|
||||
// Only commit new handlers when finished iterating over event_handlers.
|
||||
commit();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -182,6 +182,12 @@ namespace game_events
|
||||
|
||||
bool conditional_passed(const unit_map* units,
|
||||
const vconfig cond, bool backwards_compat=true);
|
||||
|
||||
/**
|
||||
* Handles newly-created handlers. Flushes WML messages and errors.
|
||||
*/
|
||||
void commit();
|
||||
|
||||
bool pump();
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user