Add help hotkey to mp lobby

This commit is contained in:
Sean Yeh 2020-11-05 20:43:51 -06:00
parent 1cdc4ef530
commit bc5849844b
2 changed files with 12 additions and 0 deletions

View file

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

View file

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