Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlaceableEntitiesRegistryFromCatalog.c
Go to the documentation of this file.
1[BaseContainerProps(configRoot: true), BaseContainerCatalogPlacableEntitiesTitleField("m_eEditorMode", "m_eCatalogFactionType", "m_CatalogTypes")]
4
9{
10 [Attribute("0", desc: "The editor mode that the catalog entry has assigned", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EEditorMode))]
12
13 [Attribute("0", desc: "If the entries will be from factions, factionless or both", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(SCR_ECatalogFactionType))]
15
16 [Attribute("0", UIWidgets.SearchComboBox, "", enums: ParamEnumArray.FromEnum(EEntityCatalogType))]
17 protected ref array<ref EEntityCatalogType> m_CatalogTypes;
18
19 //------------------------------------------------------------------------------------------------
20 void Init()
21 {
22 if (m_CatalogTypes.IsEmpty())
23 return;
24
25 SCR_EntityCatalogManagerComponent catalogManager = SCR_EntityCatalogManagerComponent.GetInstance();
26 if (!catalogManager)
27 {
28 Print("SCR_PlaceableEntitiesRegistryFromCatalog cannot find SCR_EntityCatalogManagerComponent so can not initialize entries within Catalogs!", LogLevel.WARNING);
29 return;
30 }
31
32 foreach (EEntityCatalogType catalogType: m_CatalogTypes)
33 {
34 ProcessCatalog(catalogType, catalogManager);
35 }
36 }
37
38 //------------------------------------------------------------------------------------------------
39 void ProcessCatalog(EEntityCatalogType catalogType, notnull SCR_EntityCatalogManagerComponent catalogManager)
40 {
41 array<ResourceName> prefabs = {};
42
43 //~ Get correct filtered entities
44 if (m_eCatalogFactionType == SCR_ECatalogFactionType.FACTION_AND_FACTIONLESS)
45 catalogManager.GetFilteredEditorPrefabsOfAllFactions(catalogType, m_eEditorMode, prefabs, getFactionLessPrefabs: true);
46 else if (m_eCatalogFactionType == SCR_ECatalogFactionType.FACTIONS_ONLY)
47 catalogManager.GetFilteredEditorPrefabsOfAllFactions(catalogType, m_eEditorMode, prefabs, getFactionLessPrefabs: false);
48 else if (m_eCatalogFactionType == SCR_ECatalogFactionType.FACTIONLESS_ONLY)
49 catalogManager.GetFilteredEditorPrefabs(catalogType, m_eEditorMode, null, prefabs);
50
51 AddPrefabs(prefabs);
52 }
53
54 //------------------------------------------------------------------------------------------------
56 {
58 return;
59
60 Init();
61 }
62};
63
70
72{
73 protected string m_sEditorModeVar;
74 protected string m_sFactionTypeVar;
75 protected string m_sCatalogTypesListVar;
76
77 //------------------------------------------------------------------------------------------------
78 void BaseContainerCatalogPlacableEntitiesTitleField(string editorModeVar, string factionTypeVar, string catalogTypesListVar)
79 {
80 m_sEditorModeVar = editorModeVar;
81 m_sFactionTypeVar = factionTypeVar;
82 m_sCatalogTypesListVar = catalogTypesListVar;
83 }
84
85 //------------------------------------------------------------------------------------------------
86 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
87 {
88 EEditorMode editorMode;
89
90 if (!source.Get(m_sEditorModeVar, editorMode))
91 return false;
92
93 SCR_ECatalogFactionType factionType;
94
95 if (!source.Get(m_sFactionTypeVar, factionType))
96 return false;
97
98 array<EEntityCatalogType> catalogTypes = {};
99
100 if (!source.Get(m_sCatalogTypesListVar, catalogTypes))
101 return false;
102
103 title = "Catalog Getter (" + typename.EnumToString(EEditorMode, editorMode) + ")";
104
105 string categories = "MISSING CATALOGS!";
106
107 if (!catalogTypes.IsEmpty())
108 {
109 categories = string.Empty;
110
111 for (int i = 0, count = catalogTypes.Count(); i < count; i++)
112 {
113 if (i > 0)
114 categories += " & ";
115
116 categories += typename.EnumToString(EEntityCatalogType, catalogTypes[i]);
117 }
118 }
119
120 title += " - " + categories + " - " + typename.EnumToString(SCR_ECatalogFactionType, factionType);
121
122 return true;
123 }
124}
EEntityCatalogType
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
@ FACTIONS_ONLY
Get entries from factions only.
@ FACTION_AND_FACTIONLESS
Get entries from faction and factionless catalogs.
@ FACTIONLESS_ONLY
Get entries from factionless Only.
void BaseContainerCatalogPlacableEntitiesTitleField(string editorModeVar, string factionTypeVar, string catalogTypesListVar)
enum SCR_ECatalogFactionType m_sEditorModeVar
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static bool IsEditMode()
Definition Functions.c:1566
void ProcessCatalog(EEntityCatalogType catalogType, notnull SCR_EntityCatalogManagerComponent catalogManager)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
EEditorMode
Editor mode that defines overall functionality.
Definition EEditorMode.c:6
class SCR_BaseManualCameraComponent _WB_GetCustomTitle(BaseContainer source, out string title)