23 static const string RADIAL_SELECTOR =
"RadialSelector";
24 static const string RADIAL_SELECTOR_IMAGE =
"SelectorImage";
25 static const string RADIAL_SELECTOR_POINTER =
"SelectorPointer";
26 static const string RADIAL_DELIMITER_CONTAINER =
"RadialDelimiterContainer";
27 static const string RADIAL_ITEM_CARD_CONTAINER =
"RadialItemCardContainer";
89 #ifdef PLATFORM_CONSOLE
91 if (inp && inp.IsEnabledMouseAndKeyboardEvenOnServer())
100 #ifdef PLATFORM_WINDOWS
231 if (item_cards_count > 0)
233 float angle_rad = -
Math.PI / 2;
243 Widget delimiters_panel =
m_Parent.FindAnyWidget(RADIAL_DELIMITER_CONTAINER);
244 if (delimiters_panel)
246 Widget del_child = delimiters_panel.GetChildren();
249 Widget child_to_destroy1 = del_child;
250 del_child = del_child.GetSibling();
252 delete child_to_destroy1;
257 Widget item_cards_panel =
m_Parent.FindAnyWidget(RADIAL_ITEM_CARD_CONTAINER);
258 Widget item_card = item_cards_panel.GetChildren();
262 float item_cards_r = original_r;
268 if (item_cards_r < 0) item_cards_r = 0;
272 for (
int i = 0; i < item_cards_count; ++i)
278 float pos_x = item_cards_r *
Math.Cos(angle_rad);
279 float pos_y = item_cards_r *
Math.Sin(angle_rad);
281 pos_x = pos_x / original_r;
282 pos_y = pos_y / original_r;
284 item_card.SetPos(pos_x, pos_y);
290 item_card = item_card.GetSibling();
299 delimiter_widget.SetPos(0, 0);
326 float progress = (1 / item_count) * 2;
331 bool grey_selector = selected_item.GetFlags() &
WidgetFlags.DISABLED;
366 child = child.GetSibling();
398 center_x = wx + ww / 2;
399 center_y = wy + wh / 2;
409 m_Parent.GetScreenSize(size_x, size_y);
411 return Math.Min(size_x, size_y);
428 float min_angle = w_angle - offset;
429 float max_angle = w_angle + offset;
431 if (min_angle < 0) min_angle += 360;
432 if (max_angle > 360) max_angle -= 360;
434 if (min_angle > max_angle)
436 if (min_angle <= deg_angle)
438 if (deg_angle > max_angle)
445 if (deg_angle < max_angle)
453 if (deg_angle >= min_angle && deg_angle < max_angle)
474 float tan_x = mouse_x - center_x;
475 float tan_y = mouse_y - center_y;
476 float angle =
Math.Atan2(tan_y, tan_x);
492 float distance =
vector.Distance(
Vector(mouse_x, mouse_y, 0),
Vector(center_x, center_y, 0));
500 float rad_deg = rad_angle *
Math.RAD2DEG;
502 int angle_mp = rad_deg / 360;
506 rad_deg = rad_deg - (360 * angle_mp);
629 float new_angle = 360 - angle;
630 int angle_mp = new_angle / 360;
632 new_angle = new_angle - (360 * angle_mp);
647 input.GetGamepadThumbDirection(
GamepadButton.THUMB_RIGHT, angle, tilt);