diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 79e1ff562f..10fd9c4724 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -10,7 +10,8 @@ however, it has to be formatted properly to pass verification tests. ## [Unreleased] - yyyy-mm-dd - +### Fixed +- Fixed an issue causing the Action context menu to not show on right click when right clicking an action in the Input Action Editor [ISXB-1134](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1134). ## [1.11.2] - 2024-10-16 diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs index 300f5281b2..3eb1d9efab 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs @@ -67,8 +67,6 @@ public ActionMapsView(VisualElement root, StateContainer stateContainer) m_AddActionMapButton.clicked += AddActionMap; ContextMenu.GetContextMenuForActionMapsEmptySpace(this, root.Q("rclick-area-to-add-new-action-map")); - // Only bring up this context menu for the List when it's empty, so we can treat it like right-clicking the empty space: - ContextMenu.GetContextMenuForActionMapsEmptySpace(this, m_ListView, onlyShowIfListIsEmpty: true); } void OnDroppedHandler(int mapIndex) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs index 33f6663aee..5449932711 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs @@ -124,8 +124,6 @@ public ActionsTreeView(VisualElement root, StateContainer stateContainer) ContextMenu.GetContextMenuForActionListView(this, m_ActionsTreeView, m_ActionsTreeView.parent); ContextMenu.GetContextMenuForActionsEmptySpace(this, m_ActionsTreeView, root.Q("rclick-area-to-add-new-action")); - // Only bring up this context menu for the Tree when it's empty, so we can treat it like right-clicking the empty space: - ContextMenu.GetContextMenuForActionsEmptySpace(this, m_ActionsTreeView, m_ActionsTreeView, onlyShowIfTreeIsEmpty: true); m_ActionsTreeViewSelectionChangeFilter = new CollectionViewSelectionChangeFilter(m_ActionsTreeView); m_ActionsTreeViewSelectionChangeFilter.selectedIndicesChanged += (_) => diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ContextMenu.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ContextMenu.cs index a8163243e3..ef70992280 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ContextMenu.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ContextMenu.cs @@ -47,19 +47,16 @@ public static void GetContextMenuForActionMapItem(ActionMapsView mapView, InputA // Add "Add Action Map" option to empty space under the ListView. Matches with old IMGUI style (ISX-1519). // Include Paste here as well, since it makes sense for adding ActionMaps. - public static void GetContextMenuForActionMapsEmptySpace(ActionMapsView mapView, VisualElement element, bool onlyShowIfListIsEmpty = false) + public static void GetContextMenuForActionMapsEmptySpace(ActionMapsView mapView, VisualElement element) { _ = new ContextualMenuManipulator(menuEvent => { - if (!onlyShowIfListIsEmpty || mapView.GetMapCount() == 0) - { - var copiedAction = CopyPasteHelper.GetCopiedClipboardType() == typeof(InputAction); - if (CopyPasteHelper.HasPastableClipboardData(typeof(InputActionMap))) - menuEvent.menu.AppendAction(paste_String, _ => mapView.PasteItems(copiedAction)); + var copiedAction = CopyPasteHelper.GetCopiedClipboardType() == typeof(InputAction); + if (CopyPasteHelper.HasPastableClipboardData(typeof(InputActionMap))) + menuEvent.menu.AppendAction(paste_String, _ => mapView.PasteItems(copiedAction)); - menuEvent.menu.AppendSeparator(); - menuEvent.menu.AppendAction(add_Action_Map_String, _ => mapView.AddActionMap()); - } + menuEvent.menu.AppendSeparator(); + menuEvent.menu.AppendAction(add_Action_Map_String, _ => mapView.AddActionMap()); }) { target = element }; }