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:
parent
f52828db88
commit
d628a73fab
4 changed files with 8 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue