1 ///////////////////////////////////////////////
2 // Controls/Item Header File
3 ///////////////////////
4 // This file belongs to dpmod/darkplaces
5 // AK contains all item specific stuff
6 ////////////////////////////////////////////////
11 This control is supported/required by the menu manager :
15 The rest is not required:
37 const vector ITEM_TEXT_NORMAL_COLOR = '1 1 1';
38 const float ITEM_TEXT_NORMAL_ALPHA = 1;
40 const vector ITEM_TEXT_SELECTED_COLOR = '0 0 1';
41 const float ITEM_TEXT_SELECTED_ALPHA = 1;
43 const vector ITEM_TEXT_PRESSED_COLOR = '1 0 0';
44 const float ITEM_TEXT_PRESSED_ALPHA = 1;
48 const vector ITEM_PICTURE_NORMAL_COLOR = '1 1 1'
49 const float ITEM_PICTURE_NORMAL_ALPHA = 1;
51 const vector ITEM_PICTURE_SELECTED_COLOR = '1 1 1'
52 const float ITEM_PICTURE_SELECTED_ALPHA = 1;
54 const vector ITEM_PICTURE_PRESSED_COLOR = '1 1 1'
55 const float ITEM_PICTURE_PRESSED_ALPHA = 1;
58 const vector ITEM_SLIDER_COLOR = '1 1 1';
59 const float ITEM_SLIDER_ALPHA = 1;
62 const float ITEM_SLIDER_STEP = 1;
63 const float ITEM_SLIDER_LEFT_MARGIN = 7;
64 const float ITEM_SLIDER_RIGHT_MARGIN = 7;
66 const string ITEM_SLIDER_DEFAULT_BAR = "gfx/m_sliderbar";
67 const string ITEM_SLIDER_DEFAULT_SLIDER = "gfx/m_slider";
69 // used only in non-picture mode
70 const vector ITEM_SLIDER_BAR_COLOR_DELTA = '-0.8 -0.8 0';
72 const vector ITEM_SLIDER_SIZE = '10 10 0';
74 // ITEM_BUTTON/ITEM_TEXTBUTTON
76 const float ITEM_BUTTON_HOLD_PRESSED = 0.2;
78 const float TEXTBUTTON_STYLE_BOX = 2;
79 const float TEXTBUTTON_STYLE_OUTLINE = 1;
80 const float TEXTBUTTON_STYLE_TEXT = 0;
82 const float TEXTBUTTON_OUTLINE_WIDTH = 1.0;
85 const vector ITEM_TEXT_FONT_SIZE = '11 11 0';
87 const float TEXT_ALIGN_LEFT = 0;
88 const float TEXT_ALIGN_CENTER = 1;
89 const float TEXT_ALIGN_RIGHT = 2;
90 const float TEXT_ALIGN_RIGHTPOS = 4; // |text - actually this isnt necessary
91 const float TEXT_ALIGN_CENTERPOS = 8; // te|xt
92 const float TEXT_ALIGN_LEFTPOS = 16; // text|
94 // ITEM_BUTTON/ITEM_TEXTBUTTON states
95 const float BUTTON_NORMAL = 0;
96 const float BUTTON_SELECTED = 1;
97 const float BUTTON_PRESSED = 2;
99 // ITEM_EDITBOX constantes
100 const float EDITBOX_CURSOR_FREQ = 1;
104 const float FLAG_STANDARD = 1; // use this flag if you want the standard behavior and not what the control recommends
105 const float FLAG_HIDDEN = 2; // events wont be called and it wont be drawn, etc.
106 const float FLAG_NOSELECT = 4; // cant be selected (but events will be called)
107 const float FLAG_CONNECTEDONLY = 8; // only if connected (i.e. playing)
108 const float FLAG_SERVERONLY = 16; // only displayed if server
109 const float FLAG_DEVELOPERONLY = 32; // only displayed if developer
110 const float _FLAG_MOUSEINAREA = 64; // used to determine wheter to call mouse_enter/_leave
111 const float FLAG_DRAWONLY = 128; // only the draw event will be called
112 const float FLAG_AUTOSETCLICK = 256; // used to make click_pos and click_size always the same as pos and size
113 const float FLAG_AUTOSETCLIP = 512; // used to make clip_pos/_size always the same like pos and size
114 const float FLAG_CHILDDRAWONLY = 1024; // used to make the children only drawable
115 const float FLAG_DRAWREFRESHONLY= 2048; // only the draw and refresh event get called
116 const float FLAG_CHILDDRAWREFRESHONLY = 4096;
119 // fields used by multiple items
125 .string link; // window link
138 .string picture_selected;
139 .string picture_pressed;
140 .string sound_selected;
141 .string sound_pressed;
143 .vector color_selected;
144 .vector color_pressed;
145 .float alpha_selected;
146 .float alpha_pressed;
147 .float drawflag_selected;
148 .float drawflag_pressed;
153 .float _button_state;
162 //.string picture_slider; = picture
164 .string sound_increase;
165 .string sound_decrease;
177 .void(void) slidermove;
179 // ITEM_TEXTSWITCH (derived from ITEM_TEXT mostly)
180 //.string text; // like above
181 //.float value; // the current displayed/selected text
183 .void(void) switchchange;
185 // ITEM_EDITBOX (derived from ITEM_TEXT mostly)
186 .string format; // //wildcards are * for each letter except the next after it - \* for * and */ space ' ' for one letter e.g. " . . . " for an ip field
187 .float maxlen; // -1 for infinite
191 /*void(void) ctinit_picture;
192 void(void) ctinit_button;
193 void(void) ctinit_textbutton;*/