Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ however, it has to be formatted properly to pass verification tests.
### Fixed
- Fixed Multiple interactions could breaks on Composite Binding. [ISXB-619](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-619)
- Fixed memory leak when the OnScreenStick component was destroyed [ISXB-1070](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1070). Contribution by [LukeUnityDev](https://github.com/LukeUnityDev).
- Fixed Action Maps contextual menu in Action Editor UI that occasionally displays unrelated items.

### Changed
- Renamed editor Resources directories to PackageResources to fix package validation warnings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal static class ContextMenu
#region ActionMaps
public static void GetContextMenuForActionMapItem(ActionMapsView mapView, InputActionMapsTreeViewItem treeViewItem, int index)
{
_ = new ContextualMenuManipulator(menuEvent =>
treeViewItem.OnContextualMenuPopulateEvent = (menuEvent =>
{
// TODO: AddAction should enable m_RenameOnActionAdded
menuEvent.menu.AppendAction(add_Action_String, _ => mapView.Dispatch(Commands.AddAction()));
Expand All @@ -42,7 +42,7 @@ public static void GetContextMenuForActionMapItem(ActionMapsView mapView, InputA
var copiedAction = CopyPasteHelper.GetCopiedClipboardType() == typeof(InputAction);
if (CopyPasteHelper.HasPastableClipboardData(typeof(InputActionMap)))
menuEvent.menu.AppendAction(paste_String, _ => mapView.PasteItems(copiedAction));
}) { target = treeViewItem };
});
}

// Add "Add Action Map" option to empty space under the ListView. Matches with old IMGUI style (ISX-1519).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// UITK TreeView is not supported in earlier versions
// Therefore the UITK version of the InputActionAsset Editor is not available on earlier Editor versions either.
#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
using System;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine.InputSystem.Editor;
Expand All @@ -17,6 +18,7 @@ internal class InputActionMapsTreeViewItem : VisualElement

private const string kRenameTextField = "rename-text-field";
public event EventCallback<string> EditTextFinished;
public Action<ContextualMenuPopulateEvent> OnContextualMenuPopulateEvent;

// for testing purposes to know if the item is focused to accept input
internal bool IsFocused { get; private set; } = false;
Expand All @@ -41,6 +43,11 @@ public InputActionMapsTreeViewItem()
RegisterCallback<MouseDownEvent>(OnMouseDownEventForRename);
renameTextfield.RegisterCallback<FocusInEvent>(e => IsFocused = true);
renameTextfield.RegisterCallback<FocusOutEvent>(e => { OnEditTextFinished(); IsFocused = false; });
_ = new ContextualMenuManipulator(menuBuilder =>
{
OnContextualMenuPopulateEvent?.Invoke(menuBuilder);
})
{ target = this };
}

public Label label => this.Q<Label>();
Expand Down