196 {
198
199 if (index == 6)
200 {
203 }
204 else
205 {
208 array<ref JsonControlMappingInfo> controlMappingInfo = new array<ref JsonControlMappingInfo>;
209 array<ref array <ref JsonControlMappingInfo>> tabArray = new array<ref array <ref JsonControlMappingInfo>>;
210
213
214 float textWidgetPosX, textWidgetPosY;
215 float textWidgetWidth, textWidgetHeight;
216 float dotPosX, dotPosY;
217 float dotWidth, dotHeight;
218 float drawPosX, drawPosY;
219 float lineThickness;
220 float branchOffset;
221
222 CanvasWidget canvasWidget = CanvasWidget.Cast(layoutRoot.FindAnyWidget("CanvasWidget_" + index));
223 canvasWidget.Clear();
227
228 for (
int i = 0; i <
m_TabScript.GetTabCount(); i++)
229 {
230 tabArray.Insert(new array<ref JsonControlMappingInfo>);
231 for (int j = 0; j < 30; j++)
232 {
233 tabArray[i].Insert(NULL);
234 }
235 }
236
237
238 int controlMappingInfoCount = controlMappingInfo.Count();
239 for (i = 0; i < controlMappingInfoCount; i++)
240 {
241 JsonControlMappingInfo info = controlMappingInfo.Get(i);
243 }
244
245
246 for (int l = 0; l < controlMappingInfoCount; l++)
247 {
248 JsonControlMappingInfo info1 = controlMappingInfo[l];
252 {
253 continue;
254 }
255 if (!buttonMarkerGroupsUnfiltered.Contains(buttonName))
256 {
257 buttonMarkerGroupsUnfiltered.Insert(buttonName, new array<int>);
258 buttonMarkerGroupsUnfiltered.Get(buttonName).Insert(textWidgetID);
259 }
260 else
261 {
262 buttonMarkerGroupsUnfiltered.Get(buttonName).Insert(textWidgetID);
263 }
264 }
265
266
267 for (l = 0; l < buttonMarkerGroupsUnfiltered.Count(); l++)
268 {
269 if (buttonMarkerGroupsUnfiltered.GetElement(l).Count() > 1)
270 {
271 string key = buttonMarkerGroupsUnfiltered.GetKey(l);
272 buttonMarkerGroups.Insert(buttonMarkerGroupsUnfiltered.GetKey(l), buttonMarkerGroupsUnfiltered.Get(key));
273 }
274 }
275
276
277 Widget xboxControlsImage = layoutRoot.FindAnyWidget(
"Markers_" + index);
278
280 Widget buttonMarkerWidget;
281
282 for (l = 0; l < tabArray[index].Count(); l++)
283 {
284 panelWidget = layoutRoot.FindAnyWidget("PanelWidget" + l);
285 if (tabArray[index][l] != NULL)
286 {
287 RichTextWidget textWidget = RichTextWidget.Cast(panelWidget.FindAnyWidget("TextWidget" + l));
288 buttonMarkerWidget = layoutRoot.FindAnyWidget("button_marker_" + tabArray[index][l].m_ButtonName);
289
292
293 textWidget.SetText(tabArray[index][l].m_InfoText);
294
295 panelWidget.Show(true);
296 panelWidget.Update();
297
298 if (!buttonMarkerGroups.Contains(tabArray[index][l].m_ButtonName))
299 {
300 panelWidget.GetScreenPos(textWidgetPosX, textWidgetPosY);
301 panelWidget.GetScreenSize(textWidgetWidth,textWidgetHeight);
302
303 buttonMarkerWidget.GetScreenPos(dotPosX, dotPosY);
304 buttonMarkerWidget.GetScreenSize(dotWidth, dotHeight);
305
306 drawPosY = textWidgetPosY + textWidgetHeight / 2;
307
308 if (l < 15)
309 {
310 drawPosX = textWidgetPosX + textWidgetWidth - 1;
311 }
312 else
313 {
314 drawPosX = textWidgetPosX;
315 }
316
317 canvasWidget.DrawLine(drawPosX, drawPosY, dotPosX + dotWidth / 2, drawPosY, lineThickness,
ARGBF(0.6, 1, 1, 1));
318 canvasWidget.DrawLine(dotPosX + dotWidth / 2, drawPosY, dotPosX + dotWidth / 2, dotPosY + dotHeight / 2, lineThickness,
ARGBF(0.6, 1, 1, 1));
319 }
320 }
321 else
322 {
323 panelWidget.Show(false);
324 }
325 panelWidget.Update();
326 }
327
328
329 for (l = 0; l < buttonMarkerGroups.Count(); l++)
330 {
331 textWidgetPosX = 0;
332 textWidgetPosY = 0;
333 textWidgetWidth = 0;
334 textWidgetHeight = 0;
335 float groupPointX = 0, groupPointY = 0;
336 float firstX = 0, firstY = 0;
337
338 array<int> element = buttonMarkerGroups.GetElement(l);
339 string keyName = buttonMarkerGroups.GetKey(l);
340 buttonMarkerWidget = layoutRoot.FindAnyWidget("button_marker_" + keyName);
341
342 int elementsCount = element.Count();
343 for (int g = 0; g < elementsCount; g++)
344 {
345 panelWidget = layoutRoot.FindAnyWidget("PanelWidget" + element[g]);
346
347 panelWidget.GetScreenPos(textWidgetPosX, textWidgetPosY);
348 panelWidget.GetScreenSize(textWidgetWidth, textWidgetHeight);
349
350 if (g == 0)
351 {
352 if (element[0] < 15)
353 {
354 firstX = textWidgetPosX + textWidgetWidth + branchOffset;
355 }
356 else
357 {
358 firstX = textWidgetPosX - branchOffset;
359 }
360 firstY = textWidgetPosY + textWidgetHeight/2;
361
362 }
363
364 groupPointX += textWidgetPosX;
365 groupPointY += textWidgetPosY;
366
367 if (element[0] < 15)
368 {
369 canvasWidget.DrawLine(textWidgetPosX + textWidgetWidth - 1, textWidgetPosY + textWidgetHeight / 2, textWidgetPosX + textWidgetWidth + branchOffset, textWidgetPosY + textWidgetHeight / 2, lineThickness,
ARGBF(0.6, 1, 1, 1));
370 }
371 else
372 {
373 canvasWidget.DrawLine(textWidgetPosX, textWidgetPosY + textWidgetHeight / 2, textWidgetPosX - branchOffset, textWidgetPosY + textWidgetHeight / 2, lineThickness,
ARGBF(0.6, 1, 1, 1));
374 }
375 }
376
377 if (element[0] < 15)
378 {
379 groupPointX = groupPointX / elementsCount + textWidgetWidth + branchOffset;
380 }
381 else
382 {
383 groupPointX = groupPointX / elementsCount - branchOffset;
384 }
385
386 groupPointY = groupPointY/elementsCount + textWidgetHeight/2;
387
388 buttonMarkerWidget.GetScreenPos(dotPosX, dotPosY);
389 buttonMarkerWidget.GetScreenSize(dotWidth, dotHeight);
390
391 canvasWidget.
DrawLine(groupPointX, groupPointY, dotPosX + dotWidth / 2, groupPointY, lineThickness,
ARGBF(0.6, 1, 1, 1));
392 canvasWidget.DrawLine(dotPosX + dotWidth / 2, groupPointY, dotPosX + dotWidth / 2, dotPosY, lineThickness,
ARGBF(0.6, 1, 1, 1));
393
394 if (element[0] < 15)
395 {
396 canvasWidget.DrawLine(firstX, firstY, textWidgetPosX + textWidgetWidth + branchOffset, textWidgetPosY + textWidgetHeight / 2, lineThickness,
ARGBF(0.6, 1, 1, 1));
397 }
398 else
399 {
400 canvasWidget.DrawLine(firstX, firstY, textWidgetPosX - branchOffset, textWidgetPosY + textWidgetHeight / 2, lineThickness,
ARGBF(0.6, 1, 1, 1));
401 }
402 }
403 }
404 }
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.