Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RadialMenuSegmentComponent.c
Go to the documentation of this file.
1
5{
6 protected const string BACKGROUND = "Background";
7 protected const string CATEGORY_WRAP = "CategoryWrap";
8 protected const string CATEGORY = "Category";
9 protected const string CATEGORY_ARROW = "CategoryArrow";
10
15
16 //------------------------------------------------------------------------------------------------
17 override void HandlerAttached(Widget w)
18 {
19 super.HandlerAttached(w);
20
21 m_wBackground = ImageWidget.Cast(w.FindAnyWidget(BACKGROUND));
22 m_wCategoryWrap = w.FindAnyWidget(CATEGORY_WRAP);
23 m_wCategory = ImageWidget.Cast(w.FindAnyWidget(CATEGORY));
24 m_wCategoryArrow = ImageWidget.Cast(w.FindAnyWidget(CATEGORY_ARROW));
25 }
26
27 const float CATEGORY_OFFSET = 4;
28
29 //------------------------------------------------------------------------------------------------
30 void SetupSegment(float range, float angle, bool isCategory)
31 {
32 float angleDist = range * 360;
33 float rot = angle - angleDist * 0.5;
34
35 m_wBackground.SetMaskProgress(range);
36 m_wBackground.SetRotation(rot);
37
38 // Category
39 m_wCategoryWrap.SetVisible(isCategory);
40
41 if (isCategory)
42 {
43 m_wCategory.SetMaskProgress(range - CATEGORY_OFFSET / 360);
44 m_wCategory.SetRotation(rot + CATEGORY_OFFSET * 0.5);
45
46 m_wCategoryArrow.SetRotation(angle);
47
48 float arrowRot = angle * Math.DEG2RAD;
49 float radius = FrameSlot.GetPosY(m_wCategoryArrow);
50
51 vector pos = Vector(
52 radius * Math.Cos(arrowRot - 0.5 * Math.PI),
53 radius * Math.Sin(arrowRot - 0.5 * Math.PI),
54 0.0);
55
56 FrameSlot.SetPos(m_wCategoryArrow, pos[0], pos[1]);
57 }
58 }
59
60 //------------------------------------------------------------------------------------------------
65
66 //------------------------------------------------------------------------------------------------
71}
Definition Math.c:13
void SetupSegment(float range, float angle, bool isCategory)
proto native vector Vector(float x, float y, float z)