]> icculus.org git repositories - divverent/nexuiz.git/blob - menusrc/mcustom.qh
marked two todo items as done (velocity for damage, blow away casings and gibs)
[divverent/nexuiz.git] / menusrc / mcustom.qh
1 ///////////////////////////////////////////////
2 // Custom Menu Header File
3 ///////////////////////
4 // This file belongs to dpmod/darkplaces
5 // AK contains menu specific stuff that is made especially for dpmod
6 // AK this file is used e.g. for defining some special event functions
7 ///////////////////////////////////////////////
8
9 /*Templates
10
11 Sliders with text and description:
12 ----------------------------------
13
14 Template Params:
15
16 cccc - Name of the text (on the left of the menu)
17 nnn     - Name of the object group
18 ppp     - Parent of the object group
19 ccvv    - Name of the cvar
20 yypp    - y position
21
22 //////
23 // cccc
24 ////
25 // Menu Button
26 {
27         type            ITEM_TEXTBUTTON
28         name            ppp_nnn_text
29         parent          ppp
30         text            "cccc"
31         pos                     "0 yypp 0"
32         //font_size     "10 10 0"
33         alignment       16              // TEXT_ALIGN_LEFTPOS
34         flag            256             // FLAG_AUTOSETCLICK
35         key                     nex_redirect_key        // redirects input to the child
36 }
37 // Slider
38 {
39         type            ITEM_SLIDER
40         name            ppp_nnn_slider
41         parent          ppp_nnn_text
42         pos                     "10 yypp 0"
43         size            "100 8 0"
44         //size          "100 10 0"
45         flag            260             // FLAG_AUTOSETCLICK | FLAG_NOSELECT
46         cvarname        "ccvv"
47         cvartype        1               // CVAR_INT
48         min_value       240
49         max_value       1536
50         step            25.92
51         init            nex_cvar_slider
52 }
53 // Text
54 {
55         type            ITEM_TEXT
56         name            ppp_nnn_slidertext
57         parent          ppp_nnn_text
58         link            ppp_nnn_slider
59         pos                     "120 yypp 0"
60         //font_size "10 10 0"
61         maxlen          4
62         init            nex_slidertext
63 }
64
65 Text switch with text :
66
67 cccc    - name of it (and caption of the text)
68 ppp             - parent
69 nnn             - name of the object group
70 yypp    - y position of the object group
71 ccvv    - name of the cvar
72 ssss    - switches 'No' 'Yes'
73
74 //////
75 // cccc
76 ////
77 // Text
78 {
79         type    ITEM_TEXTBUTTON
80         name            ppp_nnn_text
81         parent          ppp
82         text            "cccc"
83         pos                     "0 yypp 0"
84         //font_size     "10 10 0"
85         alignment       16              // TEXT_ALIGN_RIGHTPOS
86         flag            256             // FLAG_AUTOSETCLICK
87         key                     nex_redirect_key
88 }
89 // Switch
90 {
91         type    ITEM_TEXTSWITCH
92         name            ppp_nnn_switch
93         parent          ppp_nnn_text
94         pos                     "10 yypp 0"
95         //font_size     "10 10 0"
96         flag            260             // FLAG_AUTOSETCLICK | FLAG_NOSELECT
97         text            "ssss"
98         cvarname        "ccvv"
99         cvartype        1               // CVAR_INT
100         reinit          nex_cvar_slider // can use it also here
101 }
102
103 */
104
105 // global stuff
106
107 .string cvarname;
108 .float cvartype;
109 //.string cvarvalues;
110
111 const float CVAR_FLOAT = 0;
112 const float CVAR_INT = 1;
113 //const float CVAR_STRING = 2;
114 const float CVAR_STEP = 4;
115
116 .entity _link;
117 .float  maxlen;
118 void(void) nex_cvar_slider; // set reinit to this
119 void(void) _nex_cvar_slider_refresh;
120 void(void) _nex_cvar_slider;
121
122 float(float keynr, float ascii) nex_redirect_key;
123
124 void(void) nex_slidertext;
125 void(void) _nex_slidertext_refresh;
126
127 // option menu stuff
128 void(void) nex_options_alwaysrun_switchchange;
129 void(void) nex_options_alwaysrun_refresh;
130
131 void(void) nex_options_invmouse_switchchange;
132 void(void) nex_options_invmouse_refresh;
133
134 // quit message stuff
135 const float DPMOD_QUIT_MSG_COUNT = 4;
136
137 string[4] nex_quitmsg =
138 "'Tired of fragging''already ?'",
139 "'Quit now and forfeit''your bodycount ?'",
140 "'Are you sure you''want to quit ?'",
141 "'Off to do something''constructive ?'";
142
143 float nex_quitrequest;
144
145 void(void) nex_quit_choose;
146 void(void) nex_quit;
147 void(void) nex_quit_yes;
148 void(void) nex_quit_no;
149 float(float keynr, float ascii) nex_quit_key;