]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/menu.qh
33d467c2a08a4caaa302ccf75dfbd3d344a42d6e
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qh
1 #ifndef MENU_H
2 #define MENU_H
3
4 #include "draw.qh"
5 #include "skin.qh"
6
7 #include "oo/base.qh"
8
9 #include "xonotic/util.qh"
10
11 #include "../common/constants.qh"
12 #include "../common/test.qh"
13 #include "../common/util.qh"
14
15 #define localcmd cmd
16
17 // constants
18
19 const int GAME_ISSERVER         = 1;
20 const int GAME_CONNECTED        = 2;
21 const int GAME_DEVELOPER        = 4;
22
23 // prototypes
24
25 float Menu_Active;
26 int gamestatus;
27
28 const int S_SHIFT = 1;
29 const int S_CTRL = 2;
30 const int S_ALT = 4;
31
32 float frametime;
33 float time;
34
35 entity anim;
36 entity main;
37 void m_hide();
38 void m_display();
39 void m_goto(string name);
40 .string name;
41
42 entity keyGrabber;
43 .void(entity me, float key, float ascii) keyGrabbed;
44
45 float conwidth, conheight; // "virtual" conwidth/height values for other stuff to assume for scaling
46
47 float preMenuInit(); // you have to define this for pre-menu initialization. Return 0 if initialization needs to be retried a frame later, 1 if it succeeded.
48 void preMenuDraw(); // this is run before the menu is drawn. You may put some stuff there that has to be done every frame.
49 void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
50
51 void m_sync();
52
53 // sounds
54
55 const string MENU_SOUND_CLEAR   = "sound/menu/clear.wav";
56 const string MENU_SOUND_CLOSE   = "sound/menu/close.wav";
57 const string MENU_SOUND_EXECUTE = "sound/menu/execute.wav";
58 const string MENU_SOUND_FOCUS   = "sound/menu/focus.wav";
59 const string MENU_SOUND_OPEN    = "sound/menu/open.wav";
60 const string MENU_SOUND_SELECT  = "sound/menu/select.wav";
61 const string MENU_SOUND_SLIDE   = "sound/menu/slide.wav";
62 const string MENU_SOUND_WINNER  = "sound/menu/winner.wav";
63
64 void m_play_focus_sound();
65 void m_play_click_sound(string soundfile);
66 #endif