Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
EditablePrefabsLabel_Faction.c
Go to the documentation of this file.
3{
4 [Attribute()]
6
7 //------------------------------------------------------------------------------------------------
8 override bool GetLabelValid(WorldEditorAPI api, IEntitySource entitySource, IEntityComponentSource componentSource, string targetPath, EEditableEntityType entityType, notnull array<EEditableEntityLabel> authoredLabels, out EEditableEntityLabel label)
9 {
10 IEntityComponentSource factionComponentSource = SCR_BaseContainerTools.FindComponentSource(entitySource, FactionAffiliationComponent);
11 IEntityComponentSource factionControlComponentSource = SCR_BaseContainerTools.FindComponentSource(entitySource, SCR_FactionAffiliationComponent);
12 FactionKey factionKey = string.Empty;
13 if (factionComponentSource)
14 factionComponentSource.Get("faction affiliation", factionKey);
15 else if (factionControlComponentSource)
16 factionControlComponentSource.Get("m_DefaultFaction", factionKey);
17
18 // Check if faction was set through authored labels, override
19 bool factionLabelAuthored = authoredLabels.Contains(m_Label);
20 if (factionLabelAuthored)
21 factionKey = m_FactionToCheck;
22
23 if (factionKey != string.Empty && factionKey == m_FactionToCheck)
24 {
25 // Set faction on Editable Entity UIInfo, used for a lot of... ui info
26 array<ref ContainerIdPathEntry> UIInfoPath = { ContainerIdPathEntry(componentSource.GetClassName()), ContainerIdPathEntry("m_UIInfo") };
27 api.SetVariableValue(entitySource, UIInfoPath, "m_sFaction", m_FactionToCheck);
28 label = m_Label;
29
30 // Only add the auto label if faction label was not authored
31 return !factionLabelAuthored;
32 }
33
34 return false;
35 }
36}
void ContainerIdPathEntry(string propertyName, int index=-1)
Definition worldEditor.c:30
EEditableEntityLabel
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
override bool GetLabelValid(WorldEditorAPI api, IEntitySource entitySource, IEntityComponentSource componentSource, string targetPath, EEditableEntityType entityType, notnull array< EEditableEntityLabel > authoredLabels, out EEditableEntityLabel label)
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
SCR_FieldOfViewSettings Attribute