fixing a bug that casued wesnoth to forget default wml hotkeys.
This commit is contained in:
parent
2fc2f875e7
commit
9e7ac8b50e
1 changed files with 9 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "../hotkeys.hpp"
|
||||
#include "../log.hpp"
|
||||
#include "../play_controller.hpp"
|
||||
#include "../preferences.hpp"
|
||||
#include "../reports.hpp"
|
||||
#include "../resources.hpp"
|
||||
#include "../scripting/lua.hpp"
|
||||
|
@ -186,6 +187,7 @@ void add_wmi_change(const std::string & id, const config & new_command)
|
|||
/** Handles all the different types of actions that can be triggered by an event. */
|
||||
void commit_wmi_commands()
|
||||
{
|
||||
bool hotkeys_changed = false;
|
||||
// Commit WML Menu Item command changes
|
||||
while(wmi_command_changes.size() > 0) {
|
||||
wmi_command_change wcc = wmi_command_changes.front();
|
||||
|
@ -213,6 +215,9 @@ void commit_wmi_commands()
|
|||
add_event_handler(*wcc.second, true);
|
||||
if(item.use_hotkey()) {
|
||||
hotkey::add_wml_hotkey(play_controller::wml_menu_hotkey_prefix + wcc.first, item.description(), item.default_hotkey());
|
||||
if(!item.default_hotkey().empty()) {
|
||||
hotkeys_changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,6 +225,10 @@ void commit_wmi_commands()
|
|||
delete wcc.second;
|
||||
wmi_command_changes.erase(wmi_command_changes.begin());
|
||||
}
|
||||
if(hotkeys_changed)
|
||||
{
|
||||
preferences::save_hotkeys();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue