Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_Waypoint.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
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
11
protected
IEntity
m_AttachedTo
;
12
protected
Widget
m_wWaypointWidget
;
13
protected
vector
m_vWaypointPos
;
14
15
int
m_iMinimumDrawDistance
;
16
int
m_iMaximumDrawDistance
= -1;
17
18
protected
vector
m_vOffset
=
vector
.Zero;
19
RichTextWidget
m_wTitle
,
m_wDistance
;
20
ImageWidget
m_wIcon
;
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
//------------------------------------------------------------------------------------------------
38
bool
FadingEnabled
()
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
//------------------------------------------------------------------------------------------------
56
void
SetOffsetVector
(
vector
offset)
57
{
58
m_vOffset
= offset;
59
}
60
61
//------------------------------------------------------------------------------------------------
63
Widget
GetWidget
()
64
{
65
return
m_wWaypointWidget
;
66
}
67
68
//------------------------------------------------------------------------------------------------
69
bool
IsVisible
()
70
{
71
if
(
m_wWaypointWidget
)
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
//------------------------------------------------------------------------------------------------
107
IEntity
GetAttachedEntity
()
108
{
109
return
m_AttachedTo
;
110
}
111
112
113
//------------------------------------------------------------------------------------------------
115
void
AttachToEntity
(
IEntity
entity)
116
{
117
m_AttachedTo
= entity;
118
}
119
120
//------------------------------------------------------------------------------------------------
122
void
SetPositionStatic
(
vector
pos)
123
{
124
m_vWaypointPos
= pos;
125
}
126
127
//------------------------------------------------------------------------------------------------
129
vector
GetPosition
()
130
{
131
if
(
m_AttachedTo
)
132
return
m_AttachedTo
.GetOrigin() +
m_vOffset
;
133
134
return
m_vWaypointPos
+
m_vOffset
;
135
}
136
137
//------------------------------------------------------------------------------------------------
138
void
SCR_Waypoint
(
ResourceName
resourceName
,
Widget
rootW)
139
{
140
m_wWaypointWidget
=
GetGame
().GetWorkspace().CreateWidgets(
resourceName
, rootW);
141
142
m_wTitle
=
RichTextWidget
.Cast(
m_wWaypointWidget
.FindAnyWidget(
WIDGET_NAME_TITLE
));
143
m_wDistance
=
RichTextWidget
.Cast(
m_wWaypointWidget
.FindAnyWidget(
WIDGET_NAME_DISTANCE
));
144
m_wIcon
=
ImageWidget
.Cast(
m_wWaypointWidget
.FindAnyWidget(
WIDGET_NAME_ICON
));
145
146
SetColor
(
Color
.Yellow);
147
}
148
149
//------------------------------------------------------------------------------------------------
150
void
~SCR_Waypoint
()
151
{
152
if
(
m_wWaypointWidget
)
153
m_wWaypointWidget
.RemoveFromHierarchy();
154
}
155
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
resourceName
ResourceName resourceName
Definition
SCR_AIGroup.c:66
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
Color
Definition
Color.c:13
IEntity
Definition
IEntity.c:13
ImageWidget
Definition
ImageWidget.c:13
ResourceName
Definition
ResourceName.c:13
RichTextWidget
Definition
RichTextWidget.c:13
SCR_Waypoint::m_wDistance
RichTextWidget m_wDistance
Definition
SCR_Waypoint.c:19
SCR_Waypoint::m_AttachedTo
IEntity m_AttachedTo
Definition
SCR_Waypoint.c:11
SCR_Waypoint::m_iMaximumDrawDistance
int m_iMaximumDrawDistance
Definition
SCR_Waypoint.c:16
SCR_Waypoint::m_sImageSetResourceName
string m_sImageSetResourceName
Definition
SCR_Waypoint.c:9
SCR_Waypoint::ShowDistance
void ShowDistance(bool show)
Definition
SCR_Waypoint.c:26
SCR_Waypoint::FadingEnabled
bool FadingEnabled()
Definition
SCR_Waypoint.c:38
SCR_Waypoint::m_bFadingEnabled
bool m_bFadingEnabled
Definition
SCR_Waypoint.c:23
SCR_Waypoint::WIDGET_NAME_ICON
static string WIDGET_NAME_ICON
Definition
SCR_Waypoint.c:6
SCR_Waypoint::WIDGET_NAME_DISTANCE
static string WIDGET_NAME_DISTANCE
Definition
SCR_Waypoint.c:4
SCR_Waypoint::m_iMinimumDrawDistance
int m_iMinimumDrawDistance
Definition
SCR_Waypoint.c:15
SCR_Waypoint::EnableFading
void EnableFading(bool enable)
Definition
SCR_Waypoint.c:32
SCR_Waypoint::IsEnabled
bool IsEnabled()
Definition
SCR_Waypoint.c:44
SCR_Waypoint::GetWidget
Widget GetWidget()
Get Waypoint Widget.
Definition
SCR_Waypoint.c:63
SCR_Waypoint::SetOffsetVector
void SetOffsetVector(vector offset)
Definition
SCR_Waypoint.c:56
SCR_Waypoint::SetColor
void SetColor(notnull Color color)
Definition
SCR_Waypoint.c:84
SCR_Waypoint::SetPositionStatic
void SetPositionStatic(vector pos)
Set only static position, not attached to entity.
Definition
SCR_Waypoint.c:122
SCR_Waypoint::m_wIcon
ImageWidget m_wIcon
Definition
SCR_Waypoint.c:20
SCR_Waypoint::IsVisible
bool IsVisible()
Definition
SCR_Waypoint.c:69
SCR_Waypoint::SetEnabled
void SetEnabled(bool enable)
Definition
SCR_Waypoint.c:50
SCR_Waypoint::m_wWaypointWidget
Widget m_wWaypointWidget
Definition
SCR_Waypoint.c:12
SCR_Waypoint::m_vOffset
vector m_vOffset
Definition
SCR_Waypoint.c:18
SCR_Waypoint::~SCR_Waypoint
void ~SCR_Waypoint()
Definition
SCR_Waypoint.c:150
SCR_Waypoint::SetVisible
void SetVisible(bool visible)
Definition
SCR_Waypoint.c:78
SCR_Waypoint::SCR_Waypoint
void SCR_Waypoint(ResourceName resourceName, Widget rootW)
Definition
SCR_Waypoint.c:138
SCR_Waypoint::m_wTitle
RichTextWidget m_wTitle
Definition
SCR_Waypoint.c:19
SCR_Waypoint::WIDGET_NAME_TITLE
static string WIDGET_NAME_TITLE
Definition
SCR_Waypoint.c:5
SCR_Waypoint::GetAttachedEntity
IEntity GetAttachedEntity()
Definition
SCR_Waypoint.c:107
SCR_Waypoint::GetPosition
vector GetPosition()
Get waypoint position. Attached entity is prioritized over static position.
Definition
SCR_Waypoint.c:129
SCR_Waypoint::SetIconImage
void SetIconImage(string imageName, bool visible, int index=0)
Definition
SCR_Waypoint.c:97
SCR_Waypoint::m_bEnabled
bool m_bEnabled
Definition
SCR_Waypoint.c:22
SCR_Waypoint::AttachToEntity
void AttachToEntity(IEntity entity)
Attach waypoint to entity, copying its position.
Definition
SCR_Waypoint.c:115
SCR_Waypoint::m_vWaypointPos
vector m_vWaypointPos
Definition
SCR_Waypoint.c:13
Widget
Definition
Widget.c:13
vector
Definition
vector.c:13
scripts
Game
UI
Waypoint
SCR_Waypoint.c
Generated by
1.17.0