diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs index 31be92aa87..f636b20cb9 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs @@ -323,7 +323,7 @@ public static List> GetActionsAsTreeViewDa var nextBinding = actionBindings[++i]; while (nextBinding.isPartOfComposite) { - var name = GetHumanReadableCompositeName(nextBinding); + var name = GetHumanReadableCompositeName(nextBinding, state.selectedControlScheme, state.selectedControlSchemeIndex); compositeItems.Add(new TreeViewItemData(id++, new ActionOrBindingData(false, name, actionMapIndex, false, GetControlLayout(nextBinding.path), nextBinding.indexOfBinding))); @@ -341,7 +341,7 @@ public static List> GetActionsAsTreeViewDa else { bindingItems.Add(new TreeViewItemData(id++, - new ActionOrBindingData(false, GetHumanReadableBindingName(serializedInputBinding), actionMapIndex, + new ActionOrBindingData(false, GetHumanReadableBindingName(serializedInputBinding, state.selectedControlSchemeIndex, state.selectedControlScheme), actionMapIndex, false, GetControlLayout(serializedInputBinding.path), serializedInputBinding.indexOfBinding))); } } @@ -351,18 +351,28 @@ public static List> GetActionsAsTreeViewDa return actionItems; } - private static string GetHumanReadableBindingName(SerializedInputBinding serializedInputBinding) + private static string GetHumanReadableBindingName(SerializedInputBinding serializedInputBinding, int currentControlSchemeIndex, InputControlScheme? currentControlScheme) { var name = InputControlPath.ToHumanReadableString(serializedInputBinding.path); if (String.IsNullOrEmpty(name)) name = ""; + if (!IsBindingPartOfCurrentControlScheme(serializedInputBinding, currentControlScheme, currentControlSchemeIndex)) + name += " {GLOBAL}"; return name; } - internal static string GetHumanReadableCompositeName(SerializedInputBinding binding) + private static bool IsBindingPartOfCurrentControlScheme(SerializedInputBinding serializedInputBinding, InputControlScheme? currentControlScheme, int currentControlSchemeIndex) + { + if (currentControlScheme.HasValue && currentControlSchemeIndex >= 0) + return serializedInputBinding.controlSchemes.Contains(currentControlScheme.Value.name); + + return true; + } + + internal static string GetHumanReadableCompositeName(SerializedInputBinding binding, InputControlScheme? currentControlScheme, int currentControlSchemeIndex) { return $"{ObjectNames.NicifyVariableName(binding.name)}: " + - $"{GetHumanReadableBindingName(binding)}"; + $"{GetHumanReadableBindingName(binding, currentControlSchemeIndex, currentControlScheme)}"; } private static string GetControlLayout(string path)