-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmenu.h
More file actions
74 lines (50 loc) · 1009 Bytes
/
Copy pathmenu.h
File metadata and controls
74 lines (50 loc) · 1009 Bytes
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
#ifndef MENU_H
#define MENU_H
#include "appstate.h"
#include <string>
#include <vector>
#include "world.h"
struct Clickable {
int x0, y0, x1, y1;
bool hit(int x, int y);
};
struct MapEntry: public Clickable {
std::string name, description;
Font *font;
};
struct Bookmark: public Clickable {
std::string basename, name, label;
Vec3D pos;
float ah,av;
};
enum Commands {
CMD_SELECT,
CMD_LOAD_WORLD,
CMD_DO_LOAD_WORLD,
CMD_BACK_TO_MENU,
};
class Menu :public AppState
{
int sel,cmd,x,y,cz,cx;
World *world;
std::vector<MapEntry> maps;
std::vector<Bookmark> bookmarks;
bool setpos;
float ah,av;
Model *bg;
float mt;
int lastbg;
bool darken;
public:
Menu();
~Menu();
void tick(float t, float dt);
void display(float t, float dt);
void keypressed(SDL_KeyboardEvent *e);
void mousemove(SDL_MouseMotionEvent *e);
void mouseclick(SDL_MouseButtonEvent *e);
void refreshBookmarks();
void randBackground();
void shprint(Font *f, int x, int y, char *text);
};
#endif