-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGui.hpp
56 lines (50 loc) · 1.11 KB
/
Gui.hpp
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
class Menu {
public:
enum MenuItemCode {
NONE,
NEW_GAME,
CONTINUE,
EXIT,
REDUNDANCY,
SIGNAL,
FIREWALL
};
enum DisplayMode {
MAIN,
PAUSE
};
~Menu();
void clear();
void addItem(MenuItemCode code, const char *label);
MenuItemCode pick(DisplayMode mode = MAIN);
protected:
struct MenuItem {
MenuItemCode code;
const char *label;
};
TCODList<MenuItem *> items;
};
class Gui : public Persistent {
public:
Menu menu;
Gui();
~Gui();
void render();
void message(const TCODColor &col, const char *text, ...);
void load(TCODZip &zip);
void save(TCODZip &zip);
void clear();
protected:
TCODConsole *con;
struct Message {
char *text;
TCODColor col;
Message(const char *text, const TCODColor &col);
~Message();
};
TCODList<Message *> log;
void renderBar(int x, int y, int width, const char *name,
float value, float maxValue, const TCODColor &barColor,
const TCODColor &backColor);
void renderMouseLook();
};