DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
OptionSelectorBase.c
См. документацию.
2{
3 protected int m_SelectorType = 0;
4 protected Widget m_Parent;
5 protected Widget m_Root;
6
7 protected bool m_Enabled;
8
10
15
17 {
18 delete m_Root;
19 }
20
22 {
23 return m_Parent;
24 }
25
27 {
28 if (w)
29 {
30 return w == m_Parent;
31 }
32 return false;
33 }
34
35 override bool OnMouseEnter(Widget w, int x, int y)
36 {
37 if (!IsFocusable(w))
38 return true;
39
40 if (m_ParentClass)
41 {
42 m_ParentClass.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
43 #ifndef PLATFORM_CONSOLE
44 m_ParentClass.OnMouseEnter(m_Root.GetParent().GetParent(), x, y);
45 #endif
46 }
47
49
50 if (menu && menu.IsInherited(CharacterCreationMenu))
51 {
52 menu.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
53 menu.OnMouseEnter(m_Root.GetParent().GetParent(), x, y);
54 }
55
56 #ifndef PLATFORM_CONSOLE
58 #else
60 if (m_ParentClass)
61 {
62 m_ParentClass.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
63 }
64 #endif
65
66 return true;
67 }
68
69 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
70 {
71 #ifdef PLATFORM_CONSOLE
72 if (IsFocusable(enterW))
73 return true;
74 #endif
75
76 if (m_ParentClass)
77 {
78 m_ParentClass.OnFocus(null, x, y);
79 #ifndef PLATFORM_CONSOLE
80 m_ParentClass.OnMouseLeave(m_Root.GetParent().GetParent(), enterW, x, y);
81 #endif
82 }
83
85
86 if (menu && menu.IsInherited(CharacterCreationMenu))
87 {
88 menu.OnFocus(null, x, y);
89 menu.OnMouseLeave(m_Root.GetParent().GetParent(), enterW, x, y);
90 }
91
92 #ifndef PLATFORM_CONSOLE
93 ColorNormal(w);
94 #else
96 if (m_ParentClass)
97 {
98 m_ParentClass.OnFocusLost(w, x, y);
99 }
100 #endif
101
102 return true;
103 }
104
105 override bool OnFocus(Widget w, int x, int y)
106 {
107 if (IsFocusable(w))
108 {
110 if (m_ParentClass)
111 {
112 m_ParentClass.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
113 }
114 return true;
115 }
116 return false;
117 }
118
119 override bool OnFocusLost(Widget w, int x, int y)
120 {
122 if (m_ParentClass)
123 {
124 m_ParentClass.OnFocusLost(w, x, y);
125 }
126 return true;
127 }
128
129 void Focus()
130 {
131 #ifndef PLATFORM_CONSOLE
133 #else
135 #endif
136 }
137
138 void Enable()
139 {
140 m_Enabled = true;
141
142 m_Parent.ClearFlags(WidgetFlags.IGNOREPOINTER);
143
144 #ifdef PLATFORM_CONSOLE
146 #else
148 #endif
149 }
150
151 void Disable()
152 {
153 m_Enabled = false;
154
155 m_Parent.SetFlags(WidgetFlags.IGNOREPOINTER);
156
157 #ifdef PLATFORM_CONSOLE
159 #else
161 #endif
162 }
163
165 {
166 if (!w)
167 return;
168
169 ButtonSetColor(w, ARGB(255, 255, 0, 0));
170 }
171
173 {
174 if (!w)
175 return;
176
177 int color_pnl = ARGB(255, 255, 255, 255);
178 int color_lbl = ARGB(255, 255, 255, 255);
179
180 ButtonSetColor(w, color_pnl);
181
182 Widget title_label = w.FindAnyWidget(w.GetName() + "_label");
183 Widget option_label = w.FindAnyWidget("option_label");
184
185 if (title_label)
186 {
187 title_label.SetColor(color_lbl);
188 }
189
190 if (option_label)
191 {
192 option_label.SetColor(color_lbl);
193 }
194 }
195
197 {
198 if (!w)
199 return;
200
201 int color_pnl = ARGB(0, 0, 0, 0);
202 int color_lbl = ARGB(120, 255, 255, 255);
203
204 ButtonSetColor(w, color_pnl);
205
206 Widget title_label = w.FindAnyWidget(w.GetName() + "_label");
207 Widget option_label = w.FindAnyWidget("option_label");
208
209 if (title_label)
210 {
211 title_label.SetColor(color_lbl);
212 }
213
214 if (option_label)
215 {
216 option_label.SetColor(color_lbl);
217 }
218 }
219
220 void ButtonSetColor(Widget w, int color)
221 {
222 Widget option = w.FindAnyWidget(w.GetName() + "_image");
223
224 if (option)
225 {
226 option.SetColor(color);
227 }
228 }
229
231 {
232 if (!w)
233 return;
234
235 int color_pnl = ARGB(255, 200, 0, 0);
236 int color_lbl = ARGB(255, 255, 255, 255);
237
238 ButtonSetColorConsole(w, color_pnl);
240 ButtonSetTextColorConsole(w, color_lbl);
241 }
242
244 {
245 if (!w)
246 return;
247
248 int color_pnl = ARGB(0, 0, 0, 0);
249 int color_lbl = ARGB(255, 255, 255, 255);
250
251 ButtonSetColorConsole(w, color_pnl);
253 ButtonSetTextColorConsole(w, color_lbl);
254 }
255
257 {
258 if (!w)
259 return;
260
261 int color_pnl = ARGB(0, 0, 0, 0);
262 int color_lbl = ARGB(120, 255, 255, 255);
263
264 ButtonSetColorConsole(w, color_pnl);
266 ButtonSetTextColorConsole(w, color_lbl);
267 }
268
269 void ButtonSetColorConsole(Widget w, int color)
270 {
271 w.SetColor(color);
272 }
273
275 {
276 if (!w)
277 return;
278
279 Widget panel = w.FindAnyWidget(w.GetName() + "_panel");
280
281 if (panel)
282 {
283 //m_Root.SetWidgetAnimAlpha(panel);
284 }
285 }
286
288 {
289 if (!w)
290 return;
291
292 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
293 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
294 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
295
296 if (label)
297 {
298 label.SetColor(color);
299 }
300
301 if (text)
302 {
303 text.SetColor(color);
304 }
305
306 if (text2)
307 {
308 text2.SetColor(color);
309 }
310 }
311}
Icon x
Icon y
proto native UIManager GetUIManager()
override bool IsFocusable(Widget w)
Определения OptionSelector.c:198
override void ColorNormalConsole(Widget w)
Определения OptionSelector.c:235
override void ColorHighlight(Widget w)
Определения OptionSelectorEditbox.c:145
override void ColorDisabledConsole(Widget w)
Определения OptionSelector.c:248
override void ColorNormal(Widget w)
Определения OptionSelectorEditbox.c:159
ScriptInvoker Class provide list of callbacks usage:
Определения tools.c:116
ScriptedWidgetEventHandler m_ParentClass
Определения OptionSelectorBase.c:9
ref ScriptInvoker m_OptionUnfocused
Определения OptionSelectorBase.c:12
ref ScriptInvoker m_OptionChanged
Определения OptionSelectorBase.c:14
LayoutHolder m_Parent
Определения LayoutHolder.c:6
Widget GetParent()
Определения OptionSelectorBase.c:21
override bool OnFocusLost(Widget w, int x, int y)
Определения OptionSelectorBase.c:119
ref ScriptInvoker m_AttemptOptionChange
Определения OptionSelectorBase.c:13
void ButtonSetTextColorConsole(Widget w, int color)
Определения OptionSelectorBase.c:287
Widget m_Root
Определения SizeToChild.c:9
void ButtonSetAlphaAnimConsole(Widget w)
Определения OptionSelectorBase.c:274
void ColorHighlight(Widget w)
Определения OptionSelectorBase.c:164
void ColorNormalConsole(Widget w)
Определения OptionSelectorBase.c:243
void ColorNormal(Widget w)
Определения OptionSelectorBase.c:172
void ButtonSetColor(Widget w, int color)
Определения OptionSelectorBase.c:220
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения OptionSelectorBase.c:69
void ~OptionSelectorBase()
Определения OptionSelectorBase.c:16
bool IsFocusable(Widget w)
Определения OptionSelectorBase.c:26
void ColorDisabled(Widget w)
Определения OptionSelectorBase.c:196
void ColorDisabledConsole(Widget w)
Определения OptionSelectorBase.c:256
ref ScriptInvoker m_OptionFocused
Определения OptionSelectorBase.c:11
void ButtonSetColorConsole(Widget w, int color)
Определения OptionSelectorBase.c:269
override bool OnFocus(Widget w, int x, int y)
Определения OptionSelectorBase.c:105
void ColorHighlightConsole(Widget w)
Определения OptionSelectorBase.c:230
override bool OnMouseEnter(Widget w, int x, int y)
Определения OptionSelectorBase.c:35
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения EnWidgets.c:220
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
override bool OnMouseEnter(Widget w, int x, int y)
Определения CameraToolsMenu.c:928
override bool OnFocus(Widget w, int x, int y)
Определения CameraToolsMenu.c:940
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения CameraToolsMenu.c:935
Определения DayZGame.c:64
Определения EnWidgets.c:190
proto native CGame GetGame()
WidgetFlags
Определения EnWidgets.c:58
proto native void SetFocus(Widget w)
int ARGB(int a, int r, int g, int b)
Определения proto.c:322