Esempio n. 1
0
 private void Travel(int next)
 {
     if (next < 0)
     {
         // ISSUE: reference to a compiler-generated field
         if (this.ReachEndEvent == null)
         {
             return;
         }
         // ISSUE: reference to a compiler-generated field
         this.ReachEndEvent(this.CurrentPoint, next);
         // ISSUE: reference to a compiler-generated field
         if (this.TravelEvent == null)
         {
             return;
         }
         // ISSUE: reference to a compiler-generated field
         this.TravelEvent();
     }
     else
     {
         UILinkPointNavigator.ChangePoint(next);
         // ISSUE: reference to a compiler-generated field
         if (this.TravelEvent == null)
         {
             return;
         }
         // ISSUE: reference to a compiler-generated field
         this.TravelEvent();
     }
 }
Esempio n. 2
0
 private void Travel(int next)
 {
     if (next < 0)
     {
         if (this.ReachEndEvent == null)
         {
             return;
         }
         this.ReachEndEvent(this.CurrentPoint, next);
         if (this.TravelEvent == null)
         {
             return;
         }
         this.TravelEvent();
     }
     else
     {
         UILinkPointNavigator.ChangePoint(next);
         if (this.TravelEvent == null)
         {
             return;
         }
         this.TravelEvent();
     }
 }
        public static void ProcessChanges()
        {
            var page = UILinkPointNavigator.Pages[UILinkPointNavigator.OldPage];

            if (UILinkPointNavigator.OldPage != UILinkPointNavigator.CurrentPage)
            {
                page.Leave();
                if (!UILinkPointNavigator.Pages.TryGetValue(UILinkPointNavigator.CurrentPage, out page))
                {
                    UILinkPointNavigator.GoToDefaultPage(0);
                    UILinkPointNavigator.ProcessChanges();
                    UILinkPointNavigator.OverridePoint = -1;
                }

                page.CurrentPoint = page.DefaultPoint;
                page.Enter();
                page.Update();
                UILinkPointNavigator.OldPage = UILinkPointNavigator.CurrentPage;
            }

            if (UILinkPointNavigator.OverridePoint == -1 ||
                !page.LinkMap.ContainsKey(UILinkPointNavigator.OverridePoint))
            {
                return;
            }
            page.CurrentPoint = UILinkPointNavigator.OverridePoint;
        }
Esempio n. 4
0
 public void SwapPageRight()
 {
     if (this.OnPageMoveAttempt != null)
     {
         this.OnPageMoveAttempt(1);
     }
     UILinkPointNavigator.ChangePage(this.PageOnRight);
 }
 public void SwapPageLeft()
 {
     if (this.OnPageMoveAttempt != null)
     {
         this.OnPageMoveAttempt(-1);
     }
     UILinkPointNavigator.ChangePage(PageOnLeft);
 }
Esempio n. 6
0
 // Token: 0x06000C9D RID: 3229 RVA: 0x003DAD74 File Offset: 0x003D8F74
 public static void ChangePage(int PageID)
 {
     if (UILinkPointNavigator.Pages.ContainsKey(PageID) && UILinkPointNavigator.Pages[PageID].CanEnter())
     {
         UILinkPointNavigator.CurrentPage = PageID;
         UILinkPointNavigator.ProcessChanges();
     }
 }
Esempio n. 7
0
 // Token: 0x06000C9E RID: 3230 RVA: 0x003DADA0 File Offset: 0x003D8FA0
 public static void ChangePoint(int PointID)
 {
     if (UILinkPointNavigator.Points.ContainsKey(PointID))
     {
         UILinkPointNavigator.CurrentPage   = UILinkPointNavigator.Points[PointID].Page;
         UILinkPointNavigator.OverridePoint = PointID;
         UILinkPointNavigator.ProcessChanges();
     }
 }
Esempio n. 8
0
 public static void ChangePage(int PageID)
 {
     if (!UILinkPointNavigator.Pages.ContainsKey(PageID) || !UILinkPointNavigator.Pages[PageID].CanEnter())
     {
         return;
     }
     SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f);
     UILinkPointNavigator.CurrentPage = PageID;
     UILinkPointNavigator.ProcessChanges();
 }
