Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Mark Action Maps and Actions as disabled for renaming when in cut mode #2088

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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 @@ -34,6 +34,7 @@ however, it has to be formatted properly to pass verification tests.
- Fixed an issue with default device selection when adding new Control Scheme.
- Fixed an issue where action map delegates were not updated when the asset already assigned to the PlayerInput component were changed [ISXB-711](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-711).
- Fixed Action properties edition in the UI Toolkit version of the Input Actions Asset editor. [ISXB-1277](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1277)
- Fixed Cut Mode for Action Maps and Actions to make renaming disabled. [ISXB-1155](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1155)

### Changed
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public ActionMapsView(VisualElement root, StateContainer stateContainer)
treeViewItem.EditTextFinished += treeViewItem.EditTextFinishedCallback;
treeViewItem.userData = i;
element.SetEnabled(!mapData.isDisabled);
treeViewItem.isDisabledActionMap = mapData.isDisabled;

ContextMenu.GetContextMenuForActionMapItem(this, treeViewItem, i);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public ActionsTreeView(VisualElement root, StateContainer stateContainer)
EditorInputControlLayoutCache.GetIconForLayout("Control"));

e.SetEnabled(!item.isCut);
treeViewItem.isCut = item.isCut;
};

m_ActionsTreeView.itemsChosen += objects =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ internal class InputActionMapsTreeViewItem : VisualElement
private bool m_IsEditing;
private static InputActionMapsTreeViewItem s_EditingItem = null;

internal bool isDisabledActionMap { get; set; }

public InputActionMapsTreeViewItem()
{
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
Expand Down Expand Up @@ -98,7 +100,7 @@ public void Reset()

public void FocusOnRenameTextField()
{
if (m_IsEditing)
if (m_IsEditing || isDisabledActionMap)
return;
delegatesFocus = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ internal class InputActionsTreeViewItem : VisualElement
private bool m_IsEditing;
private static InputActionsTreeViewItem s_EditingItem = null;

internal bool isCut { get; set; }

public InputActionsTreeViewItem()
{
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
Expand All @@ -42,7 +44,6 @@ public InputActionsTreeViewItem()
public Label label => this.Q<Label>();
private TextField renameTextfield => this.Q<TextField>(kRenameTextField);


public void UnregisterInputField()
{
renameTextfield.SetEnabled(false);
Expand Down Expand Up @@ -77,7 +78,7 @@ public void Reset()

public void FocusOnRenameTextField()
{
if (m_IsEditing)
if (m_IsEditing || isCut)
return;
delegatesFocus = true;

Expand Down
Loading