Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Waypoint.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
2class SCR_Waypoint : Managed
3{
4 protected static string WIDGET_NAME_DISTANCE = "Distance";
5 protected static string WIDGET_NAME_TITLE = "Title";
6 protected static string WIDGET_NAME_ICON = "Icon_Extra";
7
8 //TODO> MOVE TO DISPLAY
9 protected string m_sImageSetResourceName = "{6EAF838A9284890D}UI/Imagesets/Tutorial-Waypoints/Tutorial-Waypoints.imageset";
10
14
17
18 protected vector m_vOffset = vector.Zero;
21
22 protected bool m_bEnabled = true;
23 protected bool m_bFadingEnabled;
24
25 //------------------------------------------------------------------------------------------------
26 void ShowDistance(bool show)
27 {
28 m_wDistance.SetVisible(show);
29 }
30
31 //------------------------------------------------------------------------------------------------
32 void EnableFading(bool enable)
33 {
34 m_bFadingEnabled = enable;
35 }
36
37 //------------------------------------------------------------------------------------------------
39 {
40 return m_bFadingEnabled;
41 }
42
43 //------------------------------------------------------------------------------------------------
44 bool IsEnabled()
45 {
46 return m_bEnabled;
47 }
48
49 //------------------------------------------------------------------------------------------------
50 void SetEnabled(bool enable)
51 {
52 m_bEnabled = enable;
53 }
54
55 //------------------------------------------------------------------------------------------------
57 {
58 m_vOffset = offset;
59 }
60
61 //------------------------------------------------------------------------------------------------
64 {
65 return m_wWaypointWidget;
66 }
67
68 //------------------------------------------------------------------------------------------------
69 bool IsVisible()
70 {
72 return m_wWaypointWidget.IsVisible();
73
74 return false;
75 }
76
77 //------------------------------------------------------------------------------------------------
78 void SetVisible(bool visible)
79 {
80 m_wWaypointWidget.SetVisible(visible);
81 }
82
83 //------------------------------------------------------------------------------------------------
84 void SetColor(notnull Color color)
85 {
86 if (m_wTitle)
87 m_wTitle.SetColor(color);
88
89 if (m_wDistance)
90 m_wDistance.SetColor(color);
91
92 if (m_wIcon)
93 m_wIcon.SetColor(color);
94 }
95
96 //------------------------------------------------------------------------------------------------
97 void SetIconImage(string imageName, bool visible, int index = 0)
98 {
99 if (!m_wIcon)
100 return;
101
102 m_wIcon.LoadImageFromSet(index, m_sImageSetResourceName, imageName);
103 m_wIcon.SetVisible(true);
104 }
105
106 //------------------------------------------------------------------------------------------------
108 {
109 return m_AttachedTo;
110 }
111
112
113 //------------------------------------------------------------------------------------------------
116 {
117 m_AttachedTo = entity;
118 }
119
120 //------------------------------------------------------------------------------------------------
123 {
124 m_vWaypointPos = pos;
125 }
126
127 //------------------------------------------------------------------------------------------------
130 {
131 if (m_AttachedTo)
132 return m_AttachedTo.GetOrigin() + m_vOffset;
133
134 return m_vWaypointPos + m_vOffset;
135 }
136
137 //------------------------------------------------------------------------------------------------
139 {
140 m_wWaypointWidget = GetGame().GetWorkspace().CreateWidgets(resourceName, rootW);
141
145
146 SetColor(Color.Yellow);
147 }
148
149 //------------------------------------------------------------------------------------------------
151 {
153 m_wWaypointWidget.RemoveFromHierarchy();
154 }
155}
ArmaReforgerScripted GetGame()
Definition game.c:1398
ResourceName resourceName
Definition SCR_AIGroup.c:66
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition Color.c:13
RichTextWidget m_wDistance
IEntity m_AttachedTo
int m_iMaximumDrawDistance
string m_sImageSetResourceName
Definition SCR_Waypoint.c:9
void ShowDistance(bool show)
bool FadingEnabled()
bool m_bFadingEnabled
static string WIDGET_NAME_ICON
Definition SCR_Waypoint.c:6
static string WIDGET_NAME_DISTANCE
Definition SCR_Waypoint.c:4
int m_iMinimumDrawDistance
void EnableFading(bool enable)
bool IsEnabled()
Widget GetWidget()
Get Waypoint Widget.
void SetOffsetVector(vector offset)
void SetColor(notnull Color color)
void SetPositionStatic(vector pos)
Set only static position, not attached to entity.
ImageWidget m_wIcon
bool IsVisible()
void SetEnabled(bool enable)
Widget m_wWaypointWidget
vector m_vOffset
void ~SCR_Waypoint()
void SetVisible(bool visible)
void SCR_Waypoint(ResourceName resourceName, Widget rootW)
RichTextWidget m_wTitle
static string WIDGET_NAME_TITLE
Definition SCR_Waypoint.c:5
IEntity GetAttachedEntity()
vector GetPosition()
Get waypoint position. Attached entity is prioritized over static position.
void SetIconImage(string imageName, bool visible, int index=0)
void AttachToEntity(IEntity entity)
Attach waypoint to entity, copying its position.
vector m_vWaypointPos