Skip to content

Commit f35d9f8

Browse files
committed
revert changes
1 parent e48476e commit f35d9f8

File tree

8 files changed

+21
-48
lines changed

8 files changed

+21
-48
lines changed

Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ private void OnCompositeParametersModified()
316316
var nameAndParameters = NameAndParameters.Parse(path);
317317
nameAndParameters.parameters = m_CompositeParameters.GetParameters();
318318

319-
OnPathChanged(nameAndParameters.ToString());
319+
m_PathProperty.stringValue = nameAndParameters.ToString();
320+
m_PathProperty.serializedObject.ApplyModifiedProperties();
321+
322+
OnPathChanged();
320323
}
321324

322325
private void OnBindingGroupsChanged()
@@ -327,9 +330,8 @@ private void OnBindingGroupsChanged()
327330
onChange?.Invoke(k_GroupsChanged);
328331
}
329332

330-
private void OnPathChanged(string path)
333+
private void OnPathChanged()
331334
{
332-
m_PathProperty.stringValue = path;
333335
m_BindingProperty.serializedObject.ApplyModifiedProperties();
334336
onChange?.Invoke(k_PathChanged);
335337
}

Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public sealed class InputControlPathEditor : IDisposable
2626
/// <param name="onModified">Delegate that is called when the path has been modified.</param>
2727
/// <param name="label">Optional label to display instead of display name of <paramref name="pathProperty"/>.</param>
2828
/// <exception cref="ArgumentNullException"><paramref name="pathProperty"/> is <c>null</c>.</exception>
29-
public InputControlPathEditor(SerializedProperty pathProperty, InputControlPickerState pickerState, Action<string> onModified, GUIContent label = null)
29+
public InputControlPathEditor(SerializedProperty pathProperty, InputControlPickerState pickerState, Action onModified, GUIContent label = null)
3030
{
3131
if (pathProperty == null)
3232
throw new ArgumentNullException(nameof(pathProperty));
@@ -89,7 +89,7 @@ public void OnGUI()
8989
EditorGUILayout.EndHorizontal();
9090
}
9191

92-
public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty property = null, Action<string> modifiedCallback = null)
92+
public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty property = null, Action modifiedCallback = null)
9393
{
9494
var pathLabel = label ?? m_PathLabel;
9595
var serializedProperty = property ?? pathProperty;
@@ -141,7 +141,7 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
141141
{
142142
serializedProperty.stringValue = path;
143143
serializedProperty.serializedObject.ApplyModifiedProperties();
144-
(modifiedCallback ?? onModified).Invoke(path);
144+
(modifiedCallback ?? onModified).Invoke();
145145
}
146146
}
147147
else
@@ -151,7 +151,7 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
151151
{
152152
SetExpectedControlLayoutFromAttribute(serializedProperty);
153153
////TODO: for bindings that are part of composites, use the layout information from the [InputControl] attribute on the field
154-
ShowDropdown(bindingTextRect, modifiedCallback ?? onModified);
154+
ShowDropdown(bindingTextRect, serializedProperty, modifiedCallback ?? onModified);
155155
}
156156
}
157157

@@ -160,7 +160,7 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
160160
EditorStyles.miniButton);
161161
}
162162

163-
private void ShowDropdown(Rect rect, Action<string> modifiedCallback)
163+
private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Action modifiedCallback)
164164
{
165165
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
166166
InputActionsEditorSettingsProvider.SetIMGUIDropdownVisible(true, false);
@@ -171,16 +171,17 @@ private void ShowDropdown(Rect rect, Action<string> modifiedCallback)
171171
m_PickerState,
172172
path =>
173173
{
174+
serializedProperty.stringValue = path;
174175
m_PickerState.manualPathEditMode = false;
175-
modifiedCallback(path);
176+
modifiedCallback();
176177
});
177178
}
178179

179180
m_PickerDropdown.SetPickedCallback(path =>
180181
{
181-
//At this point, the serialized property can sometines be referencing the old input actions asset
182+
serializedProperty.stringValue = path;
182183
m_PickerState.manualPathEditMode = false;
183-
modifiedCallback(path);
184+
modifiedCallback();
184185
});
185186

186187
m_PickerDropdown.SetControlPathsToMatch(m_ControlPathsToMatch);
@@ -201,7 +202,7 @@ private void SetExpectedControlLayoutFromAttribute(SerializedProperty property)
201202
}
202203

203204
public SerializedProperty pathProperty { get; }
204-
public Action<string> onModified { get; }
205+
public Action onModified { get; }
205206

