Hide lobby chat log in MP staging screen

Because updating and sending messages to lobby in staging screen hasn't
been implemented, showing lobby history there would be confusing
(it would look as if everyone had stopped talking).
This commit is contained in:
Jyrki Vesterinen 2018-04-24 19:16:22 +03:00
parent f52828db88
commit d628a73fab
4 changed files with 8 additions and 4 deletions

View file

@ -746,7 +746,7 @@ void mp_lobby::pre_show(window& window)
chatbox_->set_lobby_info(lobby_info_);
chatbox_->set_wesnothd_connection(network_connection_);
chatbox_->set_active_window_changed_callback([this]() { player_list_dirty_ = true; });
chatbox_->load_log(default_chat_log);
chatbox_->load_log(default_chat_log, true);
find_widget<button>(&window, "create", false).set_retval(CREATE);

View file

@ -108,7 +108,7 @@ void mp_staging::pre_show(window& window)
chat.room_window_open("this game", true, false); // TODO: better title?
chat.active_window_changed();
chat.load_log(default_chat_log);
chat.load_log(default_chat_log, false);
//
// Set up player list

View file

@ -92,9 +92,13 @@ void chatbox::finalize_setup()
std::bind(&chatbox::chat_input_keypress_callback, this, _5));
}
void chatbox::load_log(std::map<std::string, chatroom_log>& log)
void chatbox::load_log(std::map<std::string, chatroom_log>& log, bool show_lobby)
{
for(const auto& l : log) {
if(!show_lobby && l.first == "lobby" && !l.second.whisper) {
continue;
}
find_or_create_window(l.first, l.second.whisper, true, true, l.second.log);
}

View file

@ -94,7 +94,7 @@ public:
wesnothd_connection_ = &c;
}
void load_log(std::map<std::string, chatroom_log>& log);
void load_log(std::map<std::string, chatroom_log>& log, bool show_lobby);
protected:
/**