wesnoth/wesnoth — pull request #355 by cbeck88 (2014-12-31 01:12:20+00:00)
Title: initialize wml menu item handlers when they are set, not in ctor

Don't merge yet, needs more testing...

this commit causes wml menu items to have their events registered
not during construction but only when "init_handler" is called.
it refactors the wmi_container object to do this when it
constructs new items via the [set_menu_item] path.

this is necessary because the items might be constructed before
the event queue even exists, and we want them to be able to
persist and be reactivated when a new campaign scenario starts.

more testing is necessary to determine if all code paths, including
carryover and reloading, are still working after this commit, and
the earlier commit 6fc1ac1bb224cddec5ccbb7f7865b69b1b093a01

See also discussion of bug #23115.