blob: b770ed0fbd9925bbba82accc8b0c93cd6145475f (
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
71
72
73
74
75
76
77
|
#ifndef GUI_H
#define GUI_H
#include "scripting.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;
Lua *lua;
bool clicked(const CEGUI::EventArgs& e);
bool keydown(const CEGUI::EventArgs& e);
void erase_editbox_text();
void handle_input();
public:
ConsoleWindow(Lua *lua);
virtual ~ConsoleWindow();
virtual void update();
void add_line(const std::string& line);
void add_line(const char *line);
};
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
|