Esempio n. 1
0
    /// <summary>
    ///   Get the input conflicts if there are any
    /// </summary>
    /// <param name="item">The event with the new value to set</param>
    /// <returns>The collisions if any of item against already set controls</returns>
    public InputEventItem?Conflicts(InputEventItem item)
    {
        // This needs to be done this way as it seems older compiler version can't understand the code otherwise
        // and issues warnings
        // ReSharper disable InlineOutVariableDeclaration RedundantAssignment
        InputActionItem?inputActionItem = null;

        if (item.AssociatedAction?.TryGetTarget(out inputActionItem) != true || inputActionItem == null)
        {
            return(default);
Esempio n. 2
0
    internal static InputActionItem BuildGUI(InputGroupItem associatedGroup, NamedInputAction data,
                                             IEnumerable <SpecifiedInputKey> inputs)
    {
        associatedGroup.AssociatedList.TryGetTarget(out var target);

        if (target == null)
        {
            throw new ArgumentException("associatedGroup has no associated list");
        }

        var inputActionItem = (InputActionItem)target.InputActionItemScene.Instance();

        inputActionItem.InputName       = data.InputName;
        inputActionItem.DisplayName     = data.Name;
        inputActionItem.AssociatedGroup = new WeakReference <InputGroupItem>(associatedGroup);
        inputActionItem.Inputs          =
            new ObservableCollection <InputEventItem>(inputs.Select(d => InputEventItem.BuildGUI(inputActionItem, d)));

        return(inputActionItem);
    }
Esempio n. 3
0
 /// <summary>
 ///   Get the input conflicts if there are any
 /// </summary>
 /// <param name="item">The event with the new value to set</param>
 /// <returns>The collisions if any of item against already set controls</returns>
 public InputEventItem Conflicts(InputEventItem item)
 {
     if (!item.AssociatedAction.TryGetTarget(out var inputActionItem))
     {
         return(default);