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