33 PPERequesterBank.GetRequester(PPERequester_ControlsBlur).Stop();
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++)
76 for (
int l = 0; l < control_mapping_info.Count(); l++)
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/PageDataControlIer.json";
278 file_path =
"Ps4/PageDataControlIer.json";
283 string js_error =
"";
284 string line_content =
"";
288 while (
FGets(file_handle, line_content) >= 0)
290 content += line_content;
296 return control_mapping_info;
304 return control_mapping_info;
314 layoutRoot.FindAnyWidget(
"Tabber").GetScript(
m_TabScript);
318 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"back"));
320 #ifdef PLATFORM_CONSOLE
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")));
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())
437 if (
Class.
CastTo(nameWidget,layoutRoot.FindAnyWidget(
"PresetText")));
440 nameWidget.SetText(preset_text);
protected ButtonWidget m_Back
protected TabberUI m_TabScript
class JsonControlMappingInfo m_BackButtonTextID
void DrawConnectingLines(int index)
protected const int TABS_COUNT
protected void SwitchPreset()
protected ImageWidget m_tab_images[TABS_COUNT]
proto native Mission GetMission()
proto native Input GetInput()
proto native UIManager GetUIManager()
proto native WorkspaceWidget GetWorkspace()
Super root of all classes in Enforce script.
Class for sending RPC over network.
proto bool ReadFromString(void variable_in, string jsonString, out string error)
Json string deserialization to script variable.
ScriptInvoker GetOnInputPresetChanged()
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
bool Back()
Close top window on windows stack, returns true when any window is closed.
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.
proto void CloseFile(FileHandle file)
Close the File.
proto int FGets(FileHandle file, string var)
Get line from file, every next call of this function returns next line.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.