Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseCommandAction.c
Go to the documentation of this file.
3{
4 [Attribute("", UIWidgets.ResourcePickerThumbnail, "Objective or waypoint prefab", "et")]
6
7 //------------------------------------------------------------------------------------------------
12
13 //------------------------------------------------------------------------------------------------
14 protected void FilterEntities(notnull set<SCR_EditableEntityComponent> inEntities, out notnull set<SCR_EditableEntityComponent> outEntities)
15 {
16 outEntities.Copy(inEntities);
17 }
18
19 //------------------------------------------------------------------------------------------------
20 protected set<SCR_EditableEntityComponent> GetSelectedEntities(notnull set<SCR_EditableEntityComponent> inEntities)
21 {
22 set<SCR_EditableEntityComponent> selectedEnities = new set<SCR_EditableEntityComponent>();
23 FilterEntities(inEntities, selectedEnities);
24 return selectedEnities;
25 }
26
27 //------------------------------------------------------------------------------------------------
28 //--- Called from command toolbar, initiates placing mode
29 bool StartPlacing(notnull set<SCR_EditableEntityComponent> selectedEntities)
30 {
32 if (!placingManager)
33 return false;
34
35 return placingManager.SetSelectedPrefab(m_CommandPrefab, recipients: GetSelectedEntities(selectedEntities), sourceAction: this);
36 }
37
38 //------------------------------------------------------------------------------------------------
39 //--- Called from radial menu, places the command instantly
40 override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags, int param = -1)
41 {
42 if (cursorWorldPosition == vector.Zero)
43 return;
44
46 if (!placingManager)
47 return;
48
49 bool isQueue = flags & EEditorCommandActionFlags.IS_QUEUE;
50
51 vector transform[4];
52 Math3D.MatrixIdentity3(transform);
53 transform[3] = cursorWorldPosition;
55
56 //++ If the flags is to attach, use the hovered entity as the holder for the spawned entity
57 SCR_EditableEntityComponent holder = null;
59 holder = hoveredEntity;
60
61 placingManager.CreateEntity(m_CommandPrefab, params, !isQueue, false, GetSelectedEntities(selectedEntities), holder, this);
62 }
63
64 //------------------------------------------------------------------------------------------------
65 protected void OnCurrentActionChanged()
66 {
68 if (commandActionsManager)
69 Toggle(0, commandActionsManager.IsActionCurrent(this))
70 }
71
72 //------------------------------------------------------------------------------------------------
73 override void Track()
74 {
76 if (commandActionsManager)
77 {
78 commandActionsManager.GetOnCurrentActionChanged().Insert(OnCurrentActionChanged);
80 }
81 }
82
83 //------------------------------------------------------------------------------------------------
84 override void Untrack()
85 {
87 if (commandActionsManager)
88 commandActionsManager.GetOnCurrentActionChanged().Remove(OnCurrentActionChanged);
89 }
90
91 //------------------------------------------------------------------------------------------------
92 override bool IsServer()
93 {
94 //--- Must be called on client, placing handles server communication itself
95 return false;
96 }
97}
SCR_EAIThreatSectorFlags flags
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
void Toggle()
Toggle hint. Hide it if it's shown, and open it again if it's hidden.
override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
bool StartPlacing(notnull set< SCR_EditableEntityComponent > selectedEntities)
set< SCR_EditableEntityComponent > GetSelectedEntities(notnull set< SCR_EditableEntityComponent > inEntities)
void FilterEntities(notnull set< SCR_EditableEntityComponent > inEntities, out notnull set< SCR_EditableEntityComponent > outEntities)
bool IsActionCurrent(SCR_BaseEditorAction action)
Network packet of variables for entity placing and transformation.
static SCR_EditorPreviewParams CreateParams(vector transform[4], RplId parentID=Replication.INVALID_ID, EEditorTransformVertical verticalMode=EEditorTransformVertical.SEA, bool isUnderwater=false, SCR_EditableEntityComponent target=null, EEditableEntityInteraction targetInteraction=EEditableEntityInteraction.NONE)
bool SetSelectedPrefab(ResourceName prefab="", bool onConfirm=false, bool showBudgetMaxNotification=true, set< SCR_EditableEntityComponent > recipients=null, SCR_BaseEditorAction sourceAction=null)
bool CreateEntity(bool unselectPrefab=true, bool canBePlayer=false, SCR_EditableEntityComponent holder=null, SCR_BaseEditorAction sourceAction=null)
SCR_FieldOfViewSettings Attribute
EEditorCommandActionFlags
Simplified action conditions.