summaryrefslogtreecommitdiff
path: root/gui.h
blob: 9e769f53a95c29597f532edf7b2558eb5b7a517e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef GUI_H
#define GUI_H

// TODO: Remove temporary workaround for CEGUI + GCC 4.6
#include <cstddef>
#include <CEGUI.h>

class GUI {
	protected:
		CEGUI::Window *wnd;
		bool _showing;

	public:
		static CEGUI::Window *root;

		virtual ~GUI() {};

		static void init();
		static void pre_render();
		static void render();
		virtual void update() = 0;
		virtual void show();
		virtual void hide();
		bool showing();
};

class ConsoleWindow : public GUI {
	private:
		CEGUI::Window *editbox;
		CEGUI::Listbox *listbox;

		bool clicked(const CEGUI::EventArgs& e);
		bool keydown(const CEGUI::EventArgs& e);

		void erase_editbox_text();
		void handle_input();

	public:
		ConsoleWindow();
		virtual ~ConsoleWindow();

		virtual void update();
};

class RaiseWindow : public GUI {
	private:
		CEGUI::PushButton *btn;

		CEGUI::Scrollbar *radius_sb;
		CEGUI::Window *radius_sb_lbl;

		CEGUI::Scrollbar *focus_sb;
		CEGUI::Window *focus_sb_lbl;

		CEGUI::Scrollbar *strength_sb;
		CEGUI::Window *strength_sb_lbl;

		static float radius, focus, strength;

	public:
		RaiseWindow();
		virtual ~RaiseWindow();

		virtual void update();
		float get_radius();
		float get_focus();
		float get_strength();
};

#endif