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_MapDotCircleHandler.c
Go to the documentation of this file.
1
class
SCR_MapDotCircleHandler
:
SCR_MapMarkerDynamicWComponent
2
{
3
[
Attribute
(defvalue:
""
,
desc
:
"Dot layout resource"
, uiwidget:
UIWidgets
.ResourcePickerThumbnail,
params
:
"layout"
)]
4
protected
ResourceName
m_sDotResource
;
5
6
protected
float
m_fActualRadius
;
7
protected
Widget
m_wFrame
;
8
protected
SCR_MapEntity
m_MapEnt
;
9
protected
ref array<Widget>
m_aDots
= {};
10
protected
SCR_MapMarkerDotCircle
m_DotMarkerEnt
;
11
12
protected
float
m_fEnlargement
;
13
14
//------------------------------------------------------------------------------------------------
15
void
OnMapZoom
(
float
ppu)
16
{
17
if
(!
m_DotMarkerEnt
)
18
return
;
19
20
m_fActualRadius
=
m_DotMarkerEnt
.m_fRadius * ppu;
21
22
CreateDots
();
23
}
24
25
//------------------------------------------------------------------------------------------------
26
override
void
SetImage
(
ResourceName
icon,
string
quad,
float
aspectRatio = 1,
int
sizeFlag = 64)
27
{
28
if
(!
m_wMarkerIcon
)
29
return
;
30
31
super.SetImage(icon, quad, aspectRatio, sizeFlag);
32
}
33
34
//------------------------------------------------------------------------------------------------
36
override
void
SetText
(
string
text)
37
{
38
if
(!
m_wMarkerText
)
39
return
;
40
41
super.SetText(text);
42
}
43
44
//------------------------------------------------------------------------------------------------
46
override
void
SetMarkerEntity
(notnull
SCR_MapMarkerEntity
marker)
47
{
48
m_DotMarkerEnt
= SCR_MapMarkerDotCircle.Cast(marker);
49
if
(!
m_DotMarkerEnt
)
50
return
;
51
52
OnMapZoom
(
m_MapEnt
.GetCurrentZoom());
53
m_MapEnt
.GetOnMapZoom().Insert(
OnMapZoom
);
54
55
CreateDots
();
56
}
57
58
//------------------------------------------------------------------------------------------------
59
override
void
HandlerAttached
(
Widget
w)
60
{
61
super.HandlerAttached(w);
62
m_wFrame
= w.FindAnyWidget(
"DotFrame"
);
63
64
m_MapEnt
=
SCR_MapEntity
.
GetMapInstance
();
65
if
(!
m_MapEnt
)
66
return
;
67
}
68
69
//------------------------------------------------------------------------------------------------
70
void
CreateDots
()
71
{
72
if
(!
m_wFrame
|| !
m_DotMarkerEnt
)
73
return
;
74
75
foreach
(
Widget
dot :
m_aDots
)
76
{
77
dot.RemoveFromHierarchy();
78
}
79
80
m_aDots
.Clear();
81
82
int
dots =
m_DotMarkerEnt
.m_fRadius *
m_DotMarkerEnt
.m_fDotDensity;
83
if
(dots < 1)
84
return
;
85
86
float
angleIncrement = 2 *
Math
.PI / dots;
87
float
angle, x, y;
88
89
ImageWidget
dot;
90
for
(
int
i = 0; i < dots; i++)
91
{
92
angle = i * angleIncrement;
93
x =
m_fActualRadius
*
Math
.Cos(angle);
94
y =
m_fActualRadius
*
Math
.Sin(angle);
95
96
dot =
ImageWidget
.Cast(
GetGame
().GetWorkspace().CreateWidgets(
m_sDotResource
,
m_wFrame
));
97
98
dot.SetColor(
m_DotMarkerEnt
.m_DotColor);
99
100
FrameSlot
.SetPos(dot, x, y);
101
102
m_aDots
.Insert(dot);
103
}
104
}
105
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
FrameSlot
Definition
FrameSlot.c:13
ImageWidget
Definition
ImageWidget.c:13
Math
Definition
Math.c:13
ResourceName
Definition
ResourceName.c:13
SCR_MapDotCircleHandler
Definition
SCR_MapDotCircleHandler.c:2
SCR_MapDotCircleHandler::m_aDots
ref array< Widget > m_aDots
Definition
SCR_MapDotCircleHandler.c:9
SCR_MapDotCircleHandler::m_MapEnt
SCR_MapEntity m_MapEnt
Definition
SCR_MapDotCircleHandler.c:8
SCR_MapDotCircleHandler::m_wFrame
Widget m_wFrame
Definition
SCR_MapDotCircleHandler.c:7
SCR_MapDotCircleHandler::CreateDots
void CreateDots()
Definition
SCR_MapDotCircleHandler.c:70
SCR_MapDotCircleHandler::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_MapDotCircleHandler.c:59
SCR_MapDotCircleHandler::SetImage
override void SetImage(ResourceName icon, string quad, float aspectRatio=1, int sizeFlag=64)
Definition
SCR_MapDotCircleHandler.c:26
SCR_MapDotCircleHandler::m_sDotResource
ResourceName m_sDotResource
Definition
SCR_MapDotCircleHandler.c:4
SCR_MapDotCircleHandler::m_fActualRadius
float m_fActualRadius
Definition
SCR_MapDotCircleHandler.c:6
SCR_MapDotCircleHandler::m_DotMarkerEnt
SCR_MapMarkerDotCircle m_DotMarkerEnt
Definition
SCR_MapDotCircleHandler.c:10
SCR_MapDotCircleHandler::OnMapZoom
void OnMapZoom(float ppu)
Definition
SCR_MapDotCircleHandler.c:15
SCR_MapDotCircleHandler::SetText
override void SetText(string text)
Definition
SCR_MapDotCircleHandler.c:36
SCR_MapDotCircleHandler::m_fEnlargement
float m_fEnlargement
Definition
SCR_MapDotCircleHandler.c:12
SCR_MapDotCircleHandler::SetMarkerEntity
override void SetMarkerEntity(notnull SCR_MapMarkerEntity marker)
Definition
SCR_MapDotCircleHandler.c:46
SCR_MapEntity
Definition
SCR_MapEntity.c:18
SCR_MapEntity::GetMapInstance
static SCR_MapEntity GetMapInstance()
Get map entity instance.
Definition
SCR_MapEntity.c:112
SCR_MapMarkerDynamicWComponent
Attached to root of marker dynamic base layout.
Definition
SCR_MapMarkerDynamicWComponent.c:3
SCR_MapMarkerDynamicWComponent::m_wMarkerText
TextWidget m_wMarkerText
Definition
SCR_MapMarkerDynamicWComponent.c:6
SCR_MapMarkerDynamicWComponent::m_wMarkerIcon
ImageWidget m_wMarkerIcon
Definition
SCR_MapMarkerDynamicWComponent.c:5
SCR_MapMarkerEntity
Definition
SCR_MapMarkerEntity.c:19
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
AirSupport
SCR_MapDotCircleHandler.c
Generated by
1.17.0