3 protected const string PATH_MOUSEKEY =
"Scripts/data/PageDataTutorials.json";
4 protected const string PATH_X1_OLD =
"Xbox/PageDataTutorials.json";
5 protected const string PATH_X1_NEW =
"Xbox/PageDataTutorialsAlternate.json";
6 protected const string PATH_PS_OLD =
"PS4/PageDataTutorials.json";
7 protected const string PATH_PS_NEW =
"PS4/PageDataTutorialsAlternate.json";
13 protected ButtonWidget
m_Back;
26 #ifdef PLATFORM_CONSOLE
32 m_InfoTextLeft = layoutRoot.FindAnyWidget(
"InfoTextLeft");
33 m_InfoTextRight = layoutRoot.FindAnyWidget(
"InfoTextRight");
35 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"back"));
37 layoutRoot.FindAnyWidget(
"Tabber").GetScript(
m_TabScript);
40 #ifdef PLATFORM_CONSOLE
43 m_KeybindsTab =
new TutorialKeybinds(layoutRoot.FindAnyWidget(
"Tab_6"),
this);
48 m_tab_images[0] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"MovementTabBackdropImageWidget"));
49 m_tab_images[1] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"WeaponsAndActionsBackdropImageWidget"));
50 m_tab_images[2] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"InventoryTabBackdropImageWidget"));
51 m_tab_images[3] = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"MenusTabBackdropImageWidget"));
56 PPERequesterBank.GetRequester(PPERequester_TutorialMenu).Start(
new Param1<float>(0.6));
70 PPERequesterBank.GetRequester(PPERequester_TutorialMenu).Stop();
75 #ifdef PLATFORM_CONSOLE
102 m_InfoTextLeft.Show(
false);
103 m_InfoTextRight.Show(
false);
107 m_InfoTextLeft.Show(
true);
108 m_InfoTextRight.Show(
true);
115 float text_widget_pos_x, text_widget_pos_y;
116 float text_widget_width, text_widget_height;
117 float dot_pos_x, dot_pos_y;
118 float dot_width, dot_height;
119 float draw_pos_x, draw_pos_y;
121 CanvasWidget canvas_widget = CanvasWidget.Cast(layoutRoot.FindAnyWidget(
"CanvasWidget_" + index));
122 canvas_widget.Clear();
125 for (
int i = 0; i <
m_TabScript.GetTabCount(); i++)
128 for (
int j = 0; j < 30; j++)
130 tab_array[i].Insert(NULL);
135 for (i = 0; i < control_mapping_info.Count(); i++)
142 for (
int l = 0; l < control_mapping_info.Count(); l++)
151 if (!button_marker_groups_unflitred.Contains(button_name))
153 button_marker_groups_unflitred.Insert(button_name,
new ref
array<int>);
154 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
158 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
163 for (l = 0; l < button_marker_groups_unflitred.Count(); l++)
165 if (button_marker_groups_unflitred.GetElement(l).Count() > 1)
167 string key = button_marker_groups_unflitred.GetKey(l);
168 button_marker_groups.Insert(button_marker_groups_unflitred.GetKey(l), button_marker_groups_unflitred.Get(key));
173 Widget xbox_controls_image = layoutRoot.FindAnyWidget(
"Markers_" + index);
176 Widget button_marker_widget;
178 for (l = 0; l < tab_array[index].Count(); l++)
180 panel_widget = layoutRoot.FindAnyWidget(
"PanelWidget" + l);
181 if (tab_array[index][l] != NULL)
184 button_marker_widget = layoutRoot.FindAnyWidget(
"button_marker_" + tab_array[index][l].m_ButtonName);
185 text_widget.SetText(tab_array[index][l].m_InfoText);
186 panel_widget.Show(
true);
187 panel_widget.Update();
189 if (!button_marker_groups.Contains(tab_array[index][l].m_ButtonName))
191 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
192 panel_widget.GetScreenSize(text_widget_width,text_widget_height);
194 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
195 button_marker_widget.GetScreenSize(dot_width, dot_height);
197 draw_pos_y = text_widget_pos_y + text_widget_height / 2;
201 draw_pos_x = text_widget_pos_x + text_widget_width - 1;
205 draw_pos_x = text_widget_pos_x;
208 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));
209 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));
214 panel_widget.Show(
false);
216 panel_widget.Update();
220 for (l = 0; l < button_marker_groups.Count(); l++)
222 text_widget_pos_x = 0;
223 text_widget_pos_y = 0;
224 text_widget_width = 0;
225 text_widget_height = 0;
226 float group_point_x = 0, group_point_y = 0;
227 float first_x = 0, first_y = 0;
229 ref
array<int> element = button_marker_groups.GetElement(l);
230 string key_name = button_marker_groups.GetKey(l);
231 button_marker_widget = layoutRoot.FindAnyWidget(
"button_marker_" + key_name);
233 for (
int g = 0; g < element.Count(); g++)
235 panel_widget = layoutRoot.FindAnyWidget(
"PanelWidget" + element[g]);
237 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
238 panel_widget.GetScreenSize(text_widget_width, text_widget_height);
244 first_x = text_widget_pos_x + text_widget_width +50;
248 first_x = text_widget_pos_x - 50;
250 first_y = text_widget_pos_y + text_widget_height/2;
254 group_point_x += text_widget_pos_x;
255 group_point_y += text_widget_pos_y;
259 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));
263 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));
269 group_point_x = group_point_x/element.Count() + text_widget_width + 50;
273 group_point_x = group_point_x/element.Count() - 50;
276 group_point_y = group_point_y/element.Count() + text_widget_height/2;
278 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
279 button_marker_widget.GetScreenSize(dot_width, dot_height);
281 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));
282 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));
286 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));
290 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));
300 string profile_name =
"";
303#ifdef PLATFORM_CONSOLE
306 if (profile_name ==
"#STR_UAPRESET_0")
314 else if (profile_name ==
"#STR_UAPRESET_1")
332 string js_error =
"";
333 string line_content =
"";
337 while (
FGets(file_handle, line_content) >= 0)
339 content += line_content;
345 return control_mapping_info;
349 ErrorEx(
"JSON ERROR => [TutorialsMenu]: " + js_error);
354 ErrorEx(
"FILEHANDLE ERROR => [TutorialsMenu]: " + js_error);
357 return control_mapping_info;
362 if (
GetUApi().GetInputByID(UAUITabLeft).LocalPress())
368 if (
GetUApi().GetInputByID(UAUITabRight).LocalPress())
373 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
454 return (w && w ==
m_Back);
463 int color_pnl =
ARGB(255, 0, 0, 0);
464 int color_lbl =
ARGB(255, 255, 0, 0);
465 int color_img =
ARGB(255, 200, 0, 0);
467 #ifdef PLATFORM_CONSOLE
468 color_pnl =
ARGB(255, 200, 0, 0);
469 color_lbl =
ARGB(255, 255, 255, 255);
482 int color_pnl =
ARGB(0, 0, 0, 0);
483 int color_lbl =
ARGB(255, 255, 255, 255);
484 int color_img =
ARGB(255, 255, 255, 255);
510 Widget panel = w.FindWidget(w.GetName() +
"_panel");
514 panel.SetColor(color);
523 Widget panel = w.FindWidget(w.GetName() +
"_image");
527 panel.SetColor(color);
542 label.SetColor(color);
547 text.SetColor(color);
552 text2.SetColor(color);
558 #ifdef PLATFORM_CONSOLE
563 toolbar_text.SetText(text);
573 bool toolbarShow =
false;
574 #ifdef PLATFORM_CONSOLE
578 #ifdef PLATFORM_CONSOLE
579 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);
581 layoutRoot.FindAnyWidget(
"play_panel_root").Show(!toolbarShow);
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
protected void OnInputPresetChanged()
protected ButtonWidget m_Back
protected TabberUI m_TabScript
class JsonControlMappingInfo m_BackButtonTextID
void DrawConnectingLines(int index)
protected const int TABS_COUNT
protected ImageWidget m_tab_images[TABS_COUNT]
proto native Mission GetMission()
proto native Input GetInput()
proto native UIManager GetUIManager()
proto native WorkspaceWidget GetWorkspace()
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()
ScriptInvoker GetOnInputDeviceChanged()
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
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()
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 ARGB(int a, int r, int g, int b)
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.