Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CommandActionsEditorComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Editor", description: "Manager of Command actions in editor!", icon: "WBData/ComponentEditorProps/componentEditor.png")]
5
10class SCR_CommandActionsEditorComponent : SCR_BaseActionsEditorComponent
11{
12 [Attribute("", uiwidget: UIWidgets.ComboBox, "When placing command instantly (e.g., Alt+RMB), choose the first action in one of these groups.\nWhen empty, all groups will be considered.", category: "Editor Command Actions", enums: ParamEnumArray.FromEnum(EEditorActionGroup))]
13 protected ref array<EEditorActionGroup> m_DefaultActionGroups;
14
16
18
27
33 {
34 return action == m_CurrentAction;
35 }
36
41 {
42 m_CurrentAction = currentAction;
44 }
45
50 void PerformDefaultAction(bool isQueue)
51 {
53 if (isQueue)
54 {
56 }
57
59 array<ref SCR_EditorActionData> actions = {};
60 for (int i = 0, count = GetAndEvaluateActions(position, actions); i < count; i++)
61 {
62 if (m_DefaultActionGroups.IsEmpty() || m_DefaultActionGroups.Contains(actions[i].GetAction().GetActionGroup()))
63 {
64 SCR_BaseEditorAction action = actions[i].GetAction();
66 break;
67 }
68 }
69 }
70
75 {
76 SCR_BaseCommandAction commandAction = SCR_BaseCommandAction.Cast(action);
77 if (commandAction && commandAction.StartPlacing(m_SelectedEntities))
78 {
79 SetCurrentAction(action);
80 }
81 }
82
83 protected void OnPlacingSelectedPrefabChange(ResourceName prefab, ResourceName prefabPrev)
84 {
85 //--- Reset variables when placing ends
86 if (!prefab.IsEmpty())
87 return;
88
89 SetCurrentAction(null);
90 }
91
92 override int ValidateSelection(bool isInstant)
93 {
95 m_HoveredEntity = m_HoverManager.GetFirstEntity();
96 else
97 m_HoveredEntity = null;
98
101 else
102 m_SelectedEntities.Clear();
103
106 bool isTaskManager = SCR_TaskSystem.GetInstance() != null;
108 {
109 type = entity.GetEntityType();
110
111 //--- At least one group is selected
112 if (entity.GetAIGroup() && !(flags & EEditorCommandActionFlags.OBJECTIVE))
113 {
115 }
116
117 //--- A faction is selected (placing objectives in that case)
118 if (isTaskManager && type == EEditableEntityType.FACTION)// || entity.HasEntityState(EEditableEntityState.PLAYER))
119 {
122 }
123 }
124
125 return flags;
126 }
128 {
129 return TraceFlags.WORLD | TraceFlags.OCEAN;
130 }
131
132 override bool ActionCanBeShown(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
133 {
134 return action.GetInfo() && action.CanBeShown(m_HoveredEntity, m_SelectedEntities, cursorWorldPosition, flags);
135 }
136
137 override bool ActionCanBePerformed(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
138 {
139 return action.CanBePerformed(m_HoveredEntity, m_SelectedEntities, cursorWorldPosition, flags);
140 }
141
142 override void EOnEditorActivate()
143 {
144 super.EOnEditorActivate();
145
147 if (placingManager)
149 }
150 override void EOnEditorDeactivate()
151 {
152 super.EOnEditorDeactivate();
153
155 if (placingManager)
157 }
158};
SCR_EAIThreatSectorFlags flags
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseActionsEditorComponentClass m_HoverManager
SCR_EditableEntityComponent m_HoveredEntity
void ActionPerformInstantly(SCR_BaseEditorAction action, int flags=0)
SCR_BaseEditableEntityFilter m_SelectedManager
int GetAndEvaluateActions(vector cursorWorldPosition, out notnull array< ref SCR_EditorActionData > filteredActions, out int flags=0)
ref set< SCR_EditableEntityComponent > m_SelectedEntities
EEditorActionGroup
EDamageType type
vector position
void SCR_BaseActionsEditorComponentClass(IEntityComponentSource componentSource, IEntitySource parentSource, IEntitySource prefabSource)
bool StartPlacing(notnull set< SCR_EditableEntityComponent > selectedEntities)
bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
bool IsActionCurrent(SCR_BaseEditorAction action)
void SetCurrentAction(SCR_BaseEditorAction currentAction)
void OnPlacingSelectedPrefabChange(ResourceName prefab, ResourceName prefabPrev)
ref array< EEditorActionGroup > m_DefaultActionGroups
override bool ActionCanBePerformed(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
override bool ActionCanBeShown(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
void StartPlacing(SCR_BaseEditorAction action)
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
SCR_FieldOfViewSettings Attribute
EEditorCommandActionFlags
Simplified action conditions.
TraceFlags
Definition TraceFlags.c:13
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134