33 PPERequesterBank.GetRequester(PPERequester_ControlsBlur).Stop();
38 GetGame().GetUIManager().Back();
49 float text_widget_pos_x, text_widget_pos_y;
50 float text_widget_width, text_widget_height;
51 float dot_pos_x, dot_pos_y;
52 float dot_width, dot_height;
53 float draw_pos_x, draw_pos_y;
55 CanvasWidget canvas_widget = CanvasWidget.Cast(layoutRoot.FindAnyWidget(
"CanvasWidget_" + index));
56 canvas_widget.Clear();
62 for (
int j = 0; j < 20; j++)
64 tab_array[i].Insert(
null);
69 for (i = 0; i < control_mapping_info.Count(); i++)
72 tab_array[info.m_TabID][info.m_TextWidgetID] = info;
76 for (
int l = 0; l < control_mapping_info.Count(); l++)
79 string button_name = info1.m_ButtonName;
80 int text_widget_id = info1.m_TextWidgetID;
81 if (info1.m_TabID != index)
85 if (!button_marker_groups_unflitred.Contains(button_name))
87 button_marker_groups_unflitred.Insert(button_name,
new ref
array<int>);
88 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
92 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
97 for (l = 0; l < button_marker_groups_unflitred.Count(); l++)
99 if (button_marker_groups_unflitred.GetElement(l).Count() > 1)
101 string key = button_marker_groups_unflitred.GetKey(l);
102 button_marker_groups.Insert(button_marker_groups_unflitred.GetKey(l), button_marker_groups_unflitred.Get(key));
109 controls_image = layoutRoot.FindAnyWidget(
"XboxControlsImage");
112 controls_image = layoutRoot.FindAnyWidget(
"PSControlsImage");
116 Widget child = controls_image.GetChildren();
118 while (child.GetSibling())
120 child = child.GetSibling();
125 Widget button_marker_widget;
127 for (l = 0; l < tab_array[index].Count(); l++)
129 panel_widget = layoutRoot.FindAnyWidget(
"PanelWidget" + l);
130 if (tab_array[index][l] !=
null)
136 key_prefix =
"xb_button_marker_";
139 key_prefix =
"ps_button_marker_";
143 button_marker_widget = layoutRoot.FindAnyWidget(key_prefix + tab_array[index][l].m_ButtonName);
144 text_widget.SetText(tab_array[index][l].m_InfoText);
145 panel_widget.Show(
true);
146 button_marker_widget.Show(
true);
147 panel_widget.Update();
148 if (!button_marker_groups.Contains(tab_array[index][l].m_ButtonName))
150 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
151 panel_widget.GetScreenSize(text_widget_width,text_widget_height);
153 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
154 button_marker_widget.GetScreenSize(dot_width, dot_height);
156 draw_pos_y = text_widget_pos_y + text_widget_height / 2;
159 draw_pos_x = text_widget_pos_x + text_widget_width - 1;
163 draw_pos_x = text_widget_pos_x;
165 canvas_widget.DrawLine(draw_pos_x, draw_pos_y, dot_pos_x+dot_width/2, draw_pos_y, 2,
ARGBF(0.6, 1, 1, 1));
166 canvas_widget.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));
171 panel_widget.Show(
false);
173 panel_widget.Update();
177 for (l = 0; l < button_marker_groups.Count(); l++)
179 text_widget_pos_x = 0;
180 text_widget_pos_y = 0;
181 text_widget_width = 0;
182 text_widget_height = 0;
183 float group_point_x = 0, group_point_y = 0;
184 float first_x = 0, first_y = 0;
186 ref
array<int> element = button_marker_groups.GetElement(l);
187 string key_name = button_marker_groups.GetKey(l);
189 key_prefix =
"xb_button_marker_";
192 key_prefix =
"ps_button_marker_";
195 button_marker_widget = layoutRoot.FindAnyWidget(key_prefix + key_name);
197 for (
int g = 0; g < element.Count(); g++)
199 panel_widget = layoutRoot.FindAnyWidget(
"PanelWidget" + element[g]);
201 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
202 panel_widget.GetScreenSize(text_widget_width, text_widget_height);
208 first_x = text_widget_pos_x + text_widget_width +50;
212 first_x = text_widget_pos_x - 50;
215 first_y = text_widget_pos_y + text_widget_height/2;
218 group_point_x += text_widget_pos_x;
219 group_point_y += text_widget_pos_y;
222 canvas_widget.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));
226 canvas_widget.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));
231 group_point_x = group_point_x/element.Count() + text_widget_width + 50;
235 group_point_x = group_point_x/element.Count() - 50;
238 if (element.Count() % 2 == 0)
240 group_point_y = ((text_widget_pos_y + text_widget_height/2) - first_y) / 2 + first_y;
244 float text_widget_pos_x_center, text_widget_pos_y_center;
245 float text_widget_width_center, text_widget_height_center;
247 panel_widget = layoutRoot.FindAnyWidget(
"PanelWidget" + element[1]);
249 panel_widget.GetScreenPos(text_widget_pos_x_center, text_widget_pos_y_center);
250 panel_widget.GetScreenSize(text_widget_width_center, text_widget_height_center);
252 group_point_y = text_widget_pos_y_center + text_widget_height_center / 2;
255 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
256 button_marker_widget.GetScreenSize(dot_width, dot_height);
258 canvas_widget.DrawLine(group_point_x, group_point_y, dot_pos_x+dot_width/2, group_point_y, 2,
ARGBF(0.6, 1, 1, 1));
259 canvas_widget.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));
263 canvas_widget.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));
267 canvas_widget.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));
276 string file_path =
"xbox/pagedatacontroller.json";
278 file_path =
"ps4/pagedatacontroller.json";
283 string js_error =
"";
284 string line_content =
"";
288 while (
FGets(file_handle, line_content) >= 0)
290 content += line_content;
294 if (js.ReadFromString(control_mapping_info, content, js_error))
296 return control_mapping_info;
304 return control_mapping_info;
312 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/xbox/control_mapping_info_screen.layout");
314 layoutRoot.FindAnyWidget(
"Tabber").GetScript(
m_TabScript);
318 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"back"));
320 #ifdef PLATFORM_CONSOLE
323 toolbar_switch.SetText(
InputUtils.GetRichtextButtonIconFromInputAction(
"UASwitchPreset",
"", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR));
324 toolbar_back.SetText(
InputUtils.GetRichtextButtonIconFromInputAction(
"UAUIBack",
"", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR));
328 layoutRoot.FindAnyWidget(
"XboxControlsImage").Show(
true);
331 layoutRoot.FindAnyWidget(
"PSControlsImage").Show(
true);
335 m_tab_images[0] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"MovementTabBackdropImageWidget"));
336 m_tab_images[1] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"WeaponsAndActionsBackdropImageWidget"));
337 m_tab_images[2] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"InventoryTabBackdropImageWidget"));
338 m_tab_images[3] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"MenusTabBackdropImageWidget"));
340 PPERequester_MenuEffects requester;
341 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequesterBank.REQ_MENUEFFECTS));
342 requester.SetVignetteIntensity(0.6);
352 #ifdef PLATFORM_CONSOLE
354 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
true);
359 if (
Class.CastTo(nameWidget,layoutRoot.FindAnyWidget(
"PresetText")));
361 preset_text = inputAPI.PresetName(inputAPI.PresetCurrent());
362 nameWidget.SetText(preset_text);
382 if (
GetUApi().GetInputByID(UAUITabLeft).LocalPress())
387 if (
GetUApi().GetInputByID(UAUITabRight).LocalPress())
392 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
397 if (
GetUApi().GetInputByID(UASwitchPreset).LocalPress())
430 index = inputAPI.PresetCurrent() + 1;
431 if (index >= inputAPI.PresetCount())
436 inputAPI.PresetSelect(index);
437 if (
Class.CastTo(nameWidget,layoutRoot.FindAnyWidget(
"PresetText")));
439 preset_text = inputAPI.PresetName(inputAPI.PresetCurrent());
440 nameWidget.SetText(preset_text);
443 GetGame().GetInput().SetProfile(index);
445 GetGame().GetMission().GetOnInputPresetChanged().Invoke();