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/client/client.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index 128ac7f..336baee 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -105,12 +105,18 @@ void Client::init(int count, char **arguments) // initialize user interface ui::init(); + // main application window client_mainwindow = new MainWindow(ui::root()); + // messagebox window + client_messagebox = new Messagebox(ui::root()); + client_messagebox->hide(); + // FIXME needs to be a mainwindow child client_testmodelwindow = new TestModelWindow(ui::root()); client_testmodelwindow->hide(); + // Initialize the video subsystem if (!video::init()) { quit(1); @@ -391,6 +397,13 @@ void Client::notify_message(const core::Message::Channel channel, const std::str con_print << message << std::endl; } +void Client::notify_messagebox(const std::string & text, const std::string &label1, const std::string command1, const std::string &label2, const std::string command2) +{ + client_messagebox->set_text(text); + client_messagebox->set_buttons(label1, command1, label2, command2); + client_messagebox->show(); +} + void Client::notify_loader(const std::string &message) { video::set_loader_message(message.c_str()); -- cgit v1.2.3