mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 19:39:31 +00:00
Cherry-pick useful parts of pull request #801
This commit is contained in:
parent
9ccc4300b9
commit
419a30b45e
@ -64,6 +64,7 @@ tmp_staging::tmp_staging(const config& /*cfg*/, ng::connect_engine& connect_engi
|
||||
, ai_algorithms_(ai::configuration::get_available_ais())
|
||||
, lobby_info_(lobby_info)
|
||||
{
|
||||
set_show_even_without_video(true);
|
||||
}
|
||||
|
||||
void tmp_staging::pre_show(twindow& window)
|
||||
@ -268,7 +269,7 @@ void tmp_staging::pre_show(twindow& window)
|
||||
|
||||
plugins_context_->set_callback("launch", [&window](const config&) { window.set_retval(twindow::OK); }, false);
|
||||
plugins_context_->set_callback("quit", [&window](const config&) { window.set_retval(twindow::CANCEL); }, false);
|
||||
plugins_context_->set_callback("chat", [this, &window](const config&) { return; /* TODO*/ }, false);
|
||||
plugins_context_->set_callback("chat", [&chat](const config& cfg) { chat.send_chat_message(cfg["message"], false); }, true);
|
||||
}
|
||||
|
||||
void tmp_staging::sync_changes()
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "game_preferences.hpp"
|
||||
#include "lobby_preferences.hpp"
|
||||
#include "log.hpp"
|
||||
#include "scripting/plugins/manager.hpp"
|
||||
|
||||
static lg::log_domain log_lobby("lobby");
|
||||
#define DBG_LB LOG_STREAM(debug, log_lobby)
|
||||
@ -701,6 +702,11 @@ void tchatbox::process_message(const ::config& data, bool whisper /*= false*/)
|
||||
|
||||
add_chat_room_message_received(room, sender, message);
|
||||
}
|
||||
|
||||
// Notify plugins about the message
|
||||
::config plugin_data = data;
|
||||
plugin_data["whisper"] = whisper;
|
||||
plugins_manager::get()->notify_event("chat", plugin_data);
|
||||
}
|
||||
|
||||
bool tchatbox::process_network_data(const ::config& data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user