Exported event finalization.

This commit is contained in:
Guillaume Melquiond 2009-08-15 07:59:59 +00:00
parent e6a47f2353
commit 08caebe6de
2 changed files with 21 additions and 10 deletions

View File

@ -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;

View File

@ -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();
/**