From 6fa89e09694fbbd00114e8e646a231439701e1a7 Mon Sep 17 00:00:00 2001 From: StefanUnity <40492087+stefanunity@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:51:49 +0100 Subject: [PATCH 01/18] Bump version to 1.8.2 (#1891) -also fix license validation warning --- Assets/Samples/InGameHints/InGameHintsActions.cs | 2 +- Assets/Samples/SimpleDemo/SimpleControls.cs | 2 +- Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs | 2 +- Packages/com.unity.inputsystem/CHANGELOG.md | 2 ++ Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs | 2 +- .../InputSystem/Devices/Precompiled/FastKeyboard.cs | 2 +- .../InputSystem/Devices/Precompiled/FastMouse.cs | 2 +- .../InputSystem/Devices/Precompiled/FastTouchscreen.cs | 2 +- Packages/com.unity.inputsystem/LICENSE.md | 2 +- .../com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs | 2 +- Packages/com.unity.inputsystem/package.json | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Assets/Samples/InGameHints/InGameHintsActions.cs b/Assets/Samples/InGameHints/InGameHintsActions.cs index b3a30f8c39..ad5df17f7a 100644 --- a/Assets/Samples/InGameHints/InGameHintsActions.cs +++ b/Assets/Samples/InGameHints/InGameHintsActions.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.8.1 +// version 1.8.2 // from Assets/Samples/InGameHints/InGameHintsActions.inputactions // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Assets/Samples/SimpleDemo/SimpleControls.cs b/Assets/Samples/SimpleDemo/SimpleControls.cs index e33d50f171..aae692d2c9 100644 --- a/Assets/Samples/SimpleDemo/SimpleControls.cs +++ b/Assets/Samples/SimpleDemo/SimpleControls.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.8.1 +// version 1.8.2 // from Assets/Samples/SimpleDemo/SimpleControls.inputactions // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs b/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs index bff9d34f65..c9424a3cef 100644 --- a/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs +++ b/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.8.1 +// version 1.8.2 // from Assets/Tests/InputSystem/InputActionCodeGeneratorActions.inputactions // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 095edc1266..67cfa2e117 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Due to package verification, the latest version below is the unpublished version and the date is meaningless. however, it has to be formatted properly to pass verification tests. +## [Unreleased] - YYYY-MM-DD + ## [1.8.1] - 2024-03-14 ### Fixed diff --git a/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs b/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs index 4a184a7f64..ddfc613bab 100644 --- a/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs +++ b/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs @@ -15,7 +15,7 @@ public static partial class InputSystem // Keep this in sync with "Packages/com.unity.inputsystem/package.json". // NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include // "-preview" suffixes here. - internal const string kAssemblyVersion = "1.8.1"; + internal const string kAssemblyVersion = "1.8.2"; internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.8"; } } diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs index 9b5dec6bf3..c47ea3f931 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator -// version 1.8.1 +// version 1.8.2 // from "Keyboard" layout // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs index faae0ec995..8bd47775f5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator -// version 1.8.1 +// version 1.8.2 // from "Mouse" layout // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs index 93dc76e419..933d5f3eea 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator -// version 1.8.1 +// version 1.8.2 // from "Touchscreen" layout // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/LICENSE.md b/Packages/com.unity.inputsystem/LICENSE.md index b351e17cb4..102c525a7e 100755 --- a/Packages/com.unity.inputsystem/LICENSE.md +++ b/Packages/com.unity.inputsystem/LICENSE.md @@ -1,4 +1,4 @@ -Input System © 2024 Unity Technologies +com.unity.inputsystem copyright © 2024 Unity Technologies Licensed under the Unity Companion License for Unity-dependent projects (see [https://unity3d.com/legal/licenses/unity_companion_license](https://unity3d.com/legal/licenses/unity_companion_license)). diff --git a/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs b/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs index cbc6c36f22..cb67f0e7a7 100644 --- a/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs +++ b/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs @@ -4,7 +4,7 @@ // Keep this in sync with "Packages/com.unity.inputsystem/package.json". // NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include // "-preview" suffixes here. -[assembly: AssemblyVersion("1.8.1")] +[assembly: AssemblyVersion("1.8.2")] [assembly: InternalsVisibleTo("Unity.InputSystem.Tests.Editor")] [assembly: InternalsVisibleTo("Unity.InputSystem.Tests")] [assembly: InternalsVisibleTo("Unity.InputSystem.IntegrationTests")] diff --git a/Packages/com.unity.inputsystem/package.json b/Packages/com.unity.inputsystem/package.json index 7d29c2b378..d5c8b844db 100755 --- a/Packages/com.unity.inputsystem/package.json +++ b/Packages/com.unity.inputsystem/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.inputsystem", "displayName": "Input System", - "version": "1.8.1", + "version": "1.8.2", "unity": "2019.4", "description": "A new input system which can be used as a more extensible and customizable alternative to Unity's classic input system in UnityEngine.Input.", "keywords": [ From c25f06857d64bacd3cdcb0adb45054d23b534df7 Mon Sep 17 00:00:00 2001 From: StefanUnity <40492087+stefanunity@users.noreply.github.com> Date: Thu, 21 Mar 2024 21:01:32 +0100 Subject: [PATCH 02/18] FIX: clean up after the XRI package test (#1892) ISX-1909 --- Assets/Tests/InputSystem.Editor/XRIPackageTest.cs | 6 ++++++ .../Tests/InputSystem.Editor/XRIPackageTest.cs.meta | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs b/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs index cada7ef6f8..684a872d38 100644 --- a/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs +++ b/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs @@ -28,6 +28,12 @@ public IEnumerator TearDown() { yield return null; } + + //Delete the Assets/XRI folder (and its content) that the XRI package creates + if (AssetDatabase.IsValidFolder("Assets/XRI")) + { + AssetDatabase.DeleteAsset("Assets/XRI"); + } } [UnityTest] diff --git a/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs.meta b/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs.meta index f6fbfaf43e..9b966c9038 100644 --- a/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs.meta +++ b/Assets/Tests/InputSystem.Editor/XRIPackageTest.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: b69fa2235c5cf9140936a639fd7f0005 \ No newline at end of file +guid: b69fa2235c5cf9140936a639fd7f0005 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 2c4e532d41b5c7c2550860ce1e5b5f98d9317c4c Mon Sep 17 00:00:00 2001 From: StefanUnity <40492087+stefanunity@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:52:14 +0100 Subject: [PATCH 03/18] FIX: reenable editor tests after changes to mock dialogues (ISX-1896) (#1894) * reenabled tests * added one new test to cover basic version of naming duplication that was missing --- .../ControlSchemeEditorTests.cs | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Assets/Tests/InputSystem.Editor/ControlSchemeEditorTests.cs b/Assets/Tests/InputSystem.Editor/ControlSchemeEditorTests.cs index 2170c7ce1d..a90fedf61f 100644 --- a/Assets/Tests/InputSystem.Editor/ControlSchemeEditorTests.cs +++ b/Assets/Tests/InputSystem.Editor/ControlSchemeEditorTests.cs @@ -197,7 +197,6 @@ public void WhenControlSchemeIsSelected_SelectedControlSchemeIndexIsSet() [Test] [Category("AssetEditor")] - [Ignore("Instability ISX-1905")] public void WhenControlSchemeIsSelected_SelectedControlSchemeIsPopulatedWithSelection() { var asset = TestData.inputActionAsset @@ -260,9 +259,29 @@ public void DuplicateControlSchemeCommand_CreatesCopyOfControlSchemeWithUniqueNa Assert.That(newState.selectedControlScheme.deviceRequirements, Is.EqualTo(state.selectedControlScheme.deviceRequirements)); } + [Test(Description = "Verifies that when duplicating Control Scheme ending on an Int it increments that Int and jumps already existing Int names")] + [Category("AssetEditor")] + public void DuplicateControlSchemeCommand_CreatesCopyOfControlSchemeWithUniqueNameEndingOnIntJumpsExistingNumbers() + { + var asset = TestData.inputActionAsset.Generate(); + + asset.AddControlScheme(new InputControlScheme(("Test"))); + asset.AddControlScheme(new InputControlScheme(("Test1"))); + + //select "Test" Control Scheme + var state = TestData.EditorStateWithAsset(asset).Generate().With(selectedControlScheme: asset.controlSchemes[0]); + + state.serializedObject.Update(); + + //duplicate "Test" + var newState = ControlSchemeCommands.DuplicateSelectedControlScheme()(in state); + + //duplicated Control Scheme should be names "Test2", skipping "Test1" + Assert.That(newState.selectedControlScheme.name, Is.EqualTo("Test2")); + } + [Test] [Category("AssetEditor")] - [Ignore("Disabled: This should not be called in batch mode.")] public void DeleteControlSchemeCommand_DeletesSelectedControlScheme() { var asset = TestData.inputActionAsset.WithControlScheme(TestData.controlScheme.WithOptionalDevice()).Generate(); @@ -284,7 +303,6 @@ public void DeleteControlSchemeCommand_DeletesSelectedControlScheme() [TestCase(3, 2, 1, "Test1")] [TestCase(1, 0, -1, null)] [Category("AssetEditor")] - [Ignore("Disabled: This should not be called in batch mode.")] public void DeleteControlSchemeCommand_SelectsAnotherControlSchemeAfterDelete( int controlSchemeCount, int selectedControlSchemeIndex, From 91be28133112d973b49e57f3c0512fdcfe69084a Mon Sep 17 00:00:00 2001 From: Graham Huws <102745393+graham-huws@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:07:21 +0000 Subject: [PATCH 04/18] FIX: Avoid nullrefs from right-clicking when there's no Action Maps (ISXB-833). (#1898) Also stop "Add Action" / pasting an action being options when there are no Action Maps. --- Packages/com.unity.inputsystem/CHANGELOG.md | 3 ++ .../UITKAssetEditor/Views/ActionMapsView.cs | 10 +++++- .../UITKAssetEditor/Views/ActionsTreeView.cs | 9 +++++ .../UITKAssetEditor/Views/ContextMenu.cs | 33 +++++++++++-------- 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 67cfa2e117..220ab5db05 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -10,6 +10,9 @@ however, it has to be formatted properly to pass verification tests. ## [Unreleased] - YYYY-MM-DD +### Fixed +- NullReferenceException thrown when right-clicking an empty Action Map list in Input Actions Editor windows [ISXB-833](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-833). + ## [1.8.1] - 2024-03-14 ### Fixed 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 43d2c6e2e8..678b14d80d 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs @@ -67,6 +67,8 @@ 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) @@ -154,6 +156,11 @@ internal void AddActionMap() m_EnterRenamingMode = true; } + internal int GetMapCount() + { + return m_ListView.itemsSource.Count; + } + private void OnExecuteCommand(ExecuteCommandEvent evt) { var selectedItem = m_ListView.GetRootElementForIndex(m_ListView.selectedIndex); @@ -218,7 +225,8 @@ private void OnPointerDown(PointerDownEvent evt) if (evt.button == (int)MouseButton.RightMouse && evt.clickCount == 1) { var actionMap = (evt.target as VisualElement).GetFirstAncestorOfType(); - m_ListView.SetSelection(actionMap.parent.IndexOf(actionMap)); + if (actionMap != null) + m_ListView.SetSelection(actionMap.parent.IndexOf(actionMap)); } } 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 f9f9d24233..e301f6e6b5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs @@ -18,6 +18,7 @@ namespace UnityEngine.InputSystem.Editor /// internal class ActionsTreeView : ViewBase { + private readonly ListView m_ActionMapsListView; private readonly TreeView m_ActionsTreeView; private readonly Button m_AddActionButton; private readonly ScrollView m_PropertiesScrollview; @@ -31,6 +32,7 @@ internal class ActionsTreeView : ViewBase public ActionsTreeView(VisualElement root, StateContainer stateContainer) : base(root, stateContainer) { + m_ActionMapsListView = root.Q("action-maps-list-view"); m_AddActionButton = root.Q