diff options
author | Stijn Buys <ingar@osirion.org> | 2014-12-07 23:27:31 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-12-07 23:27:31 +0000 |
commit | 493e4317e19725e2de2d51753e5c1906bf9c64ba (patch) | |
tree | c46831d6d661a79b5da6580d4472d39a615fedea /src/client/client.cc | |
parent | 941c64546ca22b87a9153d36e9e3fe59c18abafe (diff) |
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.
Diffstat (limited to 'src/client/client.cc')
-rw-r--r-- | src/client/client.cc | 13 |
1 files changed, 13 insertions, 0 deletions
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()); |