Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@
finally
{
if (existingWorkingCopy != null)
{
DestroyImmediate(existingWorkingCopy);
}
}
}

Expand Down Expand Up @@ -273,7 +275,6 @@
if (!rootVisualElement.styleSheets.Contains(InputActionsEditorWindowUtils.theme))
rootVisualElement.styleSheets.Add(InputActionsEditorWindowUtils.theme);
m_View = new InputActionsEditorView(rootVisualElement, m_StateContainer, false, () => Save(isAutoSave: false));

m_StateContainer.Initialize(rootVisualElement.Q("action-editor"));
}

Expand Down Expand Up @@ -366,7 +367,7 @@
// This code should be cleaned up once we migrate the InputControl stuff from ImGUI completely.
// Since at that point it stops being a separate window that steals focus.
// (See case ISXB-1221)
if (!InputControlPathEditor.IsShowingDropdown)
if (!InputControlPathEditor.IsShowingDropdown && !ControlSchemesView.IsShowingControlSchemeView)

Check warning on line 370 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L370 was not covered by tests
Save(isAutoSave: true);
#endif

Expand Down Expand Up @@ -447,8 +448,7 @@
var assetPath = AssetDatabase.GUIDToAssetPath(m_AssetGUID);
if (assetPath == null)
{
Debug.LogWarning(
$"Failed to open InputActionAsset with GUID {m_AssetGUID}. The asset might have been deleted.");
Debug.LogWarning($"Failed to open InputActionAsset with GUID {m_AssetGUID}. The asset might have been deleted.");

Check warning on line 451 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L451 was not covered by tests
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
private string m_NewName;
public event Action<ViewBase<InputControlScheme>> OnClosing;

/// <summary>
/// This property is only set from this class in order to communicate that we're showing the control schemes view at the moment
/// It's employed to skip auto-saving, because that complicates the save causing this window to close when adding a new device type.
/// </summary>
internal static bool IsShowingControlSchemeView { get; private set; }

Check warning on line 21 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L21

Added line #L21 was not covered by tests

public ControlSchemesView(VisualElement root, StateContainer stateContainer, bool updateExisting = false)
: base(root, stateContainer)
{
IsShowingControlSchemeView = true;

Check warning on line 26 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L26

Added line #L26 was not covered by tests
m_UpdateExisting = updateExisting;

var controlSchemeEditor = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
Expand Down Expand Up @@ -118,6 +125,7 @@

public override void DestroyView()
{
IsShowingControlSchemeView = false;

Check warning on line 128 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L128

Added line #L128 was not covered by tests
m_ModalWindow.RemoveFromHierarchy();
}

Expand All @@ -137,6 +145,8 @@

private void CloseView()
{
IsShowingControlSchemeView = false;

Check warning on line 148 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L148

Added line #L148 was not covered by tests

// Closing the View without explicitly selecting "Save" or "Cancel" holds the values in the
// current UI state but won't persist them; the Asset Editor state isn't dirtied.
//
Expand Down