4 protected string m_sSoundOnOpen;
7 protected string m_sSoundOnCancelClose;
10 protected bool m_bEditorIsSelectingState =
true;
15 protected void OnHoveredEntityCheck(
float tDelta)
17 if (!m_HoveredEntityReference)
20 GetMenu().GetOnMenuUpdate().Remove(OnHoveredEntityCheck);
25 override protected void PopulateContextMenu(vector cursorWorldPosition)
27 super.PopulateContextMenu(cursorWorldPosition);
29 if (m_HoveredEntityReference)
31 GetMenu().GetOnMenuUpdate().Insert(OnHoveredEntityCheck);
34 if (m_HoveredEntityReference.GetOnUIRefresh())
35 m_HoveredEntityReference.GetOnUIRefresh().Insert(CloseContextMenu);
40 override protected void OnEditorModeChanged()
46 protected override void OpenContextMenu()
48 super.OpenContextMenu();
55 override void CloseContextMenu()
58 GetGame().GetCallqueue().CallLater(DelayedCloseSound, 100);
60 if (m_HoveredEntityReference)
62 GetMenu().GetOnMenuUpdate().Remove(OnHoveredEntityCheck);
63 m_HoveredEntityReference =
null;
66 super.CloseContextMenu();
70 protected void DelayedCloseSound()
72 if (!IsContextMenuOpen())
77 protected void OnOpenActionsMenuUp()
80 if (!OnCancelUp() || IsContextMenuOpen() || !m_bEditorIsSelectingState)
83 m_bEditorIsSelectingState =
true;
92 protected override void OnOpenActionsMenuDown()
94 super.OnOpenActionsMenuDown();
98 if (statesManager && statesManager.GetState() !=
EEditorState.SELECTING)
99 m_bEditorIsSelectingState =
false;
103 override void HandlerAttachedScripted(Widget w)
105 super.HandlerAttachedScripted(w);
109 m_InputManager.AddActionListener(
"EditorActionsMenu", EActionTrigger.DOWN, OnOpenActionsMenuDown);
110 m_InputManager.AddActionListener(
"EditorActionsMenu", EActionTrigger.UP, OnOpenActionsMenuUp);
113 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_EDITOR_ACTIONS_MENU_SHOWDISABLED,
string.Empty,
"Show disabled actions",
"Actions Menu");
117 override void HandlerDeattached(Widget w)
119 super.HandlerDeattached(w);
123 m_InputManager.RemoveActionListener(
"EditorActionsMenu", EActionTrigger.DOWN, OnOpenActionsMenuDown);
124 m_InputManager.RemoveActionListener(
"EditorActionsMenu", EActionTrigger.UP, OnOpenActionsMenuUp);
127 DiagMenu.Unregister(
SCR_DebugMenuID.DEBUGUI_EDITOR_ACTIONS_MENU_SHOWDISABLED);