@@ -323,7 +323,7 @@ public static List<TreeViewItemData<ActionOrBindingData>> GetActionsAsTreeViewDa
323
323
var nextBinding = actionBindings [ ++ i ] ;
324
324
while ( nextBinding . isPartOfComposite )
325
325
{
326
- var name = GetHumanReadableCompositeName ( nextBinding ) ;
326
+ var name = GetHumanReadableCompositeName ( nextBinding , state . selectedControlScheme , state . selectedControlSchemeIndex ) ;
327
327
328
328
compositeItems . Add ( new TreeViewItemData < ActionOrBindingData > ( id ++ ,
329
329
new ActionOrBindingData ( false , name , actionMapIndex , false , GetControlLayout ( nextBinding . path ) , nextBinding . indexOfBinding ) ) ) ;
@@ -341,7 +341,7 @@ public static List<TreeViewItemData<ActionOrBindingData>> GetActionsAsTreeViewDa
341
341
else
342
342
{
343
343
bindingItems . Add ( new TreeViewItemData < ActionOrBindingData > ( id ++ ,
344
- new ActionOrBindingData ( false , GetHumanReadableBindingName ( serializedInputBinding ) , actionMapIndex ,
344
+ new ActionOrBindingData ( false , GetHumanReadableBindingName ( serializedInputBinding , state . selectedControlSchemeIndex , state . selectedControlScheme ) , actionMapIndex ,
345
345
false , GetControlLayout ( serializedInputBinding . path ) , serializedInputBinding . indexOfBinding ) ) ) ;
346
346
}
347
347
}
@@ -351,18 +351,28 @@ public static List<TreeViewItemData<ActionOrBindingData>> GetActionsAsTreeViewDa
351
351
return actionItems ;
352
352
}
353
353
354
- private static string GetHumanReadableBindingName ( SerializedInputBinding serializedInputBinding )
354
+ private static string GetHumanReadableBindingName ( SerializedInputBinding serializedInputBinding , int currentControlSchemeIndex , InputControlScheme ? currentControlScheme )
355
355
{
356
356
var name = InputControlPath . ToHumanReadableString ( serializedInputBinding . path ) ;
357
357
if ( String . IsNullOrEmpty ( name ) )
358
358
name = "<No Binding>" ;
359
+ if ( ! IsBindingPartOfCurrentControlScheme ( serializedInputBinding , currentControlScheme , currentControlSchemeIndex ) )
360
+ name += " {GLOBAL}" ;
359
361
return name ;
360
362
}
361
363
362
- internal static string GetHumanReadableCompositeName ( SerializedInputBinding binding )
364
+ private static bool IsBindingPartOfCurrentControlScheme ( SerializedInputBinding serializedInputBinding , InputControlScheme ? currentControlScheme , int currentControlSchemeIndex )
365
+ {
366
+ if ( currentControlScheme . HasValue && currentControlSchemeIndex >= 0 )
367
+ return serializedInputBinding . controlSchemes . Contains ( currentControlScheme . Value . name ) ;
368
+
369
+ return true ;
370
+ }
371
+
372
+ internal static string GetHumanReadableCompositeName ( SerializedInputBinding binding , InputControlScheme ? currentControlScheme , int currentControlSchemeIndex )
363
373
{
364
374
return $ "{ ObjectNames . NicifyVariableName ( binding . name ) } : " +
365
- $ "{ GetHumanReadableBindingName ( binding ) } ";
375
+ $ "{ GetHumanReadableBindingName ( binding , currentControlSchemeIndex , currentControlScheme ) } ";
366
376
}
367
377
368
378
private static string GetControlLayout ( string path )
0 commit comments