Esempio n. 9
0
        // Token: 0x06000C9F RID: 3231 RVA: 0x003DADD0 File Offset: 0x003D8FD0
        public static void ProcessChanges()
        {
            UILinkPage uILinkPage = UILinkPointNavigator.Pages[UILinkPointNavigator.OldPage];

            if (UILinkPointNavigator.OldPage != UILinkPointNavigator.CurrentPage)
            {
                uILinkPage.Leave();
                if (!UILinkPointNavigator.Pages.TryGetValue(UILinkPointNavigator.CurrentPage, out uILinkPage))
                {
                    UILinkPointNavigator.GoToDefaultPage(0);
                    UILinkPointNavigator.ProcessChanges();
                    UILinkPointNavigator.OverridePoint = -1;
                }
                uILinkPage.CurrentPoint = uILinkPage.DefaultPoint;
                uILinkPage.Enter();
                uILinkPage.Update();
                UILinkPointNavigator.OldPage = UILinkPointNavigator.CurrentPage;
            }
            if (UILinkPointNavigator.OverridePoint != -1 && uILinkPage.LinkMap.ContainsKey(UILinkPointNavigator.OverridePoint))
            {
                uILinkPage.CurrentPoint = UILinkPointNavigator.OverridePoint;
            }
        }
Esempio n. 10
0
        public static void Update()
        {
            if (!GamepadMainMenuHandler.CanRun)
            {
                UILinkPage page = UILinkPointNavigator.Pages[1000];
                page.CurrentPoint = page.DefaultPoint;
                Vector2 vector2 = new Vector2((float)Math.Cos((double)Main.GlobalTimeWrappedHourly * 6.28318548202515), (float)Math.Sin((double)Main.GlobalTimeWrappedHourly * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f;
                UILinkPointNavigator.SetPosition(2000, new Vector2((float)Main.screenWidth, (float)Main.screenHeight) / 2f + vector2);
            }
            else
            {
                if (!Main.gameMenu || Main.MenuUI.IsVisible || GamepadMainMenuHandler.LastDrew != Main.menuMode)
                {
                    return;
                }
                int lastMainMenu = GamepadMainMenuHandler.LastMainMenu;
                GamepadMainMenuHandler.LastMainMenu = Main.menuMode;
                switch (Main.menuMode)
                {
                case 17:
                case 18:
                case 19:
                case 21:
                case 22:
                case 23:
                case 24:
                case 26:
                    if (GamepadMainMenuHandler.MenuItemPositions.Count >= 4)
                    {
                        Vector2 menuItemPosition = GamepadMainMenuHandler.MenuItemPositions[3];
                        GamepadMainMenuHandler.MenuItemPositions.RemoveAt(3);
                        if (Main.menuMode == 17)
                        {
                            GamepadMainMenuHandler.MenuItemPositions.Insert(0, menuItemPosition);
                            break;
                        }
                        break;
                    }
                    break;

                case 28:
                    if (GamepadMainMenuHandler.MenuItemPositions.Count >= 3)
                    {
                        GamepadMainMenuHandler.MenuItemPositions.RemoveAt(1);
                        break;
                    }
                    break;
                }
                UILinkPage page = UILinkPointNavigator.Pages[1000];
                if (lastMainMenu != Main.menuMode)
                {
                    page.CurrentPoint = page.DefaultPoint;
                }
                for (int index = 0; index < GamepadMainMenuHandler.MenuItemPositions.Count; ++index)
                {
                    Vector2 vector2 = GamepadMainMenuHandler.MenuItemPositions[index] * Main.UIScale;
                    if (index == 0 && lastMainMenu != GamepadMainMenuHandler.LastMainMenu && (PlayerInput.UsingGamepad && Main.InvisibleCursorForGamepad))
                    {
                        Main.mouseX    = PlayerInput.MouseX = (int)vector2.X;
                        Main.mouseY    = PlayerInput.MouseY = (int)vector2.Y;
                        Main.menuFocus = -1;
                    }
                    UILinkPoint link = page.LinkMap[2000 + index];
                    link.Position = vector2;
                    link.Up       = index != 0 ? 2000 + index - 1 : -1;
                    link.Left     = -3;
                    link.Right    = -4;
                    link.Down     = index != GamepadMainMenuHandler.MenuItemPositions.Count - 1 ? 2000 + index + 1 : -2;
                }
                GamepadMainMenuHandler.MenuItemPositions.Clear();
            }
        }
Esempio n. 11
0
        public static void Update()
        {
            bool inUse = UILinkPointNavigator.InUse;

            UILinkPointNavigator.InUse = false;
            bool flag1 = true;

            if (flag1)
            {
                switch (PlayerInput.CurrentInputMode)
                {
                case InputMode.Keyboard:
                case InputMode.KeyboardUI:
                case InputMode.Mouse:
                    if (!Main.gameMenu)
                    {
                        flag1 = false;
                        break;
                    }
                    break;
                }
            }
            if (flag1 && PlayerInput.NavigatorRebindingLock > 0)
            {
                flag1 = false;
            }
            if (flag1 && !Main.gameMenu && !PlayerInput.UsingGamepadUI)
            {
                flag1 = false;
            }
            if (flag1 && !Main.gameMenu && PlayerInput.InBuildingMode)
            {
                flag1 = false;
            }
            if (flag1 && !Main.gameMenu && !UILinkPointNavigator.Available)
            {
                flag1 = false;
            }
            bool       flag2 = false;
            UILinkPage uiLinkPage;

            if (!UILinkPointNavigator.Pages.TryGetValue(UILinkPointNavigator.CurrentPage, out uiLinkPage))
            {
                flag2 = true;
            }
            else if (!uiLinkPage.IsValid())
            {
                flag2 = true;
            }
            if (flag2)
            {
                UILinkPointNavigator.GoToDefaultPage(0);
                UILinkPointNavigator.ProcessChanges();
                flag1 = false;
            }
            if (inUse != flag1)
            {
                if (!flag1)
                {
                    uiLinkPage.Leave();
                    UILinkPointNavigator.GoToDefaultPage(0);
                    UILinkPointNavigator.ProcessChanges();
                }
                else
                {
                    UILinkPointNavigator.GoToDefaultPage(0);
                    UILinkPointNavigator.ProcessChanges();
                    uiLinkPage.Enter();
                }
                if (flag1)
                {
                    Main.player[Main.myPlayer].releaseInventory = false;
                    Main.player[Main.myPlayer].releaseUseTile   = false;
                    PlayerInput.LockGamepadTileUseButton        = true;
                }
                if (!Main.gameMenu)
                {
                    if (flag1)
                    {
                        PlayerInput.NavigatorCachePosition();
                    }
                    else
                    {
                        PlayerInput.NavigatorUnCachePosition();
                    }
                }
            }
            if (!flag1)
            {
                return;
            }
            UILinkPointNavigator.InUse         = true;
            UILinkPointNavigator.OverridePoint = -1;
            if (UILinkPointNavigator.PageLeftCD > 0)
            {
                --UILinkPointNavigator.PageLeftCD;
            }
            if (UILinkPointNavigator.PageRightCD > 0)
            {
                --UILinkPointNavigator.PageRightCD;
            }
            Vector2 navigatorDirections = PlayerInput.Triggers.Current.GetNavigatorDirections();
            int     num1  = !PlayerInput.Triggers.Current.HotbarMinus ? 0 : (!PlayerInput.Triggers.Current.HotbarPlus ? 1 : 0);
            bool    flag3 = PlayerInput.Triggers.Current.HotbarPlus && !PlayerInput.Triggers.Current.HotbarMinus;

            if (num1 == 0)
            {
                UILinkPointNavigator.PageLeftCD = 0;
            }
            if (!flag3)
            {
                UILinkPointNavigator.PageRightCD = 0;
            }
            int  num2  = num1 == 0 ? 0 : (UILinkPointNavigator.PageLeftCD == 0 ? 1 : 0);
            bool flag4 = flag3 && UILinkPointNavigator.PageRightCD == 0;

            if ((double)UILinkPointNavigator.LastInput.X != (double)navigatorDirections.X)
            {
                UILinkPointNavigator.XCooldown = 0;
            }
            if ((double)UILinkPointNavigator.LastInput.Y != (double)navigatorDirections.Y)
            {
                UILinkPointNavigator.YCooldown = 0;
            }
            if (UILinkPointNavigator.XCooldown > 0)
            {
                --UILinkPointNavigator.XCooldown;
            }
            if (UILinkPointNavigator.YCooldown > 0)
            {
                --UILinkPointNavigator.YCooldown;
            }
            UILinkPointNavigator.LastInput = navigatorDirections;
            if (num2 != 0)
            {
                UILinkPointNavigator.PageLeftCD = 16;
            }
            if (flag4)
            {
                UILinkPointNavigator.PageRightCD = 16;
            }
            UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].Update();
            int num3 = 10;

            if (!Main.gameMenu && Main.playerInventory && (!Main.ingameOptionsWindow && !Main.inFancyUI) && (UILinkPointNavigator.CurrentPage == 0 || UILinkPointNavigator.CurrentPage == 4 || (UILinkPointNavigator.CurrentPage == 2 || UILinkPointNavigator.CurrentPage == 1) || (UILinkPointNavigator.CurrentPage == 20 || UILinkPointNavigator.CurrentPage == 21)))
            {
                num3 = PlayerInput.CurrentProfile.InventoryMoveCD;
            }
            if ((double)navigatorDirections.X == -1.0 && UILinkPointNavigator.XCooldown == 0)
            {
                UILinkPointNavigator.XCooldown = num3;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelLeft();
            }
            if ((double)navigatorDirections.X == 1.0 && UILinkPointNavigator.XCooldown == 0)
            {
                UILinkPointNavigator.XCooldown = num3;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelRight();
            }
            if ((double)navigatorDirections.Y == -1.0 && UILinkPointNavigator.YCooldown == 0)
            {
                UILinkPointNavigator.YCooldown = num3;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelUp();
            }
            if ((double)navigatorDirections.Y == 1.0 && UILinkPointNavigator.YCooldown == 0)
            {
                UILinkPointNavigator.YCooldown = num3;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelDown();
            }
            UILinkPointNavigator.XCooldown = UILinkPointNavigator.YCooldown = Math.Max(UILinkPointNavigator.XCooldown, UILinkPointNavigator.YCooldown);
            if (num2 != 0)
            {
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageLeft();
            }
            if (flag4)
            {
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageRight();
            }
            if (PlayerInput.Triggers.Current.UsedMovementKey)
            {
                Vector2 position  = UILinkPointNavigator.Points[UILinkPointNavigator.CurrentPoint].Position;
                Vector2 vector2_1 = new Vector2((float)PlayerInput.MouseX, (float)PlayerInput.MouseY);
                float   num4      = 0.3f;
                if (PlayerInput.InvisibleGamepadInMenus)
                {
                    num4 = 1f;
                }
                Vector2 vector2_2 = position;
                double  num5      = (double)num4;
                Vector2 vector2_3 = Vector2.Lerp(vector2_1, vector2_2, (float)num5);
                if (Main.gameMenu)
                {
                    if ((double)Math.Abs(vector2_3.X - position.X) <= 5.0)
                    {
                        vector2_3.X = position.X;
                    }
                    if ((double)Math.Abs(vector2_3.Y - position.Y) <= 5.0)
                    {
                        vector2_3.Y = position.Y;
                    }
                }
                PlayerInput.MouseX = (int)vector2_3.X;
                PlayerInput.MouseY = (int)vector2_3.Y;
            }
            UILinkPointNavigator.ResetFlagsEnd();
        }
Esempio n. 12
0
 public void SwapPageRight()
 {
     UILinkPointNavigator.ChangePage(this.PageOnRight);
 }
Esempio n. 13
0
 public void SwapPageLeft()
 {
     UILinkPointNavigator.ChangePage(this.PageOnLeft);
 }
        public static void Update()
        {
            if (!CanRun)
            {
                UILinkPage uILinkPage = UILinkPointNavigator.Pages[1000];
                uILinkPage.CurrentPoint = uILinkPage.DefaultPoint;
                Vector2 value = new Vector2((float)Math.Cos(Main.GlobalTimeWrappedHourly * ((float)Math.PI * 2f)), (float)Math.Sin(Main.GlobalTimeWrappedHourly * ((float)Math.PI * 2f) * 2f)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f;
                UILinkPointNavigator.SetPosition(2000, new Vector2(Main.screenWidth, Main.screenHeight) / 2f + value);
            }
            else
            {
                if (!Main.gameMenu || Main.MenuUI.IsVisible || LastDrew != Main.menuMode)
                {
                    return;
                }
                int lastMainMenu = LastMainMenu;
                LastMainMenu = Main.menuMode;
                switch (Main.menuMode)
                {
                case 17:
                case 18:
                case 19:
                case 21:
                case 22:
                case 23:
                case 24:
                case 26:
                    if (MenuItemPositions.Count >= 4)
                    {
                        Vector2 item = MenuItemPositions[3];
                        MenuItemPositions.RemoveAt(3);
                        if (Main.menuMode == 17)
                        {
                            MenuItemPositions.Insert(0, item);
                        }
                    }
                    break;

                case 28:
                    if (MenuItemPositions.Count >= 3)
                    {
                        MenuItemPositions.RemoveAt(1);
                    }
                    break;
                }
                UILinkPage uILinkPage2 = UILinkPointNavigator.Pages[1000];
                if (lastMainMenu != Main.menuMode)
                {
                    uILinkPage2.CurrentPoint = uILinkPage2.DefaultPoint;
                }
                for (int i = 0; i < MenuItemPositions.Count; i++)
                {
                    Vector2 position = MenuItemPositions[i] * Main.UIScale;
                    if (i == 0 && lastMainMenu != LastMainMenu && PlayerInput.UsingGamepad && Main.InvisibleCursorForGamepad)
                    {
                        Main.mouseX    = (PlayerInput.MouseX = (int)position.X);
                        Main.mouseY    = (PlayerInput.MouseY = (int)position.Y);
                        Main.menuFocus = -1;
                    }
                    UILinkPoint uILinkPoint = uILinkPage2.LinkMap[2000 + i];
                    uILinkPoint.Position = position;
                    if (i == 0)
                    {
                        uILinkPoint.Up = -1;
                    }
                    else
                    {
                        uILinkPoint.Up = 2000 + i - 1;
                    }
                    uILinkPoint.Left  = -3;
                    uILinkPoint.Right = -4;
                    if (i == MenuItemPositions.Count - 1)
                    {
                        uILinkPoint.Down = -2;
                    }
                    else
                    {
                        uILinkPoint.Down = 2000 + i + 1;
                    }
                }
                MenuItemPositions.Clear();
            }
        }
Esempio n. 15
0
        // Token: 0x06000C6B RID: 3179 RVA: 0x003D9CF4 File Offset: 0x003D7EF4
        public static void Update()
        {
            if (!GamepadMainMenuHandler.CanRun)
            {
                UILinkPage expr_19 = UILinkPointNavigator.Pages[1000];
                expr_19.CurrentPoint = expr_19.DefaultPoint;
                Vector2 value = new Vector2((float)Math.Cos((double)(Main.GlobalTime * 6.28318548f)), (float)Math.Sin((double)(Main.GlobalTime * 6.28318548f * 2f))) * new Vector2(30f, 15f) + Vector2.UnitY * 20f;
                UILinkPointNavigator.SetPosition(2000, new Vector2((float)Main.screenWidth, (float)Main.screenHeight) / 2f + value);
                return;
            }
            if (!Main.gameMenu)
            {
                return;
            }
            if (Main.MenuUI.IsVisible)
            {
                return;
            }
            if (GamepadMainMenuHandler.LastDrew != Main.menuMode)
            {
                return;
            }
            int lastMainMenu = GamepadMainMenuHandler.LastMainMenu;

            GamepadMainMenuHandler.LastMainMenu = Main.menuMode;
            switch (Main.menuMode)
            {
            case 17:
            case 18:
            case 19:
            case 21:
            case 22:
            case 23:
            case 24:
            case 26:
                if (GamepadMainMenuHandler.MenuItemPositions.Count >= 4)
                {
                    Vector2 item = GamepadMainMenuHandler.MenuItemPositions[3];
                    GamepadMainMenuHandler.MenuItemPositions.RemoveAt(3);
                    if (Main.menuMode == 17)
                    {
                        GamepadMainMenuHandler.MenuItemPositions.Insert(0, item);
                    }
                }
                break;

            case 28:
                if (GamepadMainMenuHandler.MenuItemPositions.Count >= 3)
                {
                    GamepadMainMenuHandler.MenuItemPositions.RemoveAt(1);
                }
                break;
            }
            UILinkPage uILinkPage = UILinkPointNavigator.Pages[1000];

            if (lastMainMenu != Main.menuMode)
            {
                uILinkPage.CurrentPoint = uILinkPage.DefaultPoint;
            }
            for (int i = 0; i < GamepadMainMenuHandler.MenuItemPositions.Count; i++)
            {
                if (i == 0 && lastMainMenu != GamepadMainMenuHandler.LastMainMenu && PlayerInput.UsingGamepad && Main.InvisibleCursorForGamepad)
                {
                    Main.mouseX    = (PlayerInput.MouseX = (int)GamepadMainMenuHandler.MenuItemPositions[i].X);
                    Main.mouseY    = (PlayerInput.MouseY = (int)GamepadMainMenuHandler.MenuItemPositions[i].Y);
                    Main.menuFocus = -1;
                }
                UILinkPoint uILinkPoint = uILinkPage.LinkMap[2000 + i];
                uILinkPoint.Position = GamepadMainMenuHandler.MenuItemPositions[i];
                if (i == 0)
                {
                    uILinkPoint.Up = -1;
                }
                else
                {
                    uILinkPoint.Up = 2000 + i - 1;
                }
                uILinkPoint.Left  = -3;
                uILinkPoint.Right = -4;
                if (i == GamepadMainMenuHandler.MenuItemPositions.Count - 1)
                {
                    uILinkPoint.Down = -2;
                }
                else
                {
                    uILinkPoint.Down = 2000 + i + 1;
                }
            }
            GamepadMainMenuHandler.MenuItemPositions.Clear();
        }
Esempio n. 16
0
        // Token: 0x06000C98 RID: 3224 RVA: 0x003DA7A8 File Offset: 0x003D89A8
        public static void Update()
        {
            bool inUse = UILinkPointNavigator.InUse;

            UILinkPointNavigator.InUse = false;
            bool flag = true;

            if (flag)
            {
                InputMode currentInputMode = PlayerInput.CurrentInputMode;
                if (currentInputMode <= InputMode.Mouse && !Main.gameMenu)
                {
                    flag = false;
                }
            }
            if (flag && PlayerInput.NavigatorRebindingLock > 0)
            {
                flag = false;
            }
            if (flag && !Main.gameMenu && !PlayerInput.UsingGamepadUI)
            {
                flag = false;
            }
            if (flag && !Main.gameMenu && PlayerInput.InBuildingMode)
            {
                flag = false;
            }
            if (flag && !Main.gameMenu && !UILinkPointNavigator.Available)
            {
                flag = false;
            }
            bool       flag2 = false;
            UILinkPage uILinkPage;

            if (!UILinkPointNavigator.Pages.TryGetValue(UILinkPointNavigator.CurrentPage, out uILinkPage))
            {
                flag2 = true;
            }
            else if (!uILinkPage.IsValid())
            {
                flag2 = true;
            }
            if (flag2)
            {
                UILinkPointNavigator.GoToDefaultPage(0);
                UILinkPointNavigator.ProcessChanges();
                flag = false;
            }
            if (inUse != flag)
            {
                if (!flag)
                {
                    uILinkPage.Leave();
                    UILinkPointNavigator.GoToDefaultPage(0);
                    UILinkPointNavigator.ProcessChanges();
                }
                else
                {
                    UILinkPointNavigator.GoToDefaultPage(0);
                    UILinkPointNavigator.ProcessChanges();
                    uILinkPage.Enter();
                }
                if (flag)
                {
                    Main.player[Main.myPlayer].releaseInventory = false;
                    Main.player[Main.myPlayer].releaseUseTile   = false;
                    PlayerInput.LockTileUseButton = true;
                }
                if (!Main.gameMenu)
                {
                    if (flag)
                    {
                        PlayerInput.NavigatorCachePosition();
                    }
                    else
                    {
                        PlayerInput.NavigatorUnCachePosition();
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            UILinkPointNavigator.InUse         = true;
            UILinkPointNavigator.OverridePoint = -1;
            if (UILinkPointNavigator.PageLeftCD > 0)
            {
                UILinkPointNavigator.PageLeftCD--;
            }
            if (UILinkPointNavigator.PageRightCD > 0)
            {
                UILinkPointNavigator.PageRightCD--;
            }
            Vector2 navigatorDirections = PlayerInput.Triggers.Current.GetNavigatorDirections();
            bool    flag3     = PlayerInput.Triggers.Current.HotbarMinus && !PlayerInput.Triggers.Current.HotbarPlus;
            object  arg_1AC_0 = PlayerInput.Triggers.Current.HotbarPlus && !PlayerInput.Triggers.Current.HotbarMinus;

            if (!flag3)
            {
                UILinkPointNavigator.PageLeftCD = 0;
            }
            object expr_1AC = arg_1AC_0;

            if (expr_1AC == null)
            {
                UILinkPointNavigator.PageRightCD = 0;
            }
            flag3 = (flag3 && UILinkPointNavigator.PageLeftCD == 0);
            object arg_23F_0 = expr_1AC != null && UILinkPointNavigator.PageRightCD == 0;

            if (UILinkPointNavigator.LastInput.X != navigatorDirections.X)
            {
                UILinkPointNavigator.XCooldown = 0;
            }
            if (UILinkPointNavigator.LastInput.Y != navigatorDirections.Y)
            {
                UILinkPointNavigator.YCooldown = 0;
            }
            if (UILinkPointNavigator.XCooldown > 0)
            {
                UILinkPointNavigator.XCooldown--;
            }
            if (UILinkPointNavigator.YCooldown > 0)
            {
                UILinkPointNavigator.YCooldown--;
            }
            UILinkPointNavigator.LastInput = navigatorDirections;
            if (flag3)
            {
                UILinkPointNavigator.PageLeftCD = 16;
            }
            object expr_23F = arg_23F_0;

            if (expr_23F != null)
            {
                UILinkPointNavigator.PageRightCD = 16;
            }
            UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].Update();
            int num = 10;

            if (!Main.gameMenu && Main.playerInventory && !Main.ingameOptionsWindow && !Main.inFancyUI && (UILinkPointNavigator.CurrentPage == 0 || UILinkPointNavigator.CurrentPage == 4 || UILinkPointNavigator.CurrentPage == 2 || UILinkPointNavigator.CurrentPage == 1))
            {
                num = PlayerInput.CurrentProfile.InventoryMoveCD;
            }
            if (navigatorDirections.X == -1f && UILinkPointNavigator.XCooldown == 0)
            {
                UILinkPointNavigator.XCooldown = num;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelLeft();
            }
            if (navigatorDirections.X == 1f && UILinkPointNavigator.XCooldown == 0)
            {
                UILinkPointNavigator.XCooldown = num;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelRight();
            }
            if (navigatorDirections.Y == -1f && UILinkPointNavigator.YCooldown == 0)
            {
                UILinkPointNavigator.YCooldown = num;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelUp();
            }
            if (navigatorDirections.Y == 1f && UILinkPointNavigator.YCooldown == 0)
            {
                UILinkPointNavigator.YCooldown = num;
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelDown();
            }
            UILinkPointNavigator.XCooldown = (UILinkPointNavigator.YCooldown = Math.Max(UILinkPointNavigator.XCooldown, UILinkPointNavigator.YCooldown));
            if (flag3)
            {
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageLeft();
            }
            if (expr_23F != null)
            {
                UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageRight();
            }
            if (PlayerInput.Triggers.Current.UsedMovementKey)
            {
                Vector2 position  = UILinkPointNavigator.Points[UILinkPointNavigator.CurrentPoint].Position;
                Vector2 arg_404_0 = new Vector2((float)PlayerInput.MouseX, (float)PlayerInput.MouseY);
                float   amount    = 0.3f;
                if (PlayerInput.InvisibleGamepadInMenus)
                {
                    amount = 1f;
                }
                Vector2 vector = Vector2.Lerp(arg_404_0, position, amount);
                if (Main.gameMenu)
                {
                    if (Math.Abs(vector.X - position.X) <= 5f)
                    {
                        vector.X = position.X;
                    }
                    if (Math.Abs(vector.Y - position.Y) <= 5f)
                    {
                        vector.Y = position.Y;
                    }
                }
                PlayerInput.MouseX = (int)vector.X;
                PlayerInput.MouseY = (int)vector.Y;
            }
            UILinkPointNavigator.ResetFlagsEnd();
        }