DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ControlsXboxNew.c
Go to the documentation of this file.
1
2//used as UserID in the layout. Values assigned for convenience here
3enum EConsoleButtonsControls
4{
5 INVALID = 0, //assumed unassigned value, ignored (dividers, formatting elements etc.)
25
26typedef map<int,ref array<Widget>> TButtonPairingInfo; //<button_mask,<associated widgets on the respective side>>
27
28class ControlsXboxNew extends UIScriptedMenu
29{
30 protected string m_BackButtonTextID;
31 protected string m_NextPresetText;
32 protected int m_CurrentTabIdx = -1;
33 protected int m_CurrentPresetVariant = -1;
34
35 protected ButtonWidget m_Back;
36 protected ImageWidget m_ControlsLayoutImage;
37
38 //-------------
39 protected CanvasWidget m_CanvasWidget;
40 protected TabberUI m_TabScript;
43 protected Widget m_PlatformHolder; //controls container for selected platform
45
48 protected ref map<int,ref TButtonPairingInfo> m_AreasLR; //left/right area holders
49
50 protected const int AREA_LEFT = 1;
51 protected const int AREA_RIGHT = 2;
52 protected const int PLATFORM_ADJUST_X1 = 1000;
53 protected const int PLATFORM_ADJUST_PS = 2000;
54
55 //============================================
56 // ControlsXboxNew
57 //============================================
59 {
60 PPERequesterBank.GetRequester(PPERequesterBank.REQ_MENUEFFECTS).Stop();
61 }
62
63 protected void OnInputPresetChanged()
64 {
65 #ifdef PLATFORM_CONSOLE
68 #endif
69 }
70
71 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
72 {
74 }
75
76 void Back()
77 {
79 }
80
81 void UpdateTabContent(int tab_index)
82 {
83 Widget w;
84 //hide old
85 if (m_CurrentTabIdx != -1)
86 {
87 m_VariantWidget.Show(false);
88 while (m_VariantWidget.GetParent())
89 {
90 m_VariantWidget = m_VariantWidget.GetParent();
91 m_VariantWidget.Show(false);
92 }
93 }
94 //show new
95 w = FindChildByID(m_CategoryStructure[tab_index],InputUtils.GetConsolePresetID());
96 w.Show(true);
97 m_VariantWidget = w;
98
99 while (w.GetParent())
100 {
101 w = w.GetParent();
102 w.Show(true);
103 }
104
105 DrawConnectingLines(tab_index);
106 m_CurrentTabIdx = tab_index;
107 }
108
109 protected void DrawConnectingLines(int index)
110 {
111 //disconnected for now, to be finished
112 return;
113
114 m_CanvasWidget.Clear();
115
116 //TODO drawing over nyah
118 m_AreasLR = new map<int,ref TButtonPairingInfo>;
119
120 Widget wid_side; //left or right area
121 Widget wid_spacer; //item in the L/R areas
122 wid_side = m_VariantWidget.GetChildren();
123 typename t = EConsoleButtonsControls;
124 int side_idx;
125 int enum_value;
126 array<Widget> items_raw;
127 array<Widget> items_filtered;
128
129 while (wid_side)
130 {
131 TButtonPairingInfo button_mapping = new TButtonPairingInfo;
132
133 side_idx = wid_side.GetUserID();
134 wid_spacer = wid_side.GetChildren(); //dig into the side first..
135
136 for (int i = 1; i < EnumTools.GetEnumSize(EConsoleButtonsControls); i++)
137 {
138 items_raw = new array<Widget>;
139 items_filtered = new array<Widget>;
140 t.GetVariableValue(null, i, enum_value); //TODO
141
142 FindAllChildrenByID(wid_spacer,enum_value,items_raw);
143 if (FilterByVisible(items_raw,items_filtered) > 0) //if there are any button-relevant items..
144 {
145 button_mapping.Insert(enum_value,items_filtered);
146
147 //dump it!
148/*
149 for (int dump = 0; dump < items_filtered.Count(); dump++)
150 {
151 Print("key: " + i + " | name: " + items_filtered[dump].GetName());
152 }
153 Print("-");
154*/
155 }
156 }
157 m_AreasLR.Insert(side_idx,button_mapping);
158
159 wid_side = wid_side.GetSibling();
160 }
161
162 //dump it 2: the dumpening!
163/*
164 int count_2 = m_AreasLR.Count();
165 for (int z = 0; z < m_AreasLR.Count(); z++)
166 {
167 Print("---------");
168 Print("Area: " + z);
169 TButtonPairingInfo tmp_info = m_AreasLR.GetElement(z);
170 int count_1 = tmp_info.Count();
171 for (int zz = 0; zz < tmp_info.Count(); zz++)
172 {
173 for (int zzz = 0; zzz < tmp_info.GetElement(zz).Count(); zzz++)
174 {
175 Print("key: " + tmp_info.GetKey(zz) + " | name: " + tmp_info.GetElement(zz).Get(zzz).GetName());
176 }
177 }
178 }
179
180 Print("------------------------");
181*/
182 /*
183 map<string, ref array<int>> button_marker_groups_unflitred = new map<string, ref array<int>>;
184 map<string, ref array<int>> button_marker_groups = new map<string, ref array<int>>;
185
186 float text_widget_pos_x, text_widget_pos_y;
187 float text_widget_width, text_widget_height;
188 float dot_pos_x, dot_pos_y;
189 float dot_width, dot_height;
190 float draw_pos_x, draw_pos_y;
191
192 m_CanvasWidget.Clear();
193
194 for (int i = 0; i < m_TabScript.GetTabCount(); i++)
195 {
196 tab_array.Insert(new array<ref JsonControlMappingInfo>);
197 for (int j = 0; j < 20; j++)
198 {
199 tab_array[i].Insert(null);
200 }
201 }
202
203 // insert json info to array by index, so it is sorted
204 for (i = 0; i < control_mapping_info.Count(); i++)
205 {
206 JsonControlMappingInfo info = control_mapping_info.Get(i);
207 tab_array[info.m_TabID][info.m_TextWidgetID] = info;
208 }
209
210 // create group of buttons which are connected together with line
211 for (int l = 0; l < control_mapping_info.Count(); l++)
212 {
213 JsonControlMappingInfo info1 = control_mapping_info[l];
214 string button_name = info1.m_ButtonName;
215 int text_widget_id = info1.m_TextWidgetID;
216 if (info1.m_TabID != index)
217 {
218 continue;
219 }
220 if (!button_marker_groups_unflitred.Contains(button_name))
221 {
222 button_marker_groups_unflitred.Insert(button_name, new ref array<int>);
223 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
224 }
225 else
226 {
227 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
228 }
229 }
230
231 // we want groups which are bigger than 1
232 for (l = 0; l < button_marker_groups_unflitred.Count(); l++)
233 {
234 if (button_marker_groups_unflitred.GetElement(l).Count() > 1)
235 {
236 string key = button_marker_groups_unflitred.GetKey(l);
237 button_marker_groups.Insert(button_marker_groups_unflitred.GetKey(l), button_marker_groups_unflitred.Get(key));
238 }
239 }
240
241 Widget panel_widget;
242 Widget button_marker_widget;
243
244 for (l = 0; l < tab_array[index].Count(); l++)
245 {
246 panel_widget = layoutRoot.FindAnyWidget("PanelWidget" + l);
247 if (tab_array[index][l] != null)
248 {
249 TextWidget text_widget = TextWidget.Cast(panel_widget.FindAnyWidget("TextWidget" + l));
250
251 string key_prefix;
252 #ifdef PLATFORM_XBOX
253 key_prefix = "xb_button_marker_";
254 #else
255 #ifdef PLATFORM_PS4
256 key_prefix = "ps_button_marker_";
257 #endif
258 #endif
259
260 button_marker_widget = layoutRoot.FindAnyWidget(key_prefix + tab_array[index][l].m_ButtonName);
261 text_widget.SetText(tab_array[index][l].m_InfoText);
262 panel_widget.Show(true);
263 button_marker_widget.Show(true);
264 panel_widget.Update();
265 if (!button_marker_groups.Contains(tab_array[index][l].m_ButtonName))
266 {
267 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
268 panel_widget.GetScreenSize(text_widget_width,text_widget_height);
269
270 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
271 button_marker_widget.GetScreenSize(dot_width, dot_height);
272
273 draw_pos_y = text_widget_pos_y + text_widget_height / 2;
274 if (l < 10)
275 {
276 draw_pos_x = text_widget_pos_x + text_widget_width - 1;
277 }
278 else
279 {
280 draw_pos_x = text_widget_pos_x;
281 }
282 m_CanvasWidget.DrawLine(draw_pos_x, draw_pos_y, dot_pos_x+dot_width/2, draw_pos_y, 2, ARGBF(0.6, 1, 1, 1));
283 m_CanvasWidget.DrawLine(dot_pos_x+dot_width/2, draw_pos_y, dot_pos_x+dot_width/2, dot_pos_y+dot_height/2, 2, ARGBF(0.6, 1, 1, 1));
284 }
285 }
286 else
287 {
288 panel_widget.Show(false);
289 }
290 panel_widget.Update();
291 }
292
293 // draw connecting lines
294 for (l = 0; l < button_marker_groups.Count(); l++)
295 {
296 text_widget_pos_x = 0;
297 text_widget_pos_y = 0;
298 text_widget_width = 0;
299 text_widget_height = 0;
300 float group_point_x = 0, group_point_y = 0;
301 float first_x = 0, first_y = 0;
302
303 ref array<int> element = button_marker_groups.GetElement(l);
304 string key_name = button_marker_groups.GetKey(l);
305 #ifdef PLATFORM_XBOX
306 key_prefix = "xb_button_marker_";
307 #else
308 #ifdef PLATFORM_PS4
309 key_prefix = "ps_button_marker_";
310 #endif
311 #endif
312 button_marker_widget = layoutRoot.FindAnyWidget(key_prefix + key_name);
313
314 for (int g = 0; g < element.Count(); g++)
315 {
316 panel_widget = layoutRoot.FindAnyWidget("PanelWidget" + element[g]);
317
318 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
319 panel_widget.GetScreenSize(text_widget_width, text_widget_height);
320
321 if (g == 0)
322 {
323 if (element[0] < 10)
324 {
325 first_x = text_widget_pos_x + text_widget_width +50;
326 }
327 else
328 {
329 first_x = text_widget_pos_x - 50;
330 }
331
332 first_y = text_widget_pos_y + text_widget_height/2;
333 }
334
335 group_point_x += text_widget_pos_x;
336 group_point_y += text_widget_pos_y;
337 if (element[0] < 10)
338 {
339 m_CanvasWidget.DrawLine(text_widget_pos_x + text_widget_width - 1, text_widget_pos_y + text_widget_height/2, text_widget_pos_x + text_widget_width +50, text_widget_pos_y + text_widget_height/2, 2, ARGBF(0.6, 1, 1, 1));
340 }
341 else
342 {
343 m_CanvasWidget.DrawLine(text_widget_pos_x, text_widget_pos_y + text_widget_height/2, text_widget_pos_x - 50, text_widget_pos_y + text_widget_height/2, 2, ARGBF(0.6, 1, 1, 1));
344 }
345 }
346 if (element[0] < 10)
347 {
348 group_point_x = group_point_x/element.Count() + text_widget_width + 50;
349 }
350 else
351 {
352 group_point_x = group_point_x/element.Count() - 50;
353 }
354
355 if (element.Count() % 2 == 0)
356 {
357 group_point_y = ((text_widget_pos_y + text_widget_height/2) - first_y) / 2 + first_y;
358 }
359 else
360 {
361 float text_widget_pos_x_center, text_widget_pos_y_center;
362 float text_widget_width_center, text_widget_height_center;
363
364 panel_widget = layoutRoot.FindAnyWidget("PanelWidget" + element[1]);
365
366 panel_widget.GetScreenPos(text_widget_pos_x_center, text_widget_pos_y_center);
367 panel_widget.GetScreenSize(text_widget_width_center, text_widget_height_center);
368
369 group_point_y = text_widget_pos_y_center + text_widget_height_center / 2;
370 }
371
372 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
373 button_marker_widget.GetScreenSize(dot_width, dot_height);
374
375 m_CanvasWidget.DrawLine(group_point_x, group_point_y, dot_pos_x+dot_width/2, group_point_y, 2, ARGBF(0.6, 1, 1, 1));
376 m_CanvasWidget.DrawLine(dot_pos_x+dot_width/2, group_point_y, dot_pos_x+dot_width/2, dot_pos_y, 2, ARGBF(0.6, 1, 1, 1));
377
378 if (element[0] < 10)
379 {
380 m_CanvasWidget.DrawLine(first_x, first_y, text_widget_pos_x + text_widget_width +50, text_widget_pos_y + text_widget_height/2, 2, ARGBF(0.6, 1, 1, 1));
381 }
382 else
383 {
384 m_CanvasWidget.DrawLine(first_x, first_y, text_widget_pos_x - 50, text_widget_pos_y + text_widget_height/2, 2, ARGBF(0.6, 1, 1, 1));
385 }
386 }
387 */
388 }
389
390 //============================================
391 // Init
392 //============================================
393 override Widget Init()
394 {
395 m_CategoryStructure = new map<int,Widget>;
396 m_ImageMarkerStructure = new map<int,Widget>;
397
398 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/xbox/Controls_Screen.layout");
399 #ifdef PLATFORM_XBOX
400 m_ControlsImage = layoutRoot.FindAnyWidget("XboxControlsImage");
401 #else
402 #ifdef PLATFORM_PS4
403 m_ControlsImage = layoutRoot.FindAnyWidget("PSControlsImage");
404 #endif
405 #endif
406 m_ControlsImage.Show(true);
407 m_TabberWidget = layoutRoot.FindAnyWidget("Tabber");
408 m_TabberWidget.GetScript(m_TabScript);
409 m_TabScript.m_OnTabSwitch.Insert(UpdateTabContent);
410 m_CanvasWidget = CanvasWidget.Cast(layoutRoot.FindAnyWidget("CanvasUniversal"));
411 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget("back"));
412
416
417 PPERequester_MenuEffects requester;
418 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequesterBank.REQ_MENUEFFECTS));
419 requester.SetVignetteIntensity(0.6);
420
421 ComposeData();
423
426
427 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
428
429
430 return layoutRoot;
431 }
432
433 override void OnShow()
434 {
435 super.OnShow();
436
437 SetFocus(null);
438 }
439
440 override bool OnClick(Widget w, int x, int y, int button)
441 {
442 if (button == MouseState.LEFT)
443 {
444 if (w == m_Back)
445 {
446 Back();
447 return true;
448 }
449 }
450 return false;
451 }
452
453 override bool OnMouseEnter(Widget w, int x, int y)
454 {
455 if (IsFocusable(w))
456 {
458 return true;
459 }
460 return false;
461 }
462
463 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
464 {
465 if (IsFocusable(w))
466 {
467 ColorNormal(w);
468 return true;
469 }
470 return false;
471 }
472
473 override bool OnFocus(Widget w, int x, int y)
474 {
475 if (IsFocusable(w))
476 {
478 return true;
479 }
480 return false;
481 }
482
483 override bool OnFocusLost(Widget w, int x, int y)
484 {
485 if (IsFocusable(w))
486 {
487 ColorNormal(w);
488 return true;
489 }
490 return false;
491 }
492
494 {
495 return (w && w == m_Back);
496 }
497
498 override void Update(float timeslice)
499 {
500 if (GetUApi().GetInputByID(UAUITabLeft).LocalPress())
501 {
502 m_TabScript.PreviousTab();
503 }
504
505 if (GetUApi().GetInputByID(UAUITabRight).LocalPress())
506 {
507 m_TabScript.NextTab();
508 }
509
510 if (GetUApi().GetInputByID(UAUIBack).LocalPress())
511 {
512 Back();
513 }
514
515 if (GetUApi().GetInputByID(UASwitchPreset).LocalPress())
516 {
518 UpdateTabContent(m_CurrentTabIdx);
519 m_TabScript.RefreshTab();
520 }
521 }
522
524 protected void ComposeData()
525 {
526 if (m_CategoryStructure)
527 {
528 m_CategoryStructure = null;
529 m_CategoryStructure = new map<int,Widget>;
530 }
531
532 if (m_ImageMarkerStructure)
533 {
534 m_ImageMarkerStructure = null;
535 m_ImageMarkerStructure = new map<int,Widget>;
536 }
537
538 Widget w = m_ControlsImage.GetChildren();
539 m_ImageMarkerStructure.Set(w.GetUserID(),w);
540
541 while (w.GetSibling())
542 {
543 w = w.GetSibling();
544 m_ImageMarkerStructure.Set(w.GetUserID(),w); //inits button markers with their IDs
545 }
546
548
549 #ifdef PLATFORM_XBOX
550 m_PlatformHolder = FindChildByID(layoutRoot,PLATFORM_ADJUST_X1);
551 #else
552 m_PlatformHolder = FindChildByID(layoutRoot,PLATFORM_ADJUST_PS);
553 #endif
554
555 //categories
556 Widget category_widget = m_PlatformHolder.GetChildren();
557 m_CategoryStructure.Set(category_widget.GetUserID(),category_widget);
558
559 while (category_widget.GetSibling())
560 {
561 category_widget = category_widget.GetSibling();
562 m_CategoryStructure.Set(category_widget.GetUserID(),category_widget);
563 }
564 }
565
566 protected void PerformSwitchPreset()
567 {
568 int index;
569 string preset_text;
570 UAInputAPI inputAPI = GetUApi();
571
572 index = inputAPI.PresetCurrent() + 1;
573 if (index >= inputAPI.PresetCount())
574 {
575 index = 0;
576 }
577
578 inputAPI.SupressNextFrame(true);
579 inputAPI.PresetSelect(index);
581
583
584 #ifdef PLATFORM_WINDOWS
585 GetUApi().Export(); //works on emulated consoles (-xbox,-ps4)
586 #else
587 GetUApi().SaveInputPresetMiscData(); //default console functionality
588 #endif
589
592 }
593
594 protected void UpdateToolbarText()
595 {
596 UAInputAPI inputAPI = GetUApi();
597 int target_idx = inputAPI.PresetCurrent() + 1;
598 int count = inputAPI.PresetCount();
599 if (target_idx >= inputAPI.PresetCount())
600 {
601 target_idx = 0;
602 }
603
604 m_NextPresetText = inputAPI.PresetName(target_idx);
605 if (m_NextPresetText == InputUtils.PRESET_OLD)
606 {
607 m_NextPresetText = "#STR_UAPRESET_ChangeTo_0";
608 }
609 else if (m_NextPresetText == InputUtils.PRESET_NEW)
610 {
611 m_NextPresetText = "#STR_UAPRESET_ChangeTo_1";
612 }
613 else
614 {
615 m_NextPresetText = "Invalid console preset name: " + m_NextPresetText;
616 }
617 }
618
620 protected Widget FindChildByID(Widget wid, int user_id)
621 {
622 Widget ret = wid.GetChildren();
623 while (ret)
624 {
625 if (ret.GetUserID() == user_id)
626 {
627 return ret;
628 }
629 ret = ret.GetSibling();
630 }
631 return ret;
632 }
633
635 protected bool FindAllChildrenByID(Widget wid, int user_id, out array<Widget> results)
636 {
637 Widget child = wid.GetChildren();
638 while (child)
639 {
640 if (child.GetUserID() == user_id)
641 {
642 results.Insert(child);
643 }
644 child = child.GetSibling();
645 }
646 return (results && results.Count() > 0);
647 }
648
650 protected int FilterByVisible(array<Widget> input, array<Widget> filtered)
651 {
652 for (int i = 0; i < input.Count(); i++)
653 {
654 if (input[i].IsVisible())
655 {
656 filtered.Insert(input[i]);
657 }
658 }
659
660 return filtered.Count();
661 }
662
664 {
665 if (!w)
666 return;
667
668 int color_pnl = ARGB(255, 0, 0, 0);
669 int color_lbl = ARGB(255, 255, 0, 0);
670
671 #ifdef PLATFORM_CONSOLE
672 color_pnl = ARGB(255, 200, 0, 0);
673 color_lbl = ARGB(255, 255, 255, 255);
674 #endif
675
676 ButtonSetColor(w, color_pnl);
677 ButtonSetTextColor(w, color_lbl);
678 }
679
681 {
682 if (!w)
683 return;
684
685 int color_pnl = ARGB(0, 0, 0, 0);
686 int color_lbl = ARGB(255, 255, 255, 255);
687
688 ButtonSetColor(w, color_pnl);
689 ButtonSetTextColor(w, color_lbl);
690 }
691
692 void ButtonSetText(Widget w, string text)
693 {
694 if (!w)
695 return;
696
697 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() + "_label"));
698
699 if (label)
700 {
701 label.SetText(text);
702 }
703
704 }
705
706 void ButtonSetColor(Widget w, int color)
707 {
708 if (!w)
709 return;
710
711 Widget panel = w.FindWidget(w.GetName() + "_panel");
712
713 if (panel)
714 {
715 panel.SetColor(color);
716 }
717 }
718
719 void ButtonSetTextColor(Widget w, int color)
720 {
721 if (!w)
722 return;
723
724 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
725 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
726 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
727
728 if (label)
729 {
730 label.SetColor(color);
731 }
732
733 if (text)
734 {
735 text.SetColor(color);
736 }
737
738 if (text2)
739 {
740 text2.SetColor(color);
741 }
742 }
743
744 protected void UpdateControlsElements()
745 {
746 RichTextWidget toolbar_switch = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ChangePresetText"));
747 toolbar_switch.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UASwitchPreset", m_NextPresetText, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
748
749 RichTextWidget toolbar_text = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
750 string text = string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Back_BackText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
751 toolbar_text.SetText(text);
752
753 RichTextWidget toolbar_b2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon0"));
754 toolbar_b2.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
755 }
756
758 {
759 bool toolbarShow = false;
760 #ifdef PLATFORM_CONSOLE
762 #endif
763
764 layoutRoot.FindAnyWidget("toolbar_bg").Show(toolbarShow);
765 layoutRoot.FindAnyWidget("play_panel_root").Show(!toolbarShow);
766 }
767}
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition Inventory.c:164
protected void OnInputPresetChanged()
Definition Inventory.c:157
ActionInput GetInput()
protected ButtonWidget m_Back
protected TabberUI m_TabScript
enum map TButtonPairingInfo
@ BUTTON_A
@ BUTTON_PAD_LEFT
@ BUTTON_TRIGGER_RIGHT
@ BUTTON_SHOULDER_RIGHT
@ BUTTON_X
@ BUTTON_PAD_UP
@ BUTTON_GROUP_PAD_COMMON
@ BUTTON_TRIGGER_LEFT
@ BUTTON_B
@ BUTTON_PAD_RIGHT
@ BUTTON_PAD_DOWN
@ BUTTON_SHOULDER_LEFT
@ BUTTON_THUMB_LEFT
@ BUTTON_MENU
@ BUTTON_VIEW
@ INVALID
@ BUTTON_THUMB_RIGHT
@ BUTTON_GROUP_RIGHT_SIDE_COMMON
@ BUTTON_Y
Icon x
Icon y
proto native UAInputAPI GetUApi()
proto native Mission GetMission()
proto native Input GetInput()
proto native UIManager GetUIManager()
proto native WorkspaceWidget GetWorkspace()
Super root of all classes in Enforce script.
Definition EnScript.c:11
static int GetEnumSize(typename e)
Return amount of values in enum.
Definition EnConvert.c:623
proto native EInputDeviceType GetCurrentInputDevice()
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
static int GetConsolePresetID()
Definition InputUtils.c:224
static const float ICON_SCALE_TOOLBAR
Definition InputUtils.c:15
static void UpdateConsolePresetID()
Definition InputUtils.c:209
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:167
static const string PRESET_NEW
Definition InputUtils.c:5
static const string PRESET_OLD
Definition InputUtils.c:4
ScriptInvoker GetOnInputPresetChanged()
Definition gameplay.c:833
ScriptInvoker GetOnInputDeviceChanged()
Definition gameplay.c:823
proto void Invoke(void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
invoke call on all inserted methods with given arguments
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
proto native void PresetSelect(int index)
proto native int PresetCurrent()
proto native owned string PresetName(int index)
proto native void SaveInputPresetMiscData()
proto native void Export()
proto native void SupressNextFrame(bool bForce)
proto native int PresetCount()
bool Back()
Close top window on windows stack, returns true when any window is closed.
Definition UIManager.c:64
protected ref map< int, Widget > m_ImageMarkerStructure
protected ref map< int, Widget > m_CategoryStructure
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
protected string m_BackButtonTextID
protected Widget m_ControlsImage
protected ButtonWidget m_Back
void ButtonSetText(Widget w, string text)
protected TabberUI m_TabScript
override void Update(float timeslice)
protected int FilterByVisible(array< Widget > input, array< Widget > filtered)
returns count
override void OnShow()
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
protected Widget m_TabberWidget
void ButtonSetColor(Widget w, int color)
protected string m_NextPresetText
protected void OnInputPresetChanged()
void ButtonSetTextColor(Widget w, int color)
void UpdateTabContent(int tab_index)
protected void DrawConnectingLines(int index)
protected ImageWidget m_ControlsLayoutImage
protected Widget m_PlatformHolder
protected void UpdateControlsElements()
void ColorNormal(Widget w)
protected ref map< int, ref TButtonPairingInfo > m_AreasLR
protected bool FindAllChildrenByID(Widget wid, int user_id, out array< Widget > results)
Finds all immediate children widgets with corresponding userIDs.
protected void ComposeData()
Inits data structure.
protected void PerformSwitchPreset()
override Widget Init()
override bool OnFocusLost(Widget w, int x, int y)
bool IsFocusable(Widget w)
protected Widget FindChildByID(Widget wid, int user_id)
Finds immediate child widget with a corresponding userID.
override bool OnMouseEnter(Widget w, int x, int y)
protected void UpdateToolbarText()
void ColorHighlight(Widget w)
protected void UpdateControlsElementVisibility()
override bool OnFocus(Widget w, int x, int y)
protected CanvasWidget m_CanvasWidget
override bool OnClick(Widget w, int x, int y, int button)
protected Widget m_VariantWidget
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
MouseState
Definition EnSystem.c:311
proto native void SetFocus(Widget w)
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
proto native bool IsVisible()
EInputDeviceType
Definition input.c:3
int ARGB(int a, int r, int g, int b)
Definition proto.c:322