Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DuplicateContextAction.c
Go to the documentation of this file.
3{
4 private SCR_PlacingEditorComponent m_PlacingManager;
5 private ref set<SCR_EditableEntityComponent> m_Recipients = new set<SCR_EditableEntityComponent>;
6
7 override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
8 {
9 if (hoveredEntity == null || selectedEntities.Count() > 1)
10 {
11 return false;
12 }
13 if (!hoveredEntity.CanDuplicate(m_Recipients))
14 {
15 return false;
16 }
17
18 m_PlacingManager = SCR_PlacingEditorComponent.Cast(SCR_PlacingEditorComponent.GetInstance(SCR_PlacingEditorComponent, false, true));
19 return m_PlacingManager != null;
20 }
21
22 override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
23 {
24 return true;
25 }
26
27 override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
28 {
29 if(!m_PlacingManager)
30 {
31 return;
32 }
33
34 m_Recipients.Clear();
35 EntityPrefabData hoveredPrefabData = hoveredEntity.GetOwner().GetPrefabData();
36 if (hoveredPrefabData && hoveredEntity.CanDuplicate(m_Recipients))
37 {
38 m_PlacingManager.SetSelectedPrefab(hoveredPrefabData.GetPrefabName(), false, true, m_Recipients);
39 }
40 }
41};
SCR_EAIThreatSectorFlags flags
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
bool CanDuplicate(out notnull set< SCR_EditableEntityComponent > outRecipients)