Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_GroupPreset.c
Go to the documentation of this file.
2class SCR_GroupPreset : BaseContainerObject
3{
4 [Attribute("1")]
5 protected bool m_bIsEnabled;
6
7 [Attribute(desc: "Name of the Group")]
8 protected string m_sGroupName;
9
10 [Attribute(defvalue:"0", uiwidget: UIWidgets.ComboBox, desc: "Group role", params: "", enumType: SCR_EGroupRole)]
12
13 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Flag icon of this particular group.", params: "edds")]
14 private ResourceName m_sGroupFlag;
15
16 [Attribute(desc: "Name of item in imageset")]
17 protected string m_sGroupFlagName;
18
19 [Attribute(desc: "Description of the Group")]
20 protected string m_sGroupDescription;
21
22 [Attribute(desc: "Max number of players in this group where 0 means infinite members", params: "0 inf")]
23 protected int m_iGroupSize;
24
25 [Attribute(desc: "Radio frequency for communication in kHz.")]
26 protected int m_iRadioFrequency;
27
28 [Attribute("0", params: "0 inf", desc: "Index of default active radio channel of group")]
30
31 [Attribute(defvalue: SCR_ECharacterRank.PRIVATE.ToString(), uiwidget: UIWidgets.ComboBox, desc: "Rank required to create and join the group", params: "", enumType: SCR_ECharacterRank)]
32 protected SCR_ECharacterRank m_eRequiredRank;
33
34 [Attribute(desc: "Group is private.")]
35 protected bool m_bIsPrivate;
36
37 [Attribute("1", desc: "Is privacy changeable")]
38 protected bool m_bIsPrivacyChangeable;
39
40 //------------------------------------------------------------------------------------------------
42 {
50
51 if (!m_sGroupFlag.IsEmpty())
52 group.SetCustomGroupFlag(m_sGroupFlag);
53 }
54
55 //------------------------------------------------------------------------------------------------
58 void SetupGroupWithOverride(SCR_AIGroup group, SCR_GroupPreset overridingGroupPreset)
59 {
60 if (!overridingGroupPreset.m_sGroupName.IsEmpty())
61 group.SetCustomName(overridingGroupPreset.m_sGroupName, 0);
62 else
64
65 if (overridingGroupPreset.m_iRadioFrequency > 0)
66 group.SetRadioFrequency(overridingGroupPreset.m_iRadioFrequency);
67 else
69
70 if (overridingGroupPreset.m_iGroupSize > 0)
71 group.SetMaxGroupMembers(overridingGroupPreset.m_iGroupSize);
72 else
74
75 if (overridingGroupPreset.m_bIsPrivate)
76 group.SetPrivate(overridingGroupPreset.m_bIsPrivate);
77 else
79
80 if (!overridingGroupPreset.m_sGroupDescription.IsEmpty())
81 group.SetCustomDescription(overridingGroupPreset.m_sGroupDescription, 0);
82 else
84
85 if (!overridingGroupPreset.GetGroupFlag().IsEmpty())
86 group.SetCustomGroupFlag(overridingGroupPreset.GetGroupFlag());
87 else if (!GetGroupFlag().IsEmpty())
89
90 if (!overridingGroupPreset.m_bIsPrivacyChangeable)
91 group.SetPrivacyChangeable(overridingGroupPreset.m_bIsPrivacyChangeable);
92 else
94
95 if (overridingGroupPreset.GetRequiredRank() != SCR_ECharacterRank.INVALID)
96 group.SetRequiredRank(overridingGroupPreset.m_eRequiredRank);
97 else
99
100 if (overridingGroupPreset.GetDefaultActiveRadioChannel() > 0)
101 group.SetDefaultActiveRadioChannel(overridingGroupPreset.GetDefaultActiveRadioChannel());
102 else
104 }
105
106 //------------------------------------------------------------------------------------------------
110 {
111 if (!GetDefaultGroupFlagName().IsEmpty() && !faction.GetGroupFlagImageSet().IsEmpty())
112 {
113 array<string> flagNames = {};
114 faction.GetFlagNames(flagNames);
115 group.SetGroupFlag(flagNames.Find(GetDefaultGroupFlagName()), !faction.GetGroupFlagImageSet().IsEmpty());
116 }
117 else
118 {
119 if (group.GetGroupFlag().IsEmpty())
120 group.SetGroupFlag(0, !faction.GetGroupFlagImageSet().IsEmpty());
121 }
122 }
123
124 //Getters
125 //------------------------------------------------------------------------------------------------
127 {
128 return m_sGroupName;
129 }
130
131 //------------------------------------------------------------------------------------------------
133 {
134 return m_bIsEnabled;
135 }
136
137 //------------------------------------------------------------------------------------------------
139 {
140 return m_sGroupFlag;
141 }
142
143 //------------------------------------------------------------------------------------------------
145 {
146 return m_iGroupSize;
147 }
148
149 //------------------------------------------------------------------------------------------------
151 {
152 return m_iRadioFrequency;
153 }
154
155 //------------------------------------------------------------------------------------------------
160
161 //------------------------------------------------------------------------------------------------
163 {
164 return m_sGroupDescription;
165 }
166
167 //------------------------------------------------------------------------------------------------
169 {
170 return m_bIsPrivate;
171 }
172
173 //------------------------------------------------------------------------------------------------
175 {
177 }
178
179 //------------------------------------------------------------------------------------------------
182 {
183 return m_eGroupRole;
184 }
185
186 //------------------------------------------------------------------------------------------------
189 {
190 return m_sGroupFlagName;
191 }
192
193 //------------------------------------------------------------------------------------------------
195 SCR_ECharacterRank GetRequiredRank()
196 {
197 return m_eRequiredRank;
198 }
199
200 //Setters
201 //------------------------------------------------------------------------------------------------
202
203 void SetGroupName(string name)
204 {
205 m_sGroupName = name;
206 }
207
208 //------------------------------------------------------------------------------------------------
210 {
212 }
213
214 //------------------------------------------------------------------------------------------------
215 void SetRadioFrequency(int freq)
216 {
217 m_iRadioFrequency = freq;
218 }
219
220 //------------------------------------------------------------------------------------------------
221 void SetIsPrivate(bool privacy)
222 {
223 m_bIsPrivate = privacy;
224 }
225}
int size
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_EGroupRole
Group roles.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SetCustomDescription(string desc, int authorID)
called on server only
void SetCustomName(string name, int authorID)
void SetRadioFrequency(int frequency)
void SetRequiredRank(SCR_ECharacterRank rank)
void SetPrivate(bool isPrivate)
Called on the server (authority).
void SetPrivacyChangeable(bool IsPrivacyChangeable)
void SetGroupFlag(int flagIndex, bool isFromImageset)
called on server only
void SetMaxGroupMembers(int value)
void SetCustomGroupFlag(ResourceName flag)
void SetDefaultActiveRadioChannel(int id)
ResourceName GetGroupFlag()
ResourceName GetGroupFlagImageSet()
int GetFlagNames(out array< string > flagNames)
ResourceName GetGroupFlag()
SCR_EGroupRole GetGroupRole()
int GetDefaultActiveRadioChannel()
void SetGroupSize(int size)
void SetIsPrivate(bool privacy)
SCR_ECharacterRank GetRequiredRank()
string GetDefaultGroupFlagName()
void SetGroupName(string name)
void SetRadioFrequency(int freq)
void SetupGroup(SCR_AIGroup group)
SCR_ECharacterRank m_eRequiredRank
string GetGroupDescription()
SCR_EGroupRole m_eGroupRole
void SetupGroupFlag(SCR_AIGroup group, SCR_Faction faction)
void SetupGroupWithOverride(SCR_AIGroup group, SCR_GroupPreset overridingGroupPreset)
SCR_FieldOfViewSettings Attribute
proto native bool IsEmpty()