Skip to content

Commit

Permalink
Fixed hotkey prefs being lost after installing addons (fixes #2532)
Browse files Browse the repository at this point in the history
The problem was that game_config_manager::init_game_config was called (via reload_changed_game_config)
after an addon was installed, which loaded the standard game-defined hotkeys. The loading of hotkey
preferences was relegated to the main game loop (do_gameloop). However, that loop wasn't entered again
when installing addons, since technically you never left the titlescreen, so the default hotkeys were
being re-loaded but not the prefs one.

I've moved loading of both to the same place to prevent any further issues.
  • Loading branch information
Vultraz committed Feb 21, 2018
1 parent 0b87383 commit 2523493
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/game_config_manager.cpp
Expand Up @@ -93,7 +93,10 @@ bool game_config_manager::init_game_config(FORCE_RELOAD_CONFIG force_reload)
hotkey::deactivate_all_scopes();
hotkey::set_scope_active(hotkey::SCOPE_MAIN_MENU);

// Load the standard hotkeys, then apply any player customizations.
hotkey::load_hotkeys(game_config(), true);
//preferences::load_hotkeys();

::init_textdomains(game_config());
about::set_about(game_config());
ai::configuration::init(game_config());
Expand Down
2 changes: 0 additions & 2 deletions src/wesnoth.cpp
Expand Up @@ -828,8 +828,6 @@ static int do_gameloop(const std::vector<std::string>& args)
return 0;
}

preferences::load_hotkeys();

const font::floating_label_context label_manager;

cursor::set(cursor::NORMAL);
Expand Down

1 comment on commit 2523493

@Vultraz
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix actually uncommented in c40c074 ....

Please sign in to comment.