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_AssignedGroupLabelUIComponent.c
Go to the documentation of this file.
1
class
SCR_AssignedGroupLabelUIComponent
:
SCR_ScriptedWidgetComponent
2
{
3
[
Attribute
(
"{1228936E5DB30403}UI/Textures/GroupManagement/FlagIcons/GroupFlagsBlufor.imageset"
,
params
:
"layout"
)]
4
protected
ResourceName
m_sGroupsBLUFOR
;
5
6
[
Attribute
(
"{7CD99D22C7AE8195}UI/Textures/GroupManagement/FlagIcons/GroupFlagsOpfor.imageset"
,
params
:
"layout"
)]
7
protected
ResourceName
m_sGroupsOPFOR
;
8
9
[
Attribute
(
"{301FC1A2A46D3E0D}UI/Textures/GroupManagement/FlagIcons/GroupFlagsIndfor.imageset"
,
params
:
"layout"
)]
10
protected
ResourceName
m_sGroupsINDFOR
;
11
12
[
Attribute
(
"{D7E06968B5F9FC92}UI/Textures/GroupManagement/FlagIcons/GroupFlagsCivilian.imageset"
,
params
:
"layout"
)]
13
protected
ResourceName
m_sGroupsCIVILIAN
;
14
15
protected
ref
SCR_AssignedGroupLabelWidgets
m_Widgets
=
new
SCR_AssignedGroupLabelWidgets
();
16
17
protected
const
string
DEFAULT_ICON_NAME
=
"undefined"
;
18
protected
const
string
CUSTOM_GROUP_NAME_FORMAT
=
"#AR-Player_Groups_CustomName_Format"
;
19
20
//------------------------------------------------------------------------------------------------
21
override
void
HandlerAttached
(
Widget
w)
22
{
23
super.HandlerAttached(w);
24
25
m_Widgets
.Init(w);
26
}
27
28
//------------------------------------------------------------------------------------------------
29
void
LoadGroupFlag
(notnull
SCR_AIGroup
aiGroup)
30
{
31
SCR_GroupsManagerComponent
groupsManager =
SCR_GroupsManagerComponent
.GetInstance();
32
if
(!groupsManager)
33
return
;
34
35
ResourceName
flag = aiGroup.GetGroupFlag();
36
if
(flag.IsEmpty())
37
return
;
38
39
if
(aiGroup.GetFlagIsFromImageSet())
40
SetFlagButtonFromImageSet
(flag);
41
else
42
m_Widgets
.m_wGroupIcon.LoadImageTexture(0, flag,
false
,
false
);
43
}
44
45
//------------------------------------------------------------------------------------------------
48
protected
void
SetFlagButtonFromImageSet
(
string
name)
49
{
50
if
(name.IsEmpty())
51
return
;
52
53
SCR_FactionManager
factionManager =
SCR_FactionManager
.Cast(
GetGame
().GetFactionManager());
54
if
(!factionManager)
55
return
;
56
57
SCR_Faction
playerFaction =
SCR_Faction
.Cast(factionManager.GetLocalPlayerFaction());
58
if
(!playerFaction)
59
return
;
60
61
ResourceName
res = playerFaction.
GetGroupFlagImageSet
();
62
if
(!res)
63
return
;
64
65
m_Widgets
.m_wGroupIcon.LoadImageFromSet(0, res, name);
66
}
67
68
//------------------------------------------------------------------------------------------------
71
void
LoadGroupName
(notnull
SCR_AIGroup
aiGroup)
72
{
73
string
groupName = aiGroup.GetCustomNameWithOriginal();
74
string
company, platoon, squad, character, format;
75
aiGroup.GetCallsigns(company, platoon, squad, character, format);
76
77
if
(groupName.IsEmpty())
78
{
79
m_Widgets
.m_wGroupName.SetTextFormat(format, company, platoon, squad, character);
80
}
81
else
82
{
83
string
customName = aiGroup.GetCustomName().Trim();
84
85
if
(customName.IsEmpty())
86
m_Widgets
.m_wGroupName.SetTextFormat(format, company, platoon, squad, character);
87
else
88
m_Widgets
.m_wGroupName.SetText(
SCR_GroupHelperUI
.
GetTranslatedGroupName
(aiGroup));
89
}
90
}
91
92
//------------------------------------------------------------------------------------------------
94
void
SetGroupName
(
string
name)
95
{
96
if
(name.IsEmpty())
97
return
;
98
99
m_Widgets
.m_wGroupName.SetText(name);
100
}
101
102
//------------------------------------------------------------------------------------------------
103
void
SetGroupIcon
(
ResourceName
imageset,
string
iconName)
104
{
105
m_Widgets
.m_wGroupIcon.LoadImageFromSet(0, imageset, iconName);
106
}
107
108
//------------------------------------------------------------------------------------------------
112
void
SetGroupIconFromFaction
(
Faction
faction,
string
iconName =
string
.Empty)
113
{
114
if
(!iconName)
115
iconName =
DEFAULT_ICON_NAME
;
116
117
ResourceName
imageset;
118
switch
(faction.GetFactionKey())
119
{
120
case
"US"
:
121
{
122
imageset =
m_sGroupsBLUFOR
;
123
break
;
124
}
125
126
case
"USSR"
:
127
{
128
imageset =
m_sGroupsOPFOR
;
129
break
;
130
}
131
132
case
"FIA"
:
133
{
134
imageset =
m_sGroupsINDFOR
;
135
break
;
136
}
137
138
case
"CIV"
:
139
{
140
imageset =
m_sGroupsCIVILIAN
;
141
break
;
142
}
143
144
default
:
145
{
146
imageset =
m_sGroupsBLUFOR
;
147
}
148
}
149
150
m_Widgets
.m_wGroupIcon.LoadImageFromSet(0, imageset, iconName);
151
}
152
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupsManagerComponent.c:1747
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
Faction
Definition
Faction.c:13
ResourceName
Definition
ResourceName.c:13
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AssignedGroupLabelUIComponent
Definition
SCR_AssignedGroupLabelUIComponent.c:2
SCR_AssignedGroupLabelUIComponent::LoadGroupName
void LoadGroupName(notnull SCR_AIGroup aiGroup)
Definition
SCR_AssignedGroupLabelUIComponent.c:71
SCR_AssignedGroupLabelUIComponent::m_sGroupsOPFOR
ResourceName m_sGroupsOPFOR
Definition
SCR_AssignedGroupLabelUIComponent.c:7
SCR_AssignedGroupLabelUIComponent::DEFAULT_ICON_NAME
const string DEFAULT_ICON_NAME
Definition
SCR_AssignedGroupLabelUIComponent.c:17
SCR_AssignedGroupLabelUIComponent::m_Widgets
ref SCR_AssignedGroupLabelWidgets m_Widgets
Definition
SCR_AssignedGroupLabelUIComponent.c:15
SCR_AssignedGroupLabelUIComponent::LoadGroupFlag
void LoadGroupFlag(notnull SCR_AIGroup aiGroup)
Definition
SCR_AssignedGroupLabelUIComponent.c:29
SCR_AssignedGroupLabelUIComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_AssignedGroupLabelUIComponent.c:21
SCR_AssignedGroupLabelUIComponent::m_sGroupsCIVILIAN
ResourceName m_sGroupsCIVILIAN
Definition
SCR_AssignedGroupLabelUIComponent.c:13
SCR_AssignedGroupLabelUIComponent::SetFlagButtonFromImageSet
void SetFlagButtonFromImageSet(string name)
Definition
SCR_AssignedGroupLabelUIComponent.c:48
SCR_AssignedGroupLabelUIComponent::SetGroupIcon
void SetGroupIcon(ResourceName imageset, string iconName)
Definition
SCR_AssignedGroupLabelUIComponent.c:103
SCR_AssignedGroupLabelUIComponent::m_sGroupsBLUFOR
ResourceName m_sGroupsBLUFOR
Definition
SCR_AssignedGroupLabelUIComponent.c:4
SCR_AssignedGroupLabelUIComponent::SetGroupName
void SetGroupName(string name)
Definition
SCR_AssignedGroupLabelUIComponent.c:94
SCR_AssignedGroupLabelUIComponent::SetGroupIconFromFaction
void SetGroupIconFromFaction(Faction faction, string iconName=string.Empty)
Definition
SCR_AssignedGroupLabelUIComponent.c:112
SCR_AssignedGroupLabelUIComponent::m_sGroupsINDFOR
ResourceName m_sGroupsINDFOR
Definition
SCR_AssignedGroupLabelUIComponent.c:10
SCR_AssignedGroupLabelUIComponent::CUSTOM_GROUP_NAME_FORMAT
const string CUSTOM_GROUP_NAME_FORMAT
Definition
SCR_AssignedGroupLabelUIComponent.c:18
SCR_AssignedGroupLabelWidgets
Definition
SCR_AssignedGroupLabelWidgets.c:4
SCR_Faction
Definition
SCR_Faction.c:6
SCR_Faction::GetGroupFlagImageSet
ResourceName GetGroupFlagImageSet()
Definition
SCR_Faction.c:237
SCR_GroupHelperUI
Definition
SCR_GroupHelperUI.c:2
SCR_GroupHelperUI::GetTranslatedGroupName
static string GetTranslatedGroupName(notnull SCR_AIGroup group)
Definition
SCR_GroupHelperUI.c:9
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Tasks
SCR_AssignedGroupLabelUIComponent.c
Generated by
1.17.0