Merge pull request #5262 from seanyeh/add-help-to-mp-lobby
Add help hotkey to mp lobby (fixes #4685)
This commit is contained in:
commit
a2dab95743
2 changed files with 12 additions and 0 deletions
|
@ -45,6 +45,7 @@
|
|||
#include "formula/string_utils.hpp"
|
||||
#include "preferences/game.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "help/help.hpp"
|
||||
#include "preferences/lobby.hpp"
|
||||
#include "playmp_controller.hpp"
|
||||
#include "wesnothd_connection.hpp"
|
||||
|
@ -171,6 +172,9 @@ mp_lobby::~mp_lobby()
|
|||
void mp_lobby::post_build(window& win)
|
||||
{
|
||||
/*** Local hotkeys. ***/
|
||||
win.register_hotkey(hotkey::HOTKEY_HELP,
|
||||
std::bind(&mp_lobby::show_help_callback, this));
|
||||
|
||||
win.register_hotkey(hotkey::HOTKEY_PREFERENCES,
|
||||
std::bind(&mp_lobby::show_preferences_button_callback, this, std::ref(win)));
|
||||
}
|
||||
|
@ -1042,6 +1046,12 @@ void mp_lobby::refresh_lobby()
|
|||
network_connection_.send_data(config("refresh_lobby"));
|
||||
}
|
||||
|
||||
void mp_lobby::show_help_callback()
|
||||
{
|
||||
help::help_manager help_manager(&game_config_);
|
||||
help::show_help();
|
||||
}
|
||||
|
||||
void mp_lobby::show_preferences_button_callback(window& window)
|
||||
{
|
||||
gui2::dialogs::preferences_dialog::display(game_config_);
|
||||
|
|
|
@ -136,6 +136,8 @@ private:
|
|||
/** Enter game by index, where index is the selected game listbox row. */
|
||||
void enter_selected_game(JOIN_MODE mode);
|
||||
|
||||
void show_help_callback();
|
||||
|
||||
void show_preferences_button_callback(window& window);
|
||||
|
||||
void show_server_info();
|
||||
|
|
Loading…
Add table
Reference in a new issue