1 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"Manager of Command actions in editor!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
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;
17 protected ref ScriptInvoker Event_OnCurrentActionChanged =
new ScriptInvoker();
23 ScriptInvoker GetOnCurrentActionChanged()
25 return Event_OnCurrentActionChanged;
34 return action == m_CurrentAction;
42 m_CurrentAction = currentAction;
43 Event_OnCurrentActionChanged.Invoke();
50 void PerformDefaultAction(
bool isQueue)
59 array<ref SCR_EditorActionData> actions = {};
62 if (m_DefaultActionGroups.IsEmpty() || m_DefaultActionGroups.Contains(actions[i].GetAction().GetActionGroup()))
79 SetCurrentAction(action);
83 protected void OnPlacingSelectedPrefabChange(ResourceName prefab, ResourceName prefabPrev)
88 SetCurrentAction(
null);
92 override int ValidateSelection(
bool isInstant)
109 type = entity.GetEntityType();
127 override protected TraceFlags GetInstantActionTraceFlags()
129 return TraceFlags.WORLD | TraceFlags.OCEAN;
132 override bool ActionCanBeShown(
SCR_BaseEditorAction action, vector cursorWorldPosition,
int flags)
137 override bool ActionCanBePerformed(
SCR_BaseEditorAction action, vector cursorWorldPosition,
int flags)
142 override void EOnEditorActivate()
144 super.EOnEditorActivate();
148 placingManager.GetOnSelectedPrefabChange().Insert(OnPlacingSelectedPrefabChange);
150 override void EOnEditorDeactivate()
152 super.EOnEditorDeactivate();
156 placingManager.GetOnSelectedPrefabChange().Remove(OnPlacingSelectedPrefabChange);