Exemplo n.º 1
0
        public bool TryGetMenuNeighbor(NavigationDirection Direction, out IGamepadControllable Neighbor)
        {
            if (HoveredButton.HasValue)
            {
                if (IsLeftSidebarVisible && LeftSidebarButtonBounds.Contains(HoveredButtonBounds.Value) && Direction == NavigationDirection.Right)
                {
                    Neighbor = InventoryMenu;
                    return(true);
                }
                else if (IsRightSidebarVisible && RightSidebarButtonBounds.Contains(HoveredButtonBounds.Value) && Direction == NavigationDirection.Left)
                {
                    Neighbor = InventoryMenu;
                    return(true);
                }
            }

            if (Direction == NavigationDirection.Up)
            {
                Neighbor = Content;
                return(true);
            }

            Neighbor = null;
            return(false);
        }
Exemplo n.º 2
0
 public bool TryGetSlotNeighbor(Rectangle?ItemSlot, NavigationDirection Direction, NavigationWrappingMode HorizontalWrapping, NavigationWrappingMode VerticalWrapping, out Rectangle?Neighbor)
 {
     if (!ItemSlot.HasValue)
     {
         Neighbor = null;
         return(false);
     }
     else if (IsLeftSidebarVisible && LeftSidebarButtonBounds.Contains(ItemSlot.Value))
     {
         return(GamepadControls.TryGetSlotNeighbor(LeftSidebarButtonBounds, ItemSlot, 1, Direction, HorizontalWrapping, VerticalWrapping, out Neighbor));
     }
     else if (IsRightSidebarVisible && RightSidebarButtonBounds.Contains(ItemSlot.Value))
     {
         return(GamepadControls.TryGetSlotNeighbor(RightSidebarButtonBounds, ItemSlot, 1, Direction, HorizontalWrapping, VerticalWrapping, out Neighbor));
     }
     else
     {
         Neighbor = null;
         return(false);
     }
 }