From 493e4317e19725e2de2d51753e5c1906bf9c64ba Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 7 Dec 2014 23:27:31 +0000 Subject: Implemented messageboxes and the ability for the game module to send them to remote clients, send a messagebox if the player's ship is destroyed, this fixes having to press the respawn button twice. added messageboxes on network connection failures. --- src/core/player.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/player.cc') diff --git a/src/core/player.cc b/src/core/player.cc index 14767bd..7511e06 100644 --- a/src/core/player.cc +++ b/src/core/player.cc @@ -95,6 +95,19 @@ void Player::print() const << std::setfill('0') << std::setw(2) << time_wasted_seconds << std::endl; } +void Player::messagebox(const char *text, const char *label1, const char *command1, const char *label2, const char *command2) +{ + std::string str_text(text ? text : "" ); + + std::string str_label1(label1 ? label1 : "" ); + std::string str_command1(command1 ? command1 : "" ); + + std::string str_label2(label2 ? label2 : "" ); + std::string str_command2(command2 ? command2 : "" ); + + server()->messagebox(this, str_text, str_label1, str_command1, str_label2, str_command2); +} + void Player::message(Message::Channel channel, const std::string text) { server()->message(this, channel, text); -- cgit v1.2.3