Skip to content

Commit f60ac4f

Browse files
authored
FIX: Add tooltips to settings window (#827)
1 parent 0246ae6 commit f60ac4f

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

Packages/com.unity.inputsystem/Documentation~/Settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Sensors affected by this setting are [`Gyroscope`](../api/UnityEngine.InputSyste
5151
|----|-----------|
5252
|Default Deadzone Min|Default minimum value used for [Stick Deadzone](Processors.md#stick-deadzone) or [Axis Deadzone](Processors.md#axis-deadzone) processors when no min value is explicitly set on the processor|
5353
|Default Deadzone Max|Default maximum value used for [Stick Deadzone](Processors.md#stick-deadzone) or [Axis Deadzone](Processors.md#axis-deadzone) processors when no max value is explicitly set on the processor|
54-
|Default Button Press Point|The default [press point](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_pressPointOrDefault) used for [Button controls](../api/UnityEngine.InputSystem.Controls.ButtonControl.html). For button controls which have analog physics inputs (such as triggers on a gamepad), this configures how far they need to be held down to be considered "pressed".|
54+
|Default Button Press Point|The default [press point](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_pressPointOrDefault) used for [Button controls](../api/UnityEngine.InputSystem.Controls.ButtonControl.html), as well as for various [interactions](Interactions.md). For button controls which have analog physics inputs (such as triggers on a gamepad), this configures how far they need to be held down to be considered "pressed".|
5555
|Default Tap Time|Default duration to be used for [Tap](Interactions.md#tap) and [MultiTap](Interactions.md#multitap) interactions. Also used by by Touch screen devices to distinguish taps from to new touches.|
5656
|Default Slow Tap Time|Default duration to be used for [SlowTap](Interactions.md#tap) interactions.|
5757
|Default Hold Time|Default duration to be used for [Hold](Interactions.md#hold) interactions.|

Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,23 @@ public override void OnGUI(string searchContext)
8585

8686
EditorGUI.BeginChangeCheck();
8787

88-
EditorGUILayout.PropertyField(m_UpdateMode);
88+
EditorGUILayout.PropertyField(m_UpdateMode, m_UpdateModeContent);
8989

90-
EditorGUILayout.PropertyField(m_FilterNoiseOnCurrent);
91-
EditorGUILayout.PropertyField(m_CompensateForScreenOrientation);
90+
EditorGUILayout.PropertyField(m_FilterNoiseOnCurrent, m_FilterNoiseOnCurrentContent);
91+
EditorGUILayout.PropertyField(m_CompensateForScreenOrientation, m_CompensateForScreenOrientationContent);
9292

9393
EditorGUILayout.Space();
9494
EditorGUILayout.Separator();
9595
EditorGUILayout.Space();
9696

97-
EditorGUILayout.PropertyField(m_DefaultDeadzoneMin);
98-
EditorGUILayout.PropertyField(m_DefaultDeadzoneMax);
99-
EditorGUILayout.PropertyField(m_DefaultButtonPressPoint);
100-
EditorGUILayout.PropertyField(m_DefaultTapTime);
101-
EditorGUILayout.PropertyField(m_DefaultSlowTapTime);
102-
EditorGUILayout.PropertyField(m_DefaultHoldTime);
103-
EditorGUILayout.PropertyField(m_TapRadius);
104-
EditorGUILayout.PropertyField(m_MultiTapDelayTime);
97+
EditorGUILayout.PropertyField(m_DefaultDeadzoneMin, m_DefaultDeadzoneMinContent);
98+
EditorGUILayout.PropertyField(m_DefaultDeadzoneMax, m_DefaultDeadzoneMaxContent);
99+
EditorGUILayout.PropertyField(m_DefaultButtonPressPoint, m_DefaultButtonPressPointContent);
100+
EditorGUILayout.PropertyField(m_DefaultTapTime, m_DefaultTapTimeContent);
101+
EditorGUILayout.PropertyField(m_DefaultSlowTapTime, m_DefaultSlowTapTimeContent);
102+
EditorGUILayout.PropertyField(m_DefaultHoldTime, m_DefaultHoldTimeContent);
103+
EditorGUILayout.PropertyField(m_TapRadius, m_TapRadiusContent);
104+
EditorGUILayout.PropertyField(m_MultiTapDelayTime, m_MultiTapDelayTimeContent);
105105

106106
EditorGUILayout.Space();
107107
EditorGUILayout.Separator();
@@ -222,6 +222,18 @@ private void InitializeWithCurrentSettings()
222222
m_TapRadius = m_SettingsObject.FindProperty("m_TapRadius");
223223
m_MultiTapDelayTime = m_SettingsObject.FindProperty("m_MultiTapDelayTime");
224224

225+
m_UpdateModeContent = new GUIContent("Update Mode", "When should the Input System be updated?");
226+
m_FilterNoiseOnCurrentContent = new GUIContent("Filter Noise on current", "If enabled, input from noisy controls will not cause a device to become '.current'.");
227+
m_CompensateForScreenOrientationContent = new GUIContent("Compensate Orientation", "Whether sensor input on mobile devices should be transformed to be relative to the current device orientation.");
228+
m_DefaultDeadzoneMinContent = new GUIContent("Default Deadzone Min", "Default 'min' value for Stick Deadzone and Axis Deadzone processors.");
229+
m_DefaultDeadzoneMaxContent = new GUIContent("Default Deadzone Max", "Default 'max' value for Stick Deadzone and Axis Deadzone processors.");
230+
m_DefaultButtonPressPointContent = new GUIContent("Default Button Press Point", "The default press point used for Button controls as well as for various interactions. For button controls which have analog physical inputs, this configures how far they need to be held down to be considered 'pressed'.");
231+
m_DefaultTapTimeContent = new GUIContent("Default Tap Time", "Default duration to be used for Tap and MultiTap interactions. Also used by by Touch screen devices to distinguish taps from to new touches.");
232+
m_DefaultSlowTapTimeContent = new GUIContent("Default Slow Tap Time", "Default duration to be used for SlowTap interactions.");
233+
m_DefaultHoldTimeContent = new GUIContent("Default Hold Time", "Default duration to be used for Hold interactions.");
234+
m_TapRadiusContent = new GUIContent("Tap Radius", "Maximum distance between two finger taps on a touch screen device allowed for the system to consider this a tap of the same touch (as opposed to a new touch).");
235+
m_MultiTapDelayTimeContent = new GUIContent("MultiTap Delay Time", "Default delay to be allowed between taps for MultiTap interactions. Also used by by touch devices to count multi taps.");
236+
225237
// Initialize ReorderableList for list of supported devices.
226238
var supportedDevicesProperty = m_SettingsObject.FindProperty("m_SupportedDevices");
227239
m_SupportedDevices = new ReorderableList(m_SettingsObject, supportedDevicesProperty)
@@ -306,7 +318,6 @@ private static string[] FindInputSettingsInProject()
306318

307319
[NonSerialized] private SerializedObject m_SettingsObject;
308320
[NonSerialized] private SerializedProperty m_UpdateMode;
309-
[NonSerialized] private SerializedProperty m_RunUpdatesManually;
310321
[NonSerialized] private SerializedProperty m_CompensateForScreenOrientation;
311322
[NonSerialized] private SerializedProperty m_FilterNoiseOnCurrent;
312323
[NonSerialized] private SerializedProperty m_DefaultDeadzoneMin;
@@ -326,6 +337,18 @@ private static string[] FindInputSettingsInProject()
326337
[NonSerialized] private GUIContent m_SupportedDevicesText = EditorGUIUtility.TrTextContent("Supported Devices");
327338
[NonSerialized] private GUIStyle m_NewAssetButtonStyle;
328339

340+
GUIContent m_UpdateModeContent;
341+
GUIContent m_FilterNoiseOnCurrentContent;
342+
GUIContent m_CompensateForScreenOrientationContent;
343+
GUIContent m_DefaultDeadzoneMinContent;
344+
GUIContent m_DefaultDeadzoneMaxContent;
345+
GUIContent m_DefaultButtonPressPointContent;
346+
GUIContent m_DefaultTapTimeContent;
347+
GUIContent m_DefaultSlowTapTimeContent;
348+
GUIContent m_DefaultHoldTimeContent;
349+
GUIContent m_TapRadiusContent;
350+
GUIContent m_MultiTapDelayTimeContent;
351+
329352
private static InputSettingsProvider s_Instance;
330353

331354
internal static void ForceReload()

0 commit comments

Comments
 (0)