]> icculus.org git repositories - divverent/nexuiz.git/blob - menu/mcustom.qh
grappling hook
[divverent/nexuiz.git] / menu / 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         origin          "0 yypp 0"
33         //font_size     "10 10 0"
34         alignment       16              // TEXT_ALIGN_LEFTPOS
35         flag            256             // FLAG_AUTOSETCLICK
36         key                     nex_redirect_key        // redirects input to the child
37 }
38 // Slider
39 {
40         type            ITEM_SLIDER
41         name            ppp_nnn_slider
42         parent          ppp_nnn_text
43         //pos                   "10 yypp 0"
44         pos             "10 0 0"
45         size            "100 8 0"
46         //size          "100 10 0"
47         flag            260             // FLAG_AUTOSETCLICK | FLAG_NOSELECT
48         cvarname        "ccvv"
49         cvartype        1               // CVAR_INT
50         min_value       240
51         max_value       1536
52         step            25.92
53         init            nex_cvar_slider
54 }
55 // Text
56 {
57         type            ITEM_TEXT
58         name            ppp_nnn_slidertext
59         parent          ppp_nnn_text
60         link            ppp_nnn_slider
61         //pos                   "120 yypp 0"
62         pos             "120 0 0"
63         //font_size "10 10 0"
64         maxlen          4
65         init            nex_slidertext
66 }
67
68 Text switch with text :
69
70 cccc    - name of it (and caption of the text)
71 ppp             - parent
72 nnn             - name of the object group
73 yypp    - y position of the object group
74 ccvv    - name of the cvar
75 ssss    - switches 'No' 'Yes'
76
77 //////
78 // cccc
79 ////
80 // Text
81 {
82         type    ITEM_TEXTBUTTON
83         name            ppp_nnn_text
84         parent          ppp
85         text            "cccc"
86         pos             "0 yypp 0"
87         origin          "0 yypp 0"
88         //font_size     "10 10 0"
89         alignment       16              // TEXT_ALIGN_RIGHTPOS
90         flag            256             // FLAG_AUTOSETCLICK
91         key                     nex_redirect_key
92 }
93 // Switch
94 {
95         type    ITEM_TEXTSWITCH
96         name            ppp_nnn_switch
97         parent          ppp_nnn_text
98         //pos           "10 yypp 0"
99         pos             "10 0 0"
100         //font_size     "10 10 0"
101         flag            260             // FLAG_AUTOSETCLICK | FLAG_NOSELECT
102         text            "ssss"
103         cvarname        "ccvv"
104         cvartype        1               // CVAR_INT
105         reinit          nex_cvar_slider // can use it also here
106 }
107
108 */
109
110 // global stuff
111
112 .string cvarname;
113 .float cvartype;
114 //.string cvarvalues;
115
116 const float CVAR_FLOAT = 0;
117 const float CVAR_INT = 1;
118 //const float CVAR_STRING = 2;
119 const float CVAR_STEP = 4;
120
121 .entity _link;
122 //.float        maxlen; // <- ITEM_EDITBOX
123 void(void) nex_cvar_slider; // set reinit to this
124 void(void) _nex_cvar_slider_refresh;
125 void(void) _nex_cvar_slider;
126
127 float(float keynr, float ascii) nex_redirect_key;
128
129 void(void) nex_slidertext;
130 void(void) _nex_slidertext_refresh;
131
132 // option menu stuff
133 void(void) nex_options_alwaysrun_switchchange;
134 void(void) nex_options_alwaysrun_refresh;
135
136 void(void) nex_options_invmouse_switchchange;
137 void(void) nex_options_invmouse_refresh;
138
139 // quit message stuff
140 const float DPMOD_QUIT_MSG_COUNT = 4;
141
142 string  nex_quitmsg_0 = "'Tired of fragging''already ?'",
143         nex_quitmsg_1 = "'Quit now and forfeit''your bodycount ?'",
144         nex_quitmsg_2 = "'Are you sure you''want to quit ?'",
145         nex_quitmsg_3 = "'Off to do something''constructive ?'";
146
147 float nex_quitrequest;
148
149 void(void) nex_quit_choose;
150 void(void) nex_quit;
151 void(void) nex_quit_yes;
152 void(void) nex_quit_no;
153 float(float keynr, float ascii) nex_quit_key;