-
Notifications
You must be signed in to change notification settings - Fork 327
FIX: InputControl is not updated from the first time [ISXB-1221] #2221
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,9 +161,11 @@ | |
|
||
private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Action modifiedCallback) | ||
{ | ||
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS | ||
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS | ||
InputActionsEditorSettingsProvider.SetIMGUIDropdownVisible(true, false); | ||
#endif | ||
#endif | ||
IsShowingDropdown = true; | ||
Check warning on line 167 in Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs
|
||
|
||
if (m_PickerDropdown == null) | ||
{ | ||
m_PickerDropdown = new InputControlPickerDropdown( | ||
|
@@ -187,6 +189,8 @@ | |
m_PickerDropdown.SetExpectedControlLayout(m_ExpectedControlLayout); | ||
|
||
m_PickerDropdown.Show(rect); | ||
|
||
IsShowingDropdown = false; | ||
Check warning on line 193 in Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs
|
||
} | ||
|
||
private void SetExpectedControlLayoutFromAttribute(SerializedProperty property) | ||
|
@@ -206,12 +210,16 @@ | |
private GUIContent m_PathLabel; | ||
private string m_ExpectedControlLayout; | ||
private string[] m_ControlPathsToMatch; | ||
private InputControlScheme[] m_ControlSchemes; | ||
private bool m_NeedToClearProgressBar; | ||
|
||
private InputControlPickerDropdown m_PickerDropdown; | ||
private readonly InputControlPickerState m_PickerState; | ||
private InputActionRebindingExtensions.RebindingOperation m_RebindingOperation; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These three private properties were never really used, so I'm just cleaning it up as a harmless side effect on my main change. |
||
|
||
/// <summary> | ||
/// This property is only set from this class in order to communicate that we're showing the dropdown at the moment | ||
/// It's employed to skip auto-saving, because that complicates updating the internal SerializedProperties. | ||
/// Unfortunately, we can't use IMGUIDropdownVisible from the setings provider because of the early-out logic in there. | ||
/// </summary> | ||
public static bool IsShowingDropdown { get; private set; } | ||
Check warning on line 222 in Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that is a static property. However, it's only set from one place (private set), and it won't leak memory. Also, if we somehow happen to have two drop-down editor windows at the same time (which QA will correct me is barely possible). Even if somehow somehow opens two drop-down thingies at the same time, I believe we're fine here, as the more drop-down windows we have, the less sense it makes to auto-save during those sensitive moments of time. Hope that makes sense. |
||
} | ||
} | ||
#endif // UNITY_EDITOR |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ internal class InputActionsEditorSettingsProvider : SettingsProvider | |
[SerializeField] InputActionsEditorState m_State; | ||
VisualElement m_RootVisualElement; | ||
private bool m_HasEditFocus; | ||
private bool m_IgnoreActionChangedCallback; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was never used, dead code, I'm removing as a harmless side effect. |
||
private bool m_IsActivated; | ||
private static bool m_IMGUIDropdownVisible; | ||
StateContainer m_StateContainer; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was automatic by VSCode