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_MANW_RankComponent.c
Go to the documentation of this file.
1
class
SCR_MANW_RankComponent
:
SCR_ScriptedWidgetComponent
2
{
3
protected
const
string
IMAGESET_AWARD
=
"{402BB92E44897D60}UI/Textures/MANW2025/CupRanks.imageset"
;
4
5
protected
ref
SCR_MANW_RankLabelWidgets
m_Widgets
=
new
SCR_MANW_RankLabelWidgets
();
6
7
[
Attribute
(
""
)]
8
protected
ref array<ref SCR_MANW_RankCategoryData>
m_aAwardCategories
;
9
protected
ref
map<string, string>
m_MapAwardCategories
;
10
11
[
Attribute
(
""
)]
12
protected
ref array<ref SCR_MANW_RankIconData>
m_aAwardIcons
;
13
14
[
Attribute
(
""
)]
15
protected
ref array<ref SCR_MANW_RankTagCategoryData>
m_aTagCategoryData
;
16
protected
ref
map<string, string>
m_MapTagCategoryData
;
17
18
[
Attribute
(
""
)]
19
protected
ref array<ref SCR_MANW_RankTagRankData>
m_aTagRankData
;
20
protected
ref
map<string, int>
m_MapTagRankData
;
21
22
//------------------------------------------------------------------------------------------------
23
override
void
HandlerAttached
(
Widget
w)
24
{
25
super.HandlerAttached(w);
26
27
if
(!
GetGame
().InPlayMode())
28
return
;
29
30
m_Widgets
.Init(
m_wRoot
);
31
m_wRoot
.SetVisible(
false
);
32
33
m_MapAwardCategories
=
new
map<string, string>
();
34
foreach
(SCR_MANW_RankCategoryData rankCategory :
m_aAwardCategories
)
35
{
36
m_MapAwardCategories
.Insert(rankCategory.m_sIdentifier, rankCategory.m_sName);
37
}
38
39
m_MapTagCategoryData
=
new
map<string, string>
();
40
foreach
(SCR_MANW_RankTagCategoryData tagCategoryData :
m_aTagCategoryData
)
41
{
42
m_MapTagCategoryData
.Insert(tagCategoryData.m_sTagName, tagCategoryData.m_sCategoryName);
43
}
44
45
m_MapTagRankData
=
new
map<string, int>
();
46
foreach
(
SCR_MANW_RankTagRankData
tagRankData :
m_aTagRankData
)
47
{
48
m_MapTagRankData
.Insert(tagRankData.m_sTagName, tagRankData.m_sRankId);
49
}
50
}
51
52
//------------------------------------------------------------------------------------------------
53
void
UpdateAwards
(notnull
SCR_WorkshopItem
workshopItem)
54
{
55
string
category
;
56
int
place;
57
if
(!
GetAwardData
(workshopItem,
category
, place))
58
{
59
m_wRoot
.SetVisible(
false
);
60
}
61
else
62
{
63
m_wRoot
.SetVisible(
true
);
64
65
m_Widgets
.m_wRankIcon.LoadImageFromSet(0,
IMAGESET_AWARD
,
m_aAwardIcons
[place - 1].
m_sName
);
66
m_Widgets
.m_wRankIcon.SetColor(
m_aAwardIcons
[place - 1].
m_Color
);
67
68
m_Widgets
.m_wCategoryText.SetText(
m_MapAwardCategories
.Get(
category
));
69
}
70
}
71
72
//------------------------------------------------------------------------------------------------
73
protected
bool
GetAwardData
(notnull
SCR_WorkshopItem
workshopItem, out
string
category
, out
int
place)
74
{
75
bool
hasCategory, hasRank;
76
string
categoryOutput;
77
int
placeOutput;
78
array<WorkshopTag> items = {};
79
workshopItem.GetWorkshopItem().GetTags(items);
80
foreach
(
WorkshopTag
item : items)
81
{
82
if
(!hasCategory)
83
{
84
if
(
m_MapTagCategoryData
.Find(item.Name(), categoryOutput))
85
{
86
category
= categoryOutput;
87
hasCategory =
true
;
88
}
89
}
90
91
if
(!hasRank)
92
{
93
if
(
m_MapTagRankData
.Find(item.Name(), placeOutput))
94
{
95
place = placeOutput;
96
hasRank =
true
;
97
}
98
}
99
100
if
(hasCategory && hasRank)
101
return
true
;
102
}
103
104
return
false
;
105
}
106
}
107
108
[
BaseContainerProps
(configRoot :
true
)]
109
class
SCR_MANW_RankCategoryData
110
{
111
[
Attribute
(
""
)]
112
string
m_sIdentifier
;
113
114
[
Attribute
(
""
)]
115
string
m_sName
;
116
}
117
118
[
BaseContainerProps
(configRoot :
true
)]
119
class
SCR_MANW_RankIconData
120
{
121
[
Attribute
(
""
)]
122
string
m_sName
;
123
124
[
Attribute
(
""
)]
125
ref
Color
m_Color
;
126
}
127
128
[
BaseContainerProps
(configRoot :
true
)]
129
class
SCR_MANW_RankTagCategoryData
130
{
131
[
Attribute
(
""
)]
132
string
m_sTagName;
133
134
[
Attribute
(
""
)]
135
string
m_sCategoryName;
136
}
137
138
[
BaseContainerProps
(configRoot :
true
)]
139
class
SCR_MANW_RankTagRankData
140
{
141
[
Attribute
(
""
)]
142
string
m_sTagName;
143
144
[
Attribute
(
""
)]
145
int
m_sRankId;
146
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
m_Color
ref Color m_Color
Definition
SCR_GeneratorBaseEntity.c:25
m_sName
LocalizedString m_sName
Definition
SCR_GroupIdentityComponent.c:19
m_Color
ref Color m_Color
Definition
SCR_MANW_RankComponent.c:133
m_sName
string m_sName
Definition
SCR_MANW_RankComponent.c:130
m_sIdentifier
string m_sIdentifier
Definition
SCR_MapMarkerEntryPlaced.c:1
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Color
Definition
Color.c:13
SCR_MANW_RankComponent
Definition
SCR_MANW_RankComponent.c:2
SCR_MANW_RankComponent::m_aAwardIcons
ref array< ref SCR_MANW_RankIconData > m_aAwardIcons
Definition
SCR_MANW_RankComponent.c:12
SCR_MANW_RankComponent::UpdateAwards
void UpdateAwards(notnull SCR_WorkshopItem workshopItem)
Definition
SCR_MANW_RankComponent.c:53
SCR_MANW_RankComponent::m_aTagCategoryData
ref array< ref SCR_MANW_RankTagCategoryData > m_aTagCategoryData
Definition
SCR_MANW_RankComponent.c:15
SCR_MANW_RankComponent::m_Widgets
ref SCR_MANW_RankLabelWidgets m_Widgets
Definition
SCR_MANW_RankComponent.c:5
SCR_MANW_RankComponent::IMAGESET_AWARD
const string IMAGESET_AWARD
Definition
SCR_MANW_RankComponent.c:3
SCR_MANW_RankComponent::GetAwardData
bool GetAwardData(notnull SCR_WorkshopItem workshopItem, out string category, out int place)
Definition
SCR_MANW_RankComponent.c:73
SCR_MANW_RankComponent::m_MapTagRankData
ref map< string, int > m_MapTagRankData
Definition
SCR_MANW_RankComponent.c:20
SCR_MANW_RankComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_MANW_RankComponent.c:23
SCR_MANW_RankComponent::m_MapTagCategoryData
ref map< string, string > m_MapTagCategoryData
Definition
SCR_MANW_RankComponent.c:16
SCR_MANW_RankComponent::m_aAwardCategories
ref array< ref SCR_MANW_RankCategoryData > m_aAwardCategories
Definition
SCR_MANW_RankComponent.c:8
SCR_MANW_RankComponent::m_MapAwardCategories
ref map< string, string > m_MapAwardCategories
Definition
SCR_MANW_RankComponent.c:9
SCR_MANW_RankComponent::m_aTagRankData
ref array< ref SCR_MANW_RankTagRankData > m_aTagRankData
Definition
SCR_MANW_RankComponent.c:19
SCR_MANW_RankIconData
Definition
SCR_MANW_RankComponent.c:120
SCR_MANW_RankLabelWidgets
Definition
SCR_MANW_RankLabelWidgets.c:4
SCR_MANW_RankTagRankData
Definition
SCR_MANW_RankComponent.c:140
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_WorkshopItem
Definition
SCR_WorkshopItem.c:28
Widget
Definition
Widget.c:13
WorkshopTag
Definition
WorkshopTag.c:15
map
Definition
Types.c:486
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
MANW2025
SCR_MANW_RankComponent.c
Generated by
1.17.0