Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBuildingCompositionOutlineRegistry.c
Go to the documentation of this file.
1// Here is define which layout prefab belongs to given editable entity and how long it takes to build up the composition.
2// The Value is kind of abstract as it's not a cost of the composition or the time needed.
3// It depends on other setup like how much of this value is added by one usage of building tool or how many players at the same time are using their tool to build the composition.
4
7{
8 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Composition layout fits to a small (flat) slot size.", "et")]
10
11 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Composition layout fits to a medium (flat) slot size.", "et")]
13
14 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Composition layout fits to a large (flat) slot size.", "et")]
16
17 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Composition layout fits to a small (road) slot size.", "et")]
19
20 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Composition layout fits to a medium (road) slot size.", "et")]
22
23 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Composition layout fits to a large (road) slot size.", "et")]
25
26 [Attribute()]
27 protected ref array<ref SCR_CampaignBuildingCompositionOutline> m_aCompositionLayouts;
28
29 static const int DEFAULT_BUILDING_VALUE = 50;
30
31 //------------------------------------------------------------------------------------------------
34 {
35 IEntity composition = entity.GetOwner();
36 if (!composition)
37 return ResourceName.Empty;
38
39 ResourceName compositionResourceName = composition.GetPrefabData().GetPrefabName();
40 if (compositionResourceName.IsEmpty())
41 return ResourceName.Empty;
42
44 {
45 if (compositionLayout.GetEditableEntity() == compositionResourceName)
46 return compositionLayout.GetCompositionLayout();
47 }
48
49 // If there wasn't found a specific layout for a given composition, load the one set for a specific slot.
50 SCR_EditableEntityUIInfo editableEntityUIInfo = SCR_EditableEntityUIInfo.Cast(entity.GetInfo());
51 if (!editableEntityUIInfo)
52 return ResourceName.Empty;
53
54 if (editableEntityUIInfo.HasEntityLabel(EEditableEntityLabel.SLOT_FLAT_SMALL))
56 else if (editableEntityUIInfo.HasEntityLabel(EEditableEntityLabel.SLOT_FLAT_MEDIUM))
58 else if (editableEntityUIInfo.HasEntityLabel(EEditableEntityLabel.SLOT_FLAT_LARGE))
60 else if (editableEntityUIInfo.HasEntityLabel(EEditableEntityLabel.SLOT_ROAD_SMALL))
62 else if (editableEntityUIInfo.HasEntityLabel(EEditableEntityLabel.SLOT_ROAD_MEDIUM))
64 else if (editableEntityUIInfo.HasEntityLabel(EEditableEntityLabel.SLOT_ROAD_LARGE))
66 // if the slot size wasn't set, use fail safe.
68 }
69
70 //------------------------------------------------------------------------------------------------
73 {
75 {
76 if (compositionLayout.GetEditableEntity() == originalComposition)
77 return compositionLayout.GetBuildingValue();
78 }
79
81 }
82};
83
86{
87 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Editable entity prefab", "et")]
89
90 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Layout prefab", "et")]
92
93 [Attribute("50", "Defines how long it takes to build up the composition.", "")]
94 protected int m_iBuildingValue;
95
96 //------------------------------------------------------------------------------------------------
101
102 //------------------------------------------------------------------------------------------------
107
108 //------------------------------------------------------------------------------------------------
110 {
111 return m_iBuildingValue;
112 }
113}
EEditableEntityLabel
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
proto external EntityPrefabData GetPrefabData()
ResourceName GetCompositionOutline(notnull SCR_EditableEntityComponent entity)
Search all SCR_CampaignBuildingCompositionLayoutManager entry and try to find a matching composition....
ref array< ref SCR_CampaignBuildingCompositionOutline > m_aCompositionLayouts
int GetCompositionBuildingValue(ResourceName originalComposition)
Search all SCR_CampaignBuildingCompositionLayoutManager entry and try to find a building value for gi...
bool HasEntityLabel(EEditableEntityLabel label)
SCR_FieldOfViewSettings Attribute