118 {
119 if (index == 6)
120 {
123 }
124 else
125 {
128 ref array<ref JsonControlMappingInfo> control_mapping_info = new array<ref JsonControlMappingInfo>;
129 ref array<ref array <ref JsonControlMappingInfo>> tab_array = new array<ref array <ref JsonControlMappingInfo>>;
130
133
134 float text_widget_pos_x, text_widget_pos_y;
135 float text_widget_width, text_widget_height;
136 float dot_pos_x, dot_pos_y;
137 float dot_width, dot_height;
138 float draw_pos_x, draw_pos_y;
139
140 CanvasWidget canvas_widget = CanvasWidget.Cast(layoutRoot.FindAnyWidget("CanvasWidget_" + index));
141 canvas_widget.Clear();
143
144 for (
int i = 0; i <
m_TabScript.GetTabCount(); i++)
145 {
146 tab_array.Insert(new array<ref JsonControlMappingInfo>);
147 for (int j = 0; j < 30; j++)
148 {
149 tab_array[i].Insert(NULL);
150 }
151 }
152
153
154 for (i = 0; i < control_mapping_info.Count(); i++)
155 {
156 JsonControlMappingInfo info = control_mapping_info.Get(i);
158 }
159
160
161 for (int l = 0; l < control_mapping_info.Count(); l++)
162 {
163 JsonControlMappingInfo info1 = control_mapping_info[l];
167 {
168 continue;
169 }
170 if (!button_marker_groups_unflitred.Contains(button_name))
171 {
172 button_marker_groups_unflitred.Insert(button_name, new array<int>);
173 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
174 }
175 else
176 {
177 button_marker_groups_unflitred.Get(button_name).Insert(text_widget_id);
178 }
179 }
180
181
182 for (l = 0; l < button_marker_groups_unflitred.Count(); l++)
183 {
184 if (button_marker_groups_unflitred.GetElement(l).Count() > 1)
185 {
186 string key = button_marker_groups_unflitred.GetKey(l);
187 button_marker_groups.Insert(button_marker_groups_unflitred.GetKey(l), button_marker_groups_unflitred.Get(key));
188 }
189 }
190
191
192 Widget xbox_controls_image = layoutRoot.FindAnyWidget(
"Markers_" + index);
193
195 Widget button_marker_widget;
196
197 for (l = 0; l < tab_array[index].Count(); l++)
198 {
199 panel_widget = layoutRoot.FindAnyWidget("PanelWidget" + l);
200 if (tab_array[index][l] != NULL)
201 {
202 TextWidget text_widget = TextWidget.Cast(panel_widget.FindAnyWidget("TextWidget" + l));
203 button_marker_widget = layoutRoot.FindAnyWidget("button_marker_" + tab_array[index][l].m_ButtonName);
204 text_widget.SetText(tab_array[index][l].m_InfoText);
205 panel_widget.Show(true);
206 panel_widget.Update();
207
208 if (!button_marker_groups.Contains(tab_array[index][l].m_ButtonName))
209 {
210 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
211 panel_widget.GetScreenSize(text_widget_width,text_widget_height);
212
213 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
214 button_marker_widget.GetScreenSize(dot_width, dot_height);
215
216 draw_pos_y = text_widget_pos_y + text_widget_height / 2;
217
218 if (l < 15)
219 {
220 draw_pos_x = text_widget_pos_x + text_widget_width - 1;
221 }
222 else
223 {
224 draw_pos_x = text_widget_pos_x;
225 }
226
227 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));
228 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));
229 }
230 }
231 else
232 {
233 panel_widget.Show(false);
234 }
235 panel_widget.Update();
236 }
237
238
239 for (l = 0; l < button_marker_groups.Count(); l++)
240 {
241 text_widget_pos_x = 0;
242 text_widget_pos_y = 0;
243 text_widget_width = 0;
244 text_widget_height = 0;
245 float group_point_x = 0, group_point_y = 0;
246 float first_x = 0, first_y = 0;
247
248 ref array<int> element = button_marker_groups.GetElement(l);
249 string key_name = button_marker_groups.GetKey(l);
250 button_marker_widget = layoutRoot.FindAnyWidget("button_marker_" + key_name);
251
252 for (int g = 0; g < element.Count(); g++)
253 {
254 panel_widget = layoutRoot.FindAnyWidget("PanelWidget" + element[g]);
255
256 panel_widget.GetScreenPos(text_widget_pos_x, text_widget_pos_y);
257 panel_widget.GetScreenSize(text_widget_width, text_widget_height);
258
259 if (g == 0)
260 {
261 if (element[0] < 15)
262 {
263 first_x = text_widget_pos_x + text_widget_width +50;
264 }
265 else
266 {
267 first_x = text_widget_pos_x - 50;
268 }
269 first_y = text_widget_pos_y + text_widget_height/2;
270
271 }
272
273 group_point_x += text_widget_pos_x;
274 group_point_y += text_widget_pos_y;
275
276 if (element[0] < 15)
277 {
278 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));
279 }
280 else
281 {
282 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));
283 }
284 }
285
286 if (element[0] < 15)
287 {
288 group_point_x = group_point_x/element.Count() + text_widget_width + 50;
289 }
290 else
291 {
292 group_point_x = group_point_x/element.Count() - 50;
293 }
294
295 group_point_y = group_point_y/element.Count() + text_widget_height/2;
296
297 button_marker_widget.GetScreenPos(dot_pos_x, dot_pos_y);
298 button_marker_widget.GetScreenSize(dot_width, dot_height);
299
300 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));
301 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));
302
303 if (element[0] < 15)
304 {
305 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));
306 }
307 else
308 {
309 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));
310 }
311 }
312 }
313 }
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.