]> icculus.org git repositories - divverent/nexuiz.git/blob - data/source/control/visual/visual.qh
give menu source its own directory
[divverent/nexuiz.git] / data / source / control / visual / visual.qh
1 // DP/Nex Menu
2 // control/visual/visual.qh
3
4 // Item states
5 enum {
6         ITEM_STATE_NORMAL,
7         ITEM_STATE_SELECTED,
8         ITEM_STATE_PRESSED
9 };
10
11 // Item_Picture
12 .string picture;
13 .vector color;
14 .float  alpha;
15 .float  drawFlag;
16
17 void() Item_Picture_Draw;
18 void() Item_Picture_Destroy;
19 void() Item_Picture_Spawn;
20
21 // Item_Rect
22 .vector color;
23 .float  alpha;
24 .float  drawFlag;
25
26 void() Item_Rect_Draw;
27 void() Item_Rect_Spawn;
28
29 // Item_Label
30 .vector color;
31 .float  alpha;
32 .float  drawFlag;
33 .string text;
34 .vector fontSize;
35 .float  alignment;
36
37 void() Item_Label_Draw;
38 void() Item_Label_Update;
39 void() Item_Label_Destroy;
40 void() Item_Label_Spawn;
41
42 // Item_MultiLabel implements Item_Label
43 // multiline label
44 .vector color;
45 .float  alpha;
46 .float  drawFlag;
47 .string text;
48 .vector fontSize;
49 .float  alignment;
50 .float  wrap;   // 0 for no wrapping
51
52 void() Item_MultiLabel_Update;
53 void() Item_MultiLabel_Draw;
54 void() Item_MultiLabel_Destroy;
55 void() Item_MultiLabel_Spawn;
56
57 // Item_Button [Item_Link]
58 // add $ to the text if you want to use pictures
59 // e.g. $gfx/menu_newgame
60 // if selected is "" then it falls back to normal
61 // if pressed is "" then it falls back to selected or normal (see above)
62 .vector fontSize;
63 .string normal;
64 .string selected;
65 .string pressed;
66 .vector color;
67 .vector colorSelected;
68 .vector colorPressed;
69 .vector drawFlags; // x = normal; y = selected; z = pressed
70 .vector alphas;
71 .string soundSelected;
72 .string soundPressed;
73 .float _presstime;
74 .float _state;
75
76 // cevents supported by Item_Button
77 .event init;
78 .event reinit;
79 .event destroy;
80 .event action;
81
82 void() Item_Button_Draw;
83 void() Item_Button_Update;
84 void( bool pSelect, bool pUser ) Item_Button_Select;
85 bool( float pKey, float pAscii ) Item_Button_Key;
86 void() Item_Button_Destroy;
87 void() Item_Button_Spawn;
88
89 // Item_Slider [Item_DataUser]
90 // Item_Slider changes link's value when the slider is moved
91 // the slider is x-centered but not y
92 .vector proportions; // x is left margin, y is slider width and z is right margin (sum should be 1)
93 .string picture; // picture of the background
94 .string pictureSlider; // picture of the slider
95 .string soundSelected;
96 .string soundIncrease;
97 .string soundDecrease;
98 .vector sizeSlider; // size of the slider
99 .vector direction; // y values of the slider: _x for the start and _y for the end (as percentages of size_y)
100 // only has normal and selected
101 .vector color;
102 .vector colorSelected;
103 .vector drawFlags;
104 .vector alphas;
105
106 // cevents supported by Item_Slider
107 .event init;
108 .event reinit;
109 .event action; // called when the slider is changed
110 .event destroy;
111
112 void( bool pSelect, bool pUser ) Item_Slider_Select;
113 void() Item_Slider_Draw;
114 bool( float pKey, float pAscii ) Item_Slider_Key;
115 void() Item_Slider_Destroy;
116 void() Item_Slider_Spawn;
117
118 // Item_EditBox [Item_DataUser]
119 .vector color;
120 .vector colorSelected;
121 .vector colorPressed;
122 .vector alphas;
123 .vector drawFlags;
124
125 .vector colorCursor;
126 .vector colorCursorFlash;
127 .vector sizeCursor;
128 .vector sizeCursorFlash;
129 .vector alphasCursor;
130 .vector drawFlagsCursor;
131
132 .string soundSelected;
133 .string soundKey;
134 .string soundMove;
135
136 .float _presstime;
137 .float _state;
138 .float _cursorPos;
139
140 // cevents supported by Item_EditBox
141 .event init;
142 .event reinit;
143 .event action; // called when the return key is pressed
144 .event destroy;
145 .selectEvent select;
146
147 void() Item_EditBox_Draw;
148 void() Item_EditBox_Update;
149 bool( float pKey, float pAscii ) Item_EditBox_Key;
150 void( bool pSelect, bool pUser ) Item_EditBox_Select;
151 void() Item_EditBox_Destroy;
152 void() Item_EditBox_Reinit;
153 void() Item_EditBox_Spawn;
154
155 // Item_ValueButton [Item_Button] [Item_DataUser] FIXME: actually this is bad practice
156
157 void() Item_ValueButton_Update;
158 void() Item_ValueButton_Destroy;
159 void() Item_ValueButton_Spawn;
160
161 // Item_SwitchButton Item_ValueButton
162 bool( float pKey, float pAscii ) Item_SwitchButton_Key;
163 void() Item_SwitchButton_Spawn;
164
165 // Item_List [Item_DataUser]
166 .vector fontSize;
167 .vector colorSelected;
168 .vector colorPressed;
169 .vector colorInactive;
170 .vector drawFlags; // x = normal; y = selected; z = pressed
171 .float drawFlagInactive;
172 .vector alphas;
173 .float alphaInactive;
174 .string soundSelected;
175 .string soundPressed;
176 .float _presstime;
177 .float _state;
178
179 // cevents supported by Item_List
180 .event init;
181 .event reinit;
182 .event destroy;
183 .event action; // called on double-click
184
185 void() Item_List_Draw;
186 void() Item_List_Update;
187 void( bool pSelect, bool pUser ) Item_List_Select;
188 bool( float pKey, float pAscii ) Item_List_Key;
189 void() Item_List_Destroy;
190 void() Item_List_Spawn;
191
192 // Item_FloatingArea
193 // When you click on the area, the target will move with the mouse cursor until you click again
194 .float _state;
195 .string target;
196 .entity _target;
197 bool( float pKey, float pAscii ) Item_FloatingArea_Key;
198 void() Item_FloatingArea_Update;
199 void() Item_FloatingArea_Spawn;
200
201 // Item_VScrollBar
202 // target should point to a ScrollWindow
203 .string target;
204 .entity _target;
205
206 void() Item_VScrollBar_Draw;
207 bool( float pKey, float Ascii ) Item_VScrollBar_Key;
208 void() Item_VScrollBar_Update;
209 void() Item_VScrollBar_Spawn;
210