Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2014-12-07 23:27:31 +0000
committerStijn Buys <ingar@osirion.org>2014-12-07 23:27:31 +0000
commit493e4317e19725e2de2d51753e5c1906bf9c64ba (patch)
treec46831d6d661a79b5da6580d4472d39a615fedea /src/client/messagebox.h
parent941c64546ca22b87a9153d36e9e3fe59c18abafe (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/messagebox.h')
-rw-r--r--src/client/messagebox.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/client/messagebox.h b/src/client/messagebox.h
new file mode 100644
index 0000000..ac1d46b
--- /dev/null
+++ b/src/client/messagebox.h
@@ -0,0 +1,50 @@
+/*
+ client/messagebox.h
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_CLIENT_MESSAGEBOX_H__
+#define __INCLUDED_CLIENT_MESSAGEBOX_H__
+
+#include "ui/window.h"
+#include "ui/button.h"
+#include "ui/label.h"
+
+namespace client
+{
+
+/**
+ * @brief a generic messagebox window class
+ * */
+class Messagebox : public ui::Window
+{
+public:
+ Messagebox(ui::Widget *parent = 0);
+ virtual ~Messagebox();
+
+ void set_text(const std::string &text);
+
+ void set_buttons(const std::string &text1, const std::string &command1, const std::string &text2, const std::string &command2);
+
+protected:
+ virtual void resize();
+
+ virtual bool on_keypress(const int key, const unsigned int modifier);
+
+ virtual bool on_emit(Widget *sender, const Event event, void *data);
+
+private:
+ /// the actual dialog widget
+ ui::Window *messagebox_frame;
+
+ ui::Label *messagebox_label;
+ ui::Button *messagebox_button1;
+ ui::Button *messagebox_button2;
+};
+
+}
+
+#endif // __INCLUDED_CLIENT_MESSAGEBOX_H__
+
+