206207
private GUIContent m_PathLabel;
207208
private string m_ExpectedControlLayout;
@@ -212,7 +213,6 @@ private void SetExpectedControlLayoutFromAttribute(SerializedProperty property)
212213
private InputControlPickerDropdown m_PickerDropdown;
213214
private readonly InputControlPickerState m_PickerState;
214215
private InputActionRebindingExtensions.RebindingOperation m_RebindingOperation;
215-
216216
}
217217
}
218218
#endif // UNITY_EDITOR

Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPickerDropdown.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ protected override void ItemSelected(AdvancedDropdownItem item)
127127
InputActionsEditorSettingsProvider.SetIMGUIDropdownVisible(false, true);
128128
#endif
129129
var path = ((InputControlDropdownItem)item).controlPathWithDevice;
130-
Debug.Log("Picked: " + path);
131130
m_OnPickCallback(path);
132131
}
133132

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputControlPathDrawer.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,12 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
3939
if (m_Editor == null)
4040
{
4141
m_Editor = new InputControlPathEditor(property, m_PickerState,
42-
(path) =>
43-
{
44-
property.stringValue = path;
45-
property.serializedObject.ApplyModifiedProperties();
46-
},
42+
() => property.serializedObject.ApplyModifiedProperties(),
4743
label: label);
4844
}
49-
45+
5046
EditorGUI.BeginProperty(position, label, property);
51-
m_Editor.OnGUI(position, label, property, (path) =>
52-
{
53-
property.stringValue = path;
54-
property.serializedObject.ApplyModifiedProperties();
55-
});
47+
m_Editor.OnGUI(position, label, property, () => property.serializedObject.ApplyModifiedProperties());
5648
EditorGUI.EndProperty();
5749
}
5850
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,7 @@ private bool HasContentChanged()
282282
{
283283
var editedAsset = GetEditedAsset();
284284
var editedAssetJson = InputActionsEditorWindowUtils.ToJsonWithoutName(editedAsset);
285-
var hasContentChanged = editedAssetJson != m_AssetJson;
286-
if (hasContentChanged)
287-
{
288-
Debug.LogError("Content Changed");
289-
}
290-
return hasContentChanged;
285+
return editedAssetJson != m_AssetJson;
291286
}
292287

293288
private void DirtyInputActionsEditorWindow(InputActionsEditorState newState)

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ internal class ActionsTreeView : ViewBase<ActionsTreeView.ViewState>
3232
public ActionsTreeView(VisualElement root, StateContainer stateContainer)
3333
: base(root, stateContainer)
3434
{
35-
Debug.Log("Rebuilding TreeView");
3635
m_ActionMapsListView = root.Q<ListView>("action-maps-list-view");
3736
m_AddActionButton = root.Q<Button>("add-new-action-button");
3837
m_PropertiesScrollview = root.Q<ScrollView>("properties-scrollview");
@@ -107,12 +106,6 @@ public ActionsTreeView(VisualElement root, StateContainer stateContainer)
107106
item.FocusOnRenameTextField();
108107
};
109108

110-
m_ActionsTreeView.selectionChanged += objects =>
111-
{
112-
var data = (ActionOrBindingData)objects.FirstOrDefault();
113-
Debug.Log($"Selection Changed {data.actionIndex} . {data.bindingIndex}");
114-
};
115-
116109
m_ActionsTreeView.unbindItem = (element, i) =>
117110
{
118111
var item = m_ActionsTreeView.GetItemDataForIndex<ActionOrBindingData>(i);

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/BindingPropertiesView.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ public override void RedrawUI(ViewState viewState)
5959
else
6060
{
6161
var controlPathEditor = new InputControlPathEditor(viewState.selectedBindingPath, new InputControlPickerState(),
62-
(path) =>
63-
{
64-
viewState.selectedBindingPath.stringValue = path;
65-
Dispatch(Commands.ApplyModifiedProperties());
66-
});
62+
() => { Dispatch(Commands.ApplyModifiedProperties()); });
6763
controlPathEditor.SetControlPathsToMatch(viewState.currentControlScheme.deviceRequirements.Select(x => x.controlPath));
6864

6965
var inputAction = viewState.selectedInputAction;

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/CompositePartBindingPropertiesView.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ public override void RedrawUI(ViewState viewState)
3636
return;
3737
// TODO: Persist control picker state
3838
var controlPathEditor = new InputControlPathEditor(viewState.selectedBindingPath, new InputControlPickerState(),
39-
(path) =>
40-
{
41-
viewState.selectedBindingPath.stringValue = path;
42-
Dispatch(Commands.ApplyModifiedProperties());
43-
});
39+
() => { Dispatch(Commands.ApplyModifiedProperties()); });
4440

4541
controlPathEditor.SetControlPathsToMatch(viewState.currentControlScheme.deviceRequirements.Select(x => x.controlPath));
4642
controlPathEditor.SetExpectedControlLayout(viewState.expectedControlLayoutName);

0 commit comments

Comments
 (0)