MP Staging: enable chatbox
This commit is contained in:
parent
dc69c7f6c1
commit
828d82c1ad
3 changed files with 9 additions and 7 deletions
|
@ -725,7 +725,7 @@ static void enter_lobby_mode(CVideo& video, const config& game_config,
|
|||
break;
|
||||
case mp::ui::CREATE:
|
||||
try {
|
||||
enter_create_mode(video, game_config, state, wesnothd_connection, false);
|
||||
enter_create_mode(video, game_config, state, wesnothd_connection, li, false);
|
||||
} catch(config::error& error) {
|
||||
if (!error.message.empty())
|
||||
gui2::show_error_message(video, error.message);
|
||||
|
|
|
@ -59,9 +59,10 @@ namespace gui2
|
|||
|
||||
REGISTER_DIALOG(mp_staging)
|
||||
|
||||
tmp_staging::tmp_staging(const config& /*cfg*/, ng::connect_engine& connect_engine)
|
||||
tmp_staging::tmp_staging(const config& /*cfg*/, ng::connect_engine& connect_engine, lobby_info& lobby_info)
|
||||
: connect_engine_(connect_engine)
|
||||
, ai_algorithms_(ai::configuration::get_available_ais())
|
||||
, lobby_info_(lobby_info)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -236,11 +237,10 @@ void tmp_staging::pre_show(twindow& window)
|
|||
// Initialize chatbox and game rooms
|
||||
//
|
||||
|
||||
// TODO: seems the chatbox requires lobby info to be set first
|
||||
/*tchatbox& chat = find_widget<tchatbox>(&window, "chat", false);
|
||||
tchatbox& chat = find_widget<tchatbox>(&window, "chat", false);
|
||||
|
||||
chat.room_window_open("this game", true);
|
||||
chat.active_window_changed();*/
|
||||
chat.set_lobby_info(lobby_info_);
|
||||
chat.room_window_open("this game", true); // TODO: better title?
|
||||
|
||||
//
|
||||
// Set up the Lua plugin context
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "ai/configuration.hpp"
|
||||
#include "gui/dialogs/dialog.hpp"
|
||||
#include "gui/dialogs/lobby/info.hpp"
|
||||
#include "gui/dialogs/multiplayer/plugin_executor.hpp"
|
||||
|
||||
#include "game_initialization/connect_engine.hpp"
|
||||
|
@ -37,7 +38,7 @@ class twidget;
|
|||
class tmp_staging : public tdialog, private plugin_executor
|
||||
{
|
||||
public:
|
||||
tmp_staging(const config& cfg, ng::connect_engine& connect_engine);
|
||||
tmp_staging(const config& cfg, ng::connect_engine& connect_engine, lobby_info& lobby_info);
|
||||
|
||||
private:
|
||||
/** Inherited from tdialog, implemented by REGISTER_DIALOG. */
|
||||
|
@ -64,6 +65,7 @@ private:
|
|||
|
||||
std::vector<ai::description*> ai_algorithms_;
|
||||
|
||||
lobby_info& lobby_info_;
|
||||
};
|
||||
|
||||
} // namespace gui2
|
||||
|
|
Loading…
Add table
Reference in a new issue