7 protected ref ScriptInvoker Event_OnCommandStateChange =
new ScriptInvoker();
20 ScriptInvoker GetOnCommandStateChange()
22 return Event_OnCommandStateChange;
26 protected void PerformDefaultCommand(
bool isQueue)
28 OnOpenActionsMenuDown();
29 if (!OnCancelUp() || IsContextMenuOpen())
32 m_CommandActionsComponent.PerformDefaultAction(isQueue);
36 protected void OnEditorSetCommand()
38 PerformDefaultCommand(
false);
42 protected void OnEditorAddCommand()
44 PerformDefaultCommand(
true);
48 protected void OnEditorCommandModifier(
float value, EActionTrigger reason)
50 if (reason == EActionTrigger.DOWN)
53 m_Filter.GetOnChanged().Insert(OnSelectedChanged);
58 m_Filter.GetOnChanged().Remove(OnSelectedChanged);
63 protected void OnSelectedChanged(
EEditableEntityState state, set<SCR_EditableEntityComponent> entitiesInsert, set<SCR_EditableEntityComponent> entitiesRemove)
69 protected void UpdateState(
bool clear =
false)
75 m_State = m_CommandActionsComponent.ValidateSelection(
false);
77 Event_OnCommandStateChange.Invoke(
m_State);
81 private void OnMenuUpdate(
float tDelta)
89 override void HandlerAttachedScripted(Widget w)
91 super.HandlerAttachedScripted(w);
95 if (!m_CommandActionsComponent)
100 m_InputManager.AddActionListener(
"EditorSetCommand", EActionTrigger.DOWN, OnEditorSetCommand);
101 m_InputManager.AddActionListener(
"EditorAddCommand", EActionTrigger.DOWN, OnEditorAddCommand);
103 m_InputManager.AddActionListener(
"EditorCommandModifier", EActionTrigger.DOWN, OnEditorCommandModifier);
104 m_InputManager.AddActionListener(
"EditorCommandModifier", EActionTrigger.UP, OnEditorCommandModifier);
113 menu.GetOnMenuUpdate().Insert(OnMenuUpdate);
117 override void HandlerDeattached(Widget w)
119 super.HandlerDeattached(w);
123 m_InputManager.RemoveActionListener(
"EditorSetCommand", EActionTrigger.DOWN, OnEditorSetCommand);
124 m_InputManager.RemoveActionListener(
"EditorAddCommand", EActionTrigger.DOWN, OnEditorAddCommand);
126 m_InputManager.RemoveActionListener(
"EditorCommandModifier", EActionTrigger.DOWN, OnEditorCommandModifier);
127 m_InputManager.RemoveActionListener(
"EditorCommandModifier", EActionTrigger.UP, OnEditorCommandModifier);
131 m_Filter.GetOnChanged().Remove(OnSelectedChanged);
137 menu.GetOnMenuUpdate().Remove(OnMenuUpdate);