Skip to content

Commit 5b82ede

Browse files
authored
FIX: ISXB-1343 show dialog for unsaved changes (#2124)
1 parent 1c21242 commit 5b82ede

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ however, it has to be formatted properly to pass verification tests.
1010

1111
## [Unreleased] - yyyy-mm-dd
1212

13-
13+
- Fixed an issue causing a number of errors to be displayed when using `InputTestFixture` in playmode tests with domain reloading disabled on playmode entry. [ISXB-1446](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1446)
14+
- Fixed issue where user was not prompted to save changes when loading a second input actions asset into an already opened editor. [ISXB-1343](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1343)
1415

1516
## [1.14.0] - 2025-03-20
1617

@@ -19,7 +20,6 @@ however, it has to be formatted properly to pass verification tests.
1920
- Fixed an issue where ButtonStates are not fully updated when switching SingleUnifiedPointer. [ISXB-1356](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1356)
2021
- Fixed errors when pasting composite parts into non-composites. [ISXB-757](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-757)
2122
- Fixed an issue where updating the InputSystem outside of the dynamic Update would lead to UI input and navigation events get lost. [ISXB-1313](https://issuetracker.unity3d.com/issues/ui-onclick-events-sometimes-do-not-trigger-when-manual-update-is-utilized-with-input-system)
22-
- Fixed an issue causing a number of errors to be displayed when using `InputTestFixture` in playmode tests with domain reloading disabled on playmode entry [ISXB-1446](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1446)
2323

2424
### Changed
2525
- Changed enum value `Key.IMESelected` to obsolete which was not a real key. Please use the ButtonControl `imeSelected`.

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,28 @@ private static InputActionsEditorWindow OpenWindow(InputActionAsset asset, strin
100100
}
101101

102102
var window = GetWindow<InputActionsEditorWindow>();
103+
if (window.m_IsDirty)
104+
{
105+
var assetPath = AssetDatabase.GUIDToAssetPath(window.m_AssetGUID);
106+
if (!string.IsNullOrEmpty(assetPath))
107+
{
108+
// Prompt user with a dialog
109+
var result = Dialog.InputActionAsset.ShowSaveChanges(assetPath);
110+
switch (result)
111+
{
112+
case Dialog.Result.Save:
113+
window.Save(isAutoSave: false);
114+
break;
115+
case Dialog.Result.Cancel:
116+
return window;
117+
case Dialog.Result.Discard:
118+
break;
119+
default:
120+
throw new ArgumentOutOfRangeException(nameof(result));
121+
}
122+
}
123+
}
124+
103125
window.m_IsDirty = false;
104126
window.minSize = k_MinWindowSize;
105127
window.SetAsset(asset, actionToSelect, actionMapToSelect);

0 commit comments

Comments
 (0)