MP Lobby: rename class for better consistency with other dialogs
This commit is contained in:
parent
8675bbbe89
commit
70f827415b
5 changed files with 72 additions and 72 deletions
|
@ -643,7 +643,7 @@
|
|||
#enddef
|
||||
|
||||
[window]
|
||||
id = "lobby_main"
|
||||
id = "mp_lobby"
|
||||
description = "Lobby screen."
|
||||
[resolution]
|
||||
window_width, window_height = 800, 660
|
||||
|
|
|
@ -488,13 +488,13 @@ static void enter_lobby_mode(CVideo& video, const config& game_config,
|
|||
}
|
||||
mp::lobby_info li(game_config, installed_addons);
|
||||
|
||||
gui2::dialogs::lobby_main dlg(game_config, li, *connection);
|
||||
gui2::dialogs::mp_lobby dlg(game_config, li, *connection);
|
||||
dlg.set_preferences_callback(std::bind(do_preferences_dialog, std::ref(video), std::ref(game_config)));
|
||||
dlg.show(video);
|
||||
|
||||
//ugly kludge for launching other dialogs like the old lobby
|
||||
switch(dlg.get_retval()) {
|
||||
case gui2::dialogs::lobby_main::CREATE:
|
||||
case gui2::dialogs::mp_lobby::CREATE:
|
||||
try {
|
||||
enter_create_mode(video, game_config, state, connection, li, false);
|
||||
} catch(config::error& error) {
|
||||
|
@ -505,12 +505,12 @@ static void enter_lobby_mode(CVideo& video, const config& game_config,
|
|||
}
|
||||
|
||||
break;
|
||||
case gui2::dialogs::lobby_main::JOIN:
|
||||
case gui2::dialogs::lobby_main::OBSERVE:
|
||||
case gui2::dialogs::mp_lobby::JOIN:
|
||||
case gui2::dialogs::mp_lobby::OBSERVE:
|
||||
try {
|
||||
enter_wait_mode(video, game_config, state, connection, li,
|
||||
dlg.get_joined_game_id(),
|
||||
dlg.get_retval() == gui2::dialogs::lobby_main::OBSERVE);
|
||||
dlg.get_retval() == gui2::dialogs::mp_lobby::OBSERVE);
|
||||
} catch(config::error& error) {
|
||||
if(!error.message.empty()) {
|
||||
gui2::show_error_message(video, error.message);
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace gui2
|
|||
namespace dialogs
|
||||
{
|
||||
|
||||
REGISTER_DIALOG(lobby_main)
|
||||
REGISTER_DIALOG(mp_lobby)
|
||||
|
||||
void sub_player_list::init(window& w, const std::string& lbl, const bool unfolded)
|
||||
{
|
||||
|
@ -119,13 +119,13 @@ void player_list::update_sort_icons()
|
|||
sort_by_relation->set_icon_name(sort_by_relation->get_value() ? "lobby/sort-friend.png" : "lobby/sort-friend-off.png");
|
||||
}
|
||||
|
||||
bool lobby_main::logout_prompt()
|
||||
bool mp_lobby::logout_prompt()
|
||||
{
|
||||
return show_prompt(_("Do you really want to log out?"));
|
||||
}
|
||||
|
||||
lobby_main::lobby_main(const config& game_config, mp::lobby_info& info, wesnothd_connection &connection)
|
||||
: quit_confirmation(&lobby_main::logout_prompt)
|
||||
mp_lobby::mp_lobby(const config& game_config, mp::lobby_info& info, wesnothd_connection &connection)
|
||||
: quit_confirmation(&mp_lobby::logout_prompt)
|
||||
, game_config_(game_config)
|
||||
, gamelistbox_(nullptr)
|
||||
, window_(nullptr)
|
||||
|
@ -155,7 +155,7 @@ lobby_main::lobby_main(const config& game_config, mp::lobby_info& info, wesnothd
|
|||
|
||||
struct lobby_delay_gamelist_update_guard
|
||||
{
|
||||
lobby_delay_gamelist_update_guard(lobby_main& l) : l(l)
|
||||
lobby_delay_gamelist_update_guard(mp_lobby& l) : l(l)
|
||||
{
|
||||
l.delay_gamelist_update_ = true;
|
||||
}
|
||||
|
@ -163,10 +163,10 @@ struct lobby_delay_gamelist_update_guard
|
|||
{
|
||||
l.delay_gamelist_update_ = false;
|
||||
}
|
||||
lobby_main& l;
|
||||
mp_lobby& l;
|
||||
};
|
||||
|
||||
lobby_main::~lobby_main()
|
||||
mp_lobby::~mp_lobby()
|
||||
{
|
||||
if(lobby_update_timer_) {
|
||||
remove_timer(lobby_update_timer_);
|
||||
|
@ -179,7 +179,7 @@ static bool fullscreen(CVideo& video)
|
|||
return true;
|
||||
}
|
||||
|
||||
void lobby_main::post_build(window& win)
|
||||
void mp_lobby::post_build(window& win)
|
||||
{
|
||||
/** @todo Should become a global hotkey after 1.8, then remove it here. */
|
||||
win.register_hotkey(hotkey::HOTKEY_FULLSCREEN, std::bind(fullscreen, std::ref(win.video())));
|
||||
|
@ -251,7 +251,7 @@ std::string colorize(const std::string& str, const std::string& color)
|
|||
|
||||
} // end anonymous namespace
|
||||
|
||||
void lobby_main::update_gamelist()
|
||||
void mp_lobby::update_gamelist()
|
||||
{
|
||||
SCOPE_LB;
|
||||
gamelistbox_->clear();
|
||||
|
@ -286,7 +286,7 @@ void lobby_main::update_gamelist()
|
|||
gamelistbox_->set_row_shown(lobby_info_.games_visibility());
|
||||
}
|
||||
|
||||
void lobby_main::update_gamelist_diff()
|
||||
void mp_lobby::update_gamelist_diff()
|
||||
{
|
||||
SCOPE_LB;
|
||||
lobby_info_.make_games_vector();
|
||||
|
@ -386,7 +386,7 @@ void lobby_main::update_gamelist_diff()
|
|||
gamelistbox_->set_row_shown(lobby_info_.games_visibility());
|
||||
}
|
||||
|
||||
void lobby_main::update_gamelist_header()
|
||||
void mp_lobby::update_gamelist_header()
|
||||
{
|
||||
#ifndef GUI2_EXPERIMENTAL_LISTBOX
|
||||
const std::string games_string = vgettext("Games: showing $num_shown out of $num_total", {
|
||||
|
@ -398,7 +398,7 @@ void lobby_main::update_gamelist_header()
|
|||
#endif
|
||||
}
|
||||
|
||||
std::map<std::string, string_map> lobby_main::make_game_row_data(const mp::game_info& game)
|
||||
std::map<std::string, string_map> mp_lobby::make_game_row_data(const mp::game_info& game)
|
||||
{
|
||||
std::map<std::string, string_map> data;
|
||||
|
||||
|
@ -449,7 +449,7 @@ std::map<std::string, string_map> lobby_main::make_game_row_data(const mp::game_
|
|||
return data;
|
||||
}
|
||||
|
||||
void lobby_main::adjust_game_row_contents(const mp::game_info& game,
|
||||
void mp_lobby::adjust_game_row_contents(const mp::game_info& game,
|
||||
int idx,
|
||||
grid* grid)
|
||||
{
|
||||
|
@ -459,7 +459,7 @@ void lobby_main::adjust_game_row_contents(const mp::game_info& game,
|
|||
toggle_panel& row_panel = find_widget<toggle_panel>(grid, "panel", false);
|
||||
|
||||
row_panel.set_callback_mouse_left_double_click(
|
||||
std::bind(&lobby_main::join_or_observe, this, idx));
|
||||
std::bind(&mp_lobby::join_or_observe, this, idx));
|
||||
|
||||
set_visible_if_exists(grid, "time_limit_icon", !game.time_limit.empty());
|
||||
set_visible_if_exists(grid, "vision_fog", game.fog);
|
||||
|
@ -478,7 +478,7 @@ void lobby_main::adjust_game_row_contents(const mp::game_info& game,
|
|||
if(button* join_button = dynamic_cast<button*>(grid->find("join", false))) {
|
||||
connect_signal_mouse_left_click(
|
||||
*join_button,
|
||||
std::bind(&lobby_main::join_global_button_callback,
|
||||
std::bind(&mp_lobby::join_global_button_callback,
|
||||
this,
|
||||
std::ref(*window_)));
|
||||
join_button->set_active(game.can_join());
|
||||
|
@ -487,7 +487,7 @@ void lobby_main::adjust_game_row_contents(const mp::game_info& game,
|
|||
if(button* observe_button = dynamic_cast<button*>(grid->find("observe", false))) {
|
||||
connect_signal_mouse_left_click(
|
||||
*observe_button,
|
||||
std::bind(&lobby_main::observe_global_button_callback,
|
||||
std::bind(&mp_lobby::observe_global_button_callback,
|
||||
this,
|
||||
std::ref(*window_)));
|
||||
observe_button->set_active(game.can_observe());
|
||||
|
@ -499,9 +499,9 @@ void lobby_main::adjust_game_row_contents(const mp::game_info& game,
|
|||
}
|
||||
}
|
||||
|
||||
void lobby_main::update_gamelist_filter()
|
||||
void mp_lobby::update_gamelist_filter()
|
||||
{
|
||||
DBG_LB << "lobby_main::update_gamelist_filter\n";
|
||||
DBG_LB << "mp_lobby::update_gamelist_filter\n";
|
||||
lobby_info_.apply_game_filter();
|
||||
DBG_LB << "Games in lobby_info: " << lobby_info_.games().size()
|
||||
<< ", games in listbox: " << gamelistbox_->get_item_count() << "\n";
|
||||
|
@ -511,7 +511,7 @@ void lobby_main::update_gamelist_filter()
|
|||
update_gamelist_header();
|
||||
}
|
||||
|
||||
void lobby_main::update_playerlist()
|
||||
void mp_lobby::update_playerlist()
|
||||
{
|
||||
if(delay_playerlist_update_) {
|
||||
return;
|
||||
|
@ -623,7 +623,7 @@ void lobby_main::update_playerlist()
|
|||
tree_view_node& player = target_list->tree->add_child("player", tree_group_item);
|
||||
|
||||
find_widget<toggle_panel>(&player, "tree_view_node_label", false)
|
||||
.set_callback_mouse_left_double_click(std::bind(&lobby_main::user_dialog_callback, this, userptr));
|
||||
.set_callback_mouse_left_double_click(std::bind(&mp_lobby::user_dialog_callback, this, userptr));
|
||||
}
|
||||
|
||||
player_list_.active_game.update_player_count_label();
|
||||
|
@ -634,7 +634,7 @@ void lobby_main::update_playerlist()
|
|||
player_list_dirty_ = false;
|
||||
}
|
||||
|
||||
void lobby_main::update_selected_game()
|
||||
void mp_lobby::update_selected_game()
|
||||
{
|
||||
const int idx = gamelistbox_->get_selected_row();
|
||||
bool can_join = false, can_observe = false;
|
||||
|
@ -654,7 +654,7 @@ void lobby_main::update_selected_game()
|
|||
player_list_dirty_ = true;
|
||||
}
|
||||
|
||||
bool lobby_main::exit_hook(window& window)
|
||||
bool mp_lobby::exit_hook(window& window)
|
||||
{
|
||||
if(window.get_retval() == window::CANCEL) {
|
||||
return quit();
|
||||
|
@ -663,7 +663,7 @@ bool lobby_main::exit_hook(window& window)
|
|||
return true;
|
||||
}
|
||||
|
||||
void lobby_main::pre_show(window& window)
|
||||
void mp_lobby::pre_show(window& window)
|
||||
{
|
||||
SCOPE_LB;
|
||||
|
||||
|
@ -671,10 +671,10 @@ void lobby_main::pre_show(window& window)
|
|||
#ifdef GUI2_EXPERIMENTAL_LISTBOX
|
||||
connect_signal_notify_modified(
|
||||
*gamelistbox_,
|
||||
std::bind(&lobby_main::gamelist_change_callback, *this, std::ref(window)));
|
||||
std::bind(&mp_lobby::gamelist_change_callback, *this, std::ref(window)));
|
||||
#else
|
||||
gamelistbox_->set_callback_value_change(
|
||||
dialog_callback<lobby_main, &lobby_main::gamelist_change_callback>);
|
||||
dialog_callback<mp_lobby, &mp_lobby::gamelist_change_callback>);
|
||||
#endif
|
||||
|
||||
window.keyboard_capture(gamelistbox_);
|
||||
|
@ -686,14 +686,14 @@ void lobby_main::pre_show(window& window)
|
|||
player_list_.update_sort_icons();
|
||||
|
||||
player_list_.sort_by_name->set_callback_state_change(
|
||||
std::bind(&lobby_main::player_filter_callback, this, _1));
|
||||
std::bind(&mp_lobby::player_filter_callback, this, _1));
|
||||
player_list_.sort_by_relation->set_callback_state_change(
|
||||
std::bind(&lobby_main::player_filter_callback, this, _1));
|
||||
std::bind(&mp_lobby::player_filter_callback, this, _1));
|
||||
|
||||
window.set_enter_disabled(true);
|
||||
|
||||
// Exit hook to add a confirmation when quitting the Lobby.
|
||||
window.set_exit_hook(std::bind(&lobby_main::exit_hook, this, std::ref(window)));
|
||||
window.set_exit_hook(std::bind(&mp_lobby::exit_hook, this, std::ref(window)));
|
||||
|
||||
window_ = &window;
|
||||
|
||||
|
@ -706,21 +706,21 @@ void lobby_main::pre_show(window& window)
|
|||
|
||||
connect_signal_mouse_left_click(
|
||||
find_widget<button>(&window, "refresh", false),
|
||||
std::bind(&lobby_main::refresh_button_callback, this, std::ref(window)));
|
||||
std::bind(&mp_lobby::refresh_button_callback, this, std::ref(window)));
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
find_widget<button>(&window, "show_preferences", false),
|
||||
std::bind(&lobby_main::show_preferences_button_callback, this, std::ref(window)));
|
||||
std::bind(&mp_lobby::show_preferences_button_callback, this, std::ref(window)));
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
find_widget<button>(&window, "join_global", false),
|
||||
std::bind(&lobby_main::join_global_button_callback, this, std::ref(window)));
|
||||
std::bind(&mp_lobby::join_global_button_callback, this, std::ref(window)));
|
||||
|
||||
find_widget<button>(&window, "join_global", false).set_active(false);
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
find_widget<button>(&window, "observe_global", false),
|
||||
std::bind(&lobby_main::observe_global_button_callback, this, std::ref(window)));
|
||||
std::bind(&mp_lobby::observe_global_button_callback, this, std::ref(window)));
|
||||
|
||||
find_widget<button>(&window, "observe_global", false).set_active(false);
|
||||
|
||||
|
@ -735,7 +735,7 @@ void lobby_main::pre_show(window& window)
|
|||
}
|
||||
|
||||
replay_options.connect_click_handler(
|
||||
std::bind(&lobby_main::skip_replay_changed_callback, this, std::ref(window)));
|
||||
std::bind(&mp_lobby::skip_replay_changed_callback, this, std::ref(window)));
|
||||
|
||||
filter_friends_ = find_widget<toggle_button>(&window, "filter_with_friends", false, true);
|
||||
filter_ignored_ = find_widget<toggle_button>(&window, "filter_without_ignored", false, true);
|
||||
|
@ -744,25 +744,25 @@ void lobby_main::pre_show(window& window)
|
|||
filter_text_ = find_widget<text_box>(&window, "filter_text", false, true);
|
||||
|
||||
filter_friends_->set_callback_state_change(
|
||||
std::bind(&lobby_main::game_filter_change_callback, this, _1));
|
||||
std::bind(&mp_lobby::game_filter_change_callback, this, _1));
|
||||
filter_ignored_->set_callback_state_change(
|
||||
std::bind(&lobby_main::game_filter_change_callback, this, _1));
|
||||
std::bind(&mp_lobby::game_filter_change_callback, this, _1));
|
||||
filter_slots_->set_callback_state_change(
|
||||
std::bind(&lobby_main::game_filter_change_callback, this, _1));
|
||||
std::bind(&mp_lobby::game_filter_change_callback, this, _1));
|
||||
filter_invert_->set_callback_state_change(
|
||||
std::bind(&lobby_main::game_filter_change_callback, this, _1));
|
||||
std::bind(&mp_lobby::game_filter_change_callback, this, _1));
|
||||
connect_signal_pre_key_press(
|
||||
*filter_text_,
|
||||
std::bind(&lobby_main::game_filter_keypress_callback, this, _5));
|
||||
std::bind(&mp_lobby::game_filter_keypress_callback, this, _5));
|
||||
|
||||
chatbox_->room_window_open("lobby", true, false);
|
||||
chatbox_->active_window_changed();
|
||||
game_filter_reload();
|
||||
|
||||
// Force first update to be directly.
|
||||
lobby_main::network_handler();
|
||||
mp_lobby::network_handler();
|
||||
lobby_update_timer_ = add_timer(
|
||||
game_config::lobby_network_timer, std::bind(&lobby_main::network_handler, this), true);
|
||||
game_config::lobby_network_timer, std::bind(&mp_lobby::network_handler, this), true);
|
||||
|
||||
// Set up Lua plugin context
|
||||
plugins_context_.reset(new plugins_context("Multiplayer Lobby"));
|
||||
|
@ -791,7 +791,7 @@ void lobby_main::pre_show(window& window)
|
|||
plugins_context_->set_accessor("game_config", [this](const config&) { return game_config_; });
|
||||
}
|
||||
|
||||
void lobby_main::post_show(window& /*window*/)
|
||||
void mp_lobby::post_show(window& /*window*/)
|
||||
{
|
||||
window_ = nullptr;
|
||||
remove_timer(lobby_update_timer_);
|
||||
|
@ -799,7 +799,7 @@ void lobby_main::post_show(window& /*window*/)
|
|||
plugins_context_.reset();
|
||||
}
|
||||
|
||||
void lobby_main::network_handler()
|
||||
void mp_lobby::network_handler()
|
||||
{
|
||||
try {
|
||||
config data;
|
||||
|
@ -826,7 +826,7 @@ void lobby_main::network_handler()
|
|||
}
|
||||
}
|
||||
|
||||
void lobby_main::process_network_data(const config& data)
|
||||
void mp_lobby::process_network_data(const config& data)
|
||||
{
|
||||
if(const config& error = data.child("error")) {
|
||||
throw wesnothd_error(error["message"]);
|
||||
|
@ -839,7 +839,7 @@ void lobby_main::process_network_data(const config& data)
|
|||
chatbox_->process_network_data(data);
|
||||
}
|
||||
|
||||
void lobby_main::process_gamelist(const config& data)
|
||||
void mp_lobby::process_gamelist(const config& data)
|
||||
{
|
||||
lobby_info_.process_gamelist(data);
|
||||
DBG_LB << "Received gamelist\n";
|
||||
|
@ -847,7 +847,7 @@ void lobby_main::process_gamelist(const config& data)
|
|||
gamelist_diff_update_ = false;
|
||||
}
|
||||
|
||||
void lobby_main::process_gamelist_diff(const config& data)
|
||||
void mp_lobby::process_gamelist_diff(const config& data)
|
||||
{
|
||||
if(lobby_info_.process_gamelist_diff(data)) {
|
||||
DBG_LB << "Received gamelist diff\n";
|
||||
|
@ -867,21 +867,21 @@ void lobby_main::process_gamelist_diff(const config& data)
|
|||
}
|
||||
}
|
||||
|
||||
void lobby_main::observe_global_button_callback(window& window)
|
||||
void mp_lobby::observe_global_button_callback(window& window)
|
||||
{
|
||||
if(do_game_join(gamelistbox_->get_selected_row(), true)) {
|
||||
window.set_retval(OBSERVE);
|
||||
}
|
||||
}
|
||||
|
||||
void lobby_main::join_global_button_callback(window& window)
|
||||
void mp_lobby::join_global_button_callback(window& window)
|
||||
{
|
||||
if(do_game_join(gamelistbox_->get_selected_row(), false)) {
|
||||
window.set_retval(JOIN);
|
||||
}
|
||||
}
|
||||
|
||||
void lobby_main::join_or_observe(int idx)
|
||||
void mp_lobby::join_or_observe(int idx)
|
||||
{
|
||||
const mp::game_info& game = *lobby_info_.games()[idx];
|
||||
if(do_game_join(idx, !game.can_join())) {
|
||||
|
@ -941,7 +941,7 @@ static bool handle_addon_requirements_gui(CVideo& v, const std::vector<mp::game_
|
|||
return false;
|
||||
}
|
||||
|
||||
bool lobby_main::do_game_join(int idx, bool observe)
|
||||
bool mp_lobby::do_game_join(int idx, bool observe)
|
||||
{
|
||||
if(idx < 0 || idx >= static_cast<int>(lobby_info_.games().size())) {
|
||||
ERR_LB << "Requested join/observe of a game with index out of range: "
|
||||
|
@ -991,12 +991,12 @@ bool lobby_main::do_game_join(int idx, bool observe)
|
|||
return true;
|
||||
}
|
||||
|
||||
void lobby_main::refresh_button_callback(window& /*window*/)
|
||||
void mp_lobby::refresh_button_callback(window& /*window*/)
|
||||
{
|
||||
wesnothd_connection_.send_data(config("refresh_lobby"));
|
||||
}
|
||||
|
||||
void lobby_main::show_preferences_button_callback(window& window)
|
||||
void mp_lobby::show_preferences_button_callback(window& window)
|
||||
{
|
||||
if(preferences_callback_) {
|
||||
preferences_callback_();
|
||||
|
@ -1012,7 +1012,7 @@ void lobby_main::show_preferences_button_callback(window& window)
|
|||
}
|
||||
}
|
||||
|
||||
void lobby_main::game_filter_reload()
|
||||
void mp_lobby::game_filter_reload()
|
||||
{
|
||||
lobby_info_.clear_game_filter();
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ void lobby_main::game_filter_reload()
|
|||
lobby_info_.set_game_filter_invert(filter_invert_->get_value_bool());
|
||||
}
|
||||
|
||||
void lobby_main::game_filter_keypress_callback(const SDL_Keycode key)
|
||||
void mp_lobby::game_filter_keypress_callback(const SDL_Keycode key)
|
||||
{
|
||||
if(key == SDLK_RETURN || key == SDLK_KP_ENTER) {
|
||||
game_filter_reload();
|
||||
|
@ -1052,18 +1052,18 @@ void lobby_main::game_filter_keypress_callback(const SDL_Keycode key)
|
|||
}
|
||||
}
|
||||
|
||||
void lobby_main::game_filter_change_callback(gui2::widget& /*widget*/)
|
||||
void mp_lobby::game_filter_change_callback(gui2::widget& /*widget*/)
|
||||
{
|
||||
game_filter_reload();
|
||||
update_gamelist_filter();
|
||||
}
|
||||
|
||||
void lobby_main::gamelist_change_callback(window& /*window*/)
|
||||
void mp_lobby::gamelist_change_callback(window& /*window*/)
|
||||
{
|
||||
update_selected_game();
|
||||
}
|
||||
|
||||
void lobby_main::player_filter_callback(gui2::widget& /*widget*/)
|
||||
void mp_lobby::player_filter_callback(gui2::widget& /*widget*/)
|
||||
{
|
||||
player_list_.update_sort_icons();
|
||||
|
||||
|
@ -1074,7 +1074,7 @@ void lobby_main::player_filter_callback(gui2::widget& /*widget*/)
|
|||
// window_->invalidate_layout();
|
||||
}
|
||||
|
||||
void lobby_main::user_dialog_callback(mp::user_info* info)
|
||||
void mp_lobby::user_dialog_callback(mp::user_info* info)
|
||||
{
|
||||
lobby_player_info dlg(*chatbox_, *info, lobby_info_);
|
||||
|
||||
|
@ -1113,7 +1113,7 @@ void lobby_main::user_dialog_callback(mp::user_info* info)
|
|||
wesnothd_connection_.send_data(config("refresh_lobby"));
|
||||
}
|
||||
|
||||
void lobby_main::skip_replay_changed_callback(window& window)
|
||||
void mp_lobby::skip_replay_changed_callback(window& window)
|
||||
{
|
||||
// TODO: this prefence should probably be controlled with an enum
|
||||
const int value = find_widget<menu_button>(&window, "replay_options", false).get_value();
|
||||
|
@ -1121,7 +1121,7 @@ void lobby_main::skip_replay_changed_callback(window& window)
|
|||
preferences::set_blindfold_replay(value == 2);
|
||||
}
|
||||
|
||||
int lobby_main::get_game_index_from_id(const int game_id) const
|
||||
int mp_lobby::get_game_index_from_id(const int game_id) const
|
||||
{
|
||||
if(mp::game_info* game = lobby_info_.get_game_by_id(game_id)) {
|
||||
return std::find(lobby_info_.games().begin(), lobby_info_.games().end(), game) - lobby_info_.games().begin();
|
||||
|
|
|
@ -70,12 +70,12 @@ struct player_list
|
|||
tree_view* tree;
|
||||
};
|
||||
|
||||
class lobby_main : public modal_dialog, public quit_confirmation, private plugin_executor
|
||||
class mp_lobby : public modal_dialog, public quit_confirmation, private plugin_executor
|
||||
{
|
||||
public:
|
||||
lobby_main(const config& game_config, mp::lobby_info& info, wesnothd_connection &connection);
|
||||
mp_lobby(const config& game_config, mp::lobby_info& info, wesnothd_connection &connection);
|
||||
|
||||
~lobby_main();
|
||||
~mp_lobby();
|
||||
|
||||
/**
|
||||
* Set the callback used to show the preferences.
|
||||
|
|
|
@ -429,7 +429,7 @@ BOOST_AUTO_TEST_CASE(test_gui2)
|
|||
test<install_dependencies>();
|
||||
test<language_selection>();
|
||||
// test<loading_screen>(); TODO: enable
|
||||
test<lobby_main>();
|
||||
test<mp_lobby>();
|
||||
test<lobby_player_info>();
|
||||
test<log_settings>();
|
||||
//test<lua_interpreter>(& lua_kernel_base());
|
||||
|
@ -822,7 +822,7 @@ struct wesnothd_connection_init
|
|||
};
|
||||
|
||||
template<>
|
||||
struct dialog_tester<lobby_main>
|
||||
struct dialog_tester<mp_lobby>
|
||||
{
|
||||
config game_config;
|
||||
wesnothd_connection connection;
|
||||
|
@ -832,9 +832,9 @@ struct dialog_tester<lobby_main>
|
|||
dialog_tester() : connection("", ""), init(connection), li(game_config, installed_addons)
|
||||
{
|
||||
}
|
||||
lobby_main* create()
|
||||
mp_lobby* create()
|
||||
{
|
||||
return new lobby_main(game_config, li, connection);
|
||||
return new mp_lobby(game_config, li, connection);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue