Ejemplo n.º 1
0
        private void UpdateGamepadSquiggle()
        {
            Vector2 vector2 = Vector2.op_Addition(Vector2.op_Multiply(new Vector2((float)Math.Cos((double)Main.GlobalTime * 6.28318548202515), (float)Math.Sin((double)Main.GlobalTime * 6.28318548202515 * 2.0)), new Vector2(30f, 15f)), Vector2.op_Multiply(Vector2.get_UnitY(), 20f));

            UILinkPointNavigator.Points[3000].Unlink();
            UILinkPointNavigator.SetPosition(3000, Vector2.op_Addition(Vector2.op_Division(new Vector2((float)Main.screenWidth, (float)Main.screenHeight), 2f), vector2));
        }
Ejemplo n.º 2
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 3;
            int ID1 = 3000;

            UILinkPointNavigator.SetPosition(ID1, this._backpanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPointNavigator.SetPosition(ID1 + 1, this._outerContainer.GetInnerDimensions().ToRectangle().Center.ToVector2());
            int         index1 = ID1;
            UILinkPoint point1 = UILinkPointNavigator.Points[index1];

            point1.Unlink();
            point1.Up = index1 + 1;
            int         ID2    = index1 + 1;
            UILinkPoint point2 = UILinkPointNavigator.Points[ID2];

            point2.Unlink();
            point2.Up   = ID2 + 1;
            point2.Down = ID2 - 1;
            for (int index2 = 0; index2 < this._categoryButtons.Count; ++index2)
            {
                ++ID2;
                UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = ID2;
                UILinkPointNavigator.SetPosition(ID2, this._categoryButtons[index2].GetInnerDimensions().ToRectangle().Center.ToVector2());
                UILinkPoint point3 = UILinkPointNavigator.Points[ID2];
                point3.Unlink();
                point3.Left  = index2 == 0 ? -3 : ID2 - 1;
                point3.Right = index2 == this._categoryButtons.Count - 1 ? -4 : ID2 + 1;
                point3.Down  = ID1;
            }
        }
Ejemplo n.º 3
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int idRangeStartInclusive    = 3000;
            int idRangeEndExclusive      = idRangeStartInclusive;
            List <SnapPoint> snapPoints  = this.GetSnapPoints();
            UILinkPoint      uiLinkPoint = (UILinkPoint)null;

            for (int index = 0; index < snapPoints.Count; ++index)
            {
                SnapPoint snap = snapPoints[index];
                if (snap.Name == "GoBack")
                {
                    uiLinkPoint = this._helper.MakeLinkPointFromSnapPoint(idRangeEndExclusive++, snap);
                }
            }
            if (PlayerInput.UsingGamepadUI)
            {
                this._helper.MoveToVisuallyClosestPoint(idRangeStartInclusive, idRangeEndExclusive);
            }
            if (!Main.CreativeMenu.GamepadMoveToSearchButtonHack)
            {
                return;
            }
            Main.CreativeMenu.GamepadMoveToSearchButtonHack = false;
            if (uiLinkPoint == null)
            {
                return;
            }
            UILinkPointNavigator.ChangePoint(uiLinkPoint.ID);
        }
Ejemplo n.º 4
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 3;
            int num = 3000;

            UILinkPointNavigator.SetPosition(3000, this._backpanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPointNavigator.SetPosition(3001, this._outerContainer.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPoint point1 = UILinkPointNavigator.Points[3000];

            point1.Unlink();
            point1.Up = 3001;
            int         ID     = 3001;
            UILinkPoint point2 = UILinkPointNavigator.Points[3001];

            point2.Unlink();
            point2.Up   = 3002;
            point2.Down = 3000;
            for (int index = 0; index < this._categoryButtons.Count; ++index)
            {
                ++ID;
                UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = ID;
                UILinkPointNavigator.SetPosition(ID, this._categoryButtons[index].GetInnerDimensions().ToRectangle().Center.ToVector2());
                UILinkPoint point3 = UILinkPointNavigator.Points[ID];
                point3.Unlink();
                point3.Left  = index == 0 ? -3 : ID - 1;
                point3.Right = index == this._categoryButtons.Count - 1 ? -4 : ID + 1;
                point3.Down  = num;
            }
        }
Ejemplo n.º 5
0
        private void UpdateGamepadSquiggle()
        {
            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.Points[3000].Unlink();
            UILinkPointNavigator.SetPosition(3000, new Vector2(Main.screenWidth, Main.screenHeight) / 2f + value);
        }
Ejemplo n.º 6
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 3;
            int num = 3000;

            UILinkPointNavigator.SetPosition(num, _backpanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPointNavigator.SetPosition(num + 1, _outerContainer.GetInnerDimensions().ToRectangle().Center.ToVector2());
            int         num2        = num;
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[num2];

            uILinkPoint.Unlink();
            uILinkPoint.Up = num2 + 1;
            num2++;
            UILinkPoint uILinkPoint2 = UILinkPointNavigator.Points[num2];

            uILinkPoint2.Unlink();
            uILinkPoint2.Up   = num2 + 1;
            uILinkPoint2.Down = num2 - 1;
            for (int i = 0; i < _categoryButtons.Count; i++)
            {
                num2 = (UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num2 + 1);
                UILinkPointNavigator.SetPosition(num2, _categoryButtons[i].GetInnerDimensions().ToRectangle().Center.ToVector2());
                UILinkPoint uILinkPoint3 = UILinkPointNavigator.Points[num2];
                uILinkPoint3.Unlink();
                uILinkPoint3.Left  = ((i == 0) ? (-3) : (num2 - 1));
                uILinkPoint3.Right = ((i == _categoryButtons.Count - 1) ? (-4) : (num2 + 1));
                uILinkPoint3.Down  = num;
            }
        }
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int num = 3000;
            int idRangeEndExclusive      = num;
            List <SnapPoint> snapPoints  = GetSnapPoints();
            UILinkPoint      uILinkPoint = null;

            for (int i = 0; i < snapPoints.Count; i++)
            {
                SnapPoint snapPoint = snapPoints[i];
                string    name      = snapPoint.Name;
                if (name == "GoBack")
                {
                    uILinkPoint = _helper.MakeLinkPointFromSnapPoint(idRangeEndExclusive++, snapPoint);
                }
            }
            if (PlayerInput.UsingGamepadUI)
            {
                _helper.MoveToVisuallyClosestPoint(num, idRangeEndExclusive);
            }
            if (Main.CreativeMenu.GamepadMoveToSearchButtonHack)
            {
                Main.CreativeMenu.GamepadMoveToSearchButtonHack = false;
                if (uILinkPoint != null)
                {
                    UILinkPointNavigator.ChangePoint(uILinkPoint.ID);
                }
            }
        }
        //float scanprogress = -1f;


        private void UpdateGamepadSquiggle()
        {
            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.Points[3000].Unlink();
            UILinkPointNavigator.SetPosition(3000, new Vector2((float)Main.screenWidth, (float)Main.screenHeight) / 2f + value);
        }
Ejemplo n.º 9
0
        private void UpdateGamepadSquiggle()
        {
            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.Points[3000].Unlink();
            UILinkPointNavigator.SetPosition(3000, new Vector2((float)Main.screenWidth, (float)Main.screenHeight) / 2f + vector2);
        }
Ejemplo n.º 10
0
        public void MoveToVisuallyClosestPoint(int idRangeStartInclusive, int idRangeEndExclusive)
        {
            if (UILinkPointNavigator.CurrentPoint >= idRangeStartInclusive && UILinkPointNavigator.CurrentPoint < idRangeEndExclusive)
            {
                return;
            }
            Dictionary <int, UILinkPoint> points = UILinkPointNavigator.Points;
            Vector2     mouseScreen  = Main.MouseScreen;
            UILinkPoint uiLinkPoint1 = (UILinkPoint)null;

            for (int key = idRangeStartInclusive; key < idRangeEndExclusive; ++key)
            {
                UILinkPoint uiLinkPoint2;
                if (!points.TryGetValue(key, out uiLinkPoint2))
                {
                    return;
                }
                if (uiLinkPoint1 == null || (double)Vector2.Distance(mouseScreen, uiLinkPoint1.Position) > (double)Vector2.Distance(mouseScreen, uiLinkPoint2.Position))
                {
                    uiLinkPoint1 = uiLinkPoint2;
                }
            }
            if (uiLinkPoint1 == null)
            {
                return;
            }
            UILinkPointNavigator.ChangePoint(uiLinkPoint1.ID);
        }
Ejemplo n.º 11
0
        public void MoveToVisuallyClosestPoint(int idRangeStartInclusive, int idRangeEndExclusive)
        {
            if (UILinkPointNavigator.CurrentPoint >= idRangeStartInclusive && UILinkPointNavigator.CurrentPoint < idRangeEndExclusive)
            {
                return;
            }
            Dictionary <int, UILinkPoint> points = UILinkPointNavigator.Points;
            Vector2     mouseScreen = Main.MouseScreen;
            UILinkPoint uILinkPoint = null;

            for (int i = idRangeStartInclusive; i < idRangeEndExclusive; i++)
            {
                if (!points.TryGetValue(i, out UILinkPoint value))
                {
                    return;
                }
                if (uILinkPoint == null || Vector2.Distance(mouseScreen, uILinkPoint.Position) > Vector2.Distance(mouseScreen, value.Position))
                {
                    uILinkPoint = value;
                }
            }
            if (uILinkPoint != null)
            {
                UILinkPointNavigator.ChangePoint(uILinkPoint.ID);
            }
        }
Ejemplo n.º 12
0
 public override void OnActivate()
 {
     if (PlayerInput.UsingGamepadUI && _restoreButton != null)
     {
         UILinkPointNavigator.ChangePoint(3002);
     }
 }
Ejemplo n.º 13
0
        private void DrawToggleButton(SpriteBatch spritebatch, Vector2 location)
        {
            Vector2   vector    = _buttonTexture.Size();
            Rectangle rectangle = Utils.CenteredRectangle(location + vector / 2f, vector);

            UILinkPointNavigator.SetPosition(311, rectangle.Center.ToVector2());
            spritebatch.Draw(_buttonTexture.get_Value(), location, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
            Main.LocalPlayer.creativeInterface = false;
            if (rectangle.Contains(Main.MouseScreen.ToPoint()))
            {
                Main.LocalPlayer.creativeInterface = true;
                Main.LocalPlayer.mouseInterface    = true;
                if (Enabled)
                {
                    Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuOpen"), 0, 0);
                }
                else
                {
                    Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuClosed"), 0, 0);
                }
                spritebatch.Draw(_buttonBorderTexture.get_Value(), location, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
                if (Main.mouseLeft && Main.mouseLeftRelease)
                {
                    ToggleMenu();
                }
            }
        }
Ejemplo n.º 14
0
        // Token: 0x060010C2 RID: 4290 RVA: 0x004064B8 File Offset: 0x004046B8
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 3;
            int num = 3000;

            UILinkPointNavigator.SetPosition(num, this._backpanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPointNavigator.SetPosition(num + 1, this._outerContainer.GetInnerDimensions().ToRectangle().Center.ToVector2());
            int         num2    = num;
            UILinkPoint expr_67 = UILinkPointNavigator.Points[num2];

            expr_67.Unlink();
            expr_67.Up = num2 + 1;
            num2++;
            UILinkPoint expr_84 = UILinkPointNavigator.Points[num2];

            expr_84.Unlink();
            expr_84.Up   = num2 + 1;
            expr_84.Down = num2 - 1;
            for (int i = 0; i < this._categoryButtons.Count; i++)
            {
                num2++;
                UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num2;
                UILinkPointNavigator.SetPosition(num2, this._categoryButtons[i].GetInnerDimensions().ToRectangle().Center.ToVector2());
                UILinkPoint expr_E5 = UILinkPointNavigator.Points[num2];
                expr_E5.Unlink();
                expr_E5.Left  = ((i == 0) ? -3 : (num2 - 1));
                expr_E5.Right = ((i == this._categoryButtons.Count - 1) ? -4 : (num2 + 1));
                expr_E5.Down  = num;
            }
        }
Ejemplo n.º 15
0
        private void DrawToggleButton(SpriteBatch spritebatch, Vector2 location)
        {
            Vector2   size      = this._buttonTexture.Size();
            Rectangle rectangle = Utils.CenteredRectangle(location + size / 2f, size);

            UILinkPointNavigator.SetPosition(311, rectangle.Center.ToVector2());
            spritebatch.Draw(this._buttonTexture.get_Value(), location, new Rectangle?(), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
            Main.LocalPlayer.creativeInterface = false;
            if (!rectangle.Contains(Main.MouseScreen.ToPoint()))
            {
                return;
            }
            Main.LocalPlayer.creativeInterface = true;
            Main.LocalPlayer.mouseInterface    = true;
            if (this.Enabled)
            {
                Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuOpen"), 0, (byte)0, -1, -1, -1, -1, 0);
            }
            else
            {
                Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuClosed"), 0, (byte)0, -1, -1, -1, -1, 0);
            }
            spritebatch.Draw(this._buttonBorderTexture.get_Value(), location, new Rectangle?(), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
            if (!Main.mouseLeft || !Main.mouseLeftRelease)
            {
                return;
            }
            this.ToggleMenu();
        }
Ejemplo n.º 16
0
 public static void OpenCraftingMenu()
 {
     Main.playerInventory = true;
     //Main.npcChatText = "";
     Main.PlaySound(12, -1, -1, 1, 1f, 0f);
     Main.InGuideCraftMenu = true;
     UILinkPointNavigator.GoToDefaultPage(0);
 }
Ejemplo n.º 17
0
 public override void OnActivate()
 {
     if (PlayerInput.UsingGamepadUI)
     {
         UILinkPointNavigator.Points[3000].Unlink();
         UILinkPointNavigator.ChangePoint(3000);
     }
 }
Ejemplo n.º 18
0
        private UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap)
        {
            UILinkPointNavigator.SetPosition(id, snap.Position);
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[id];

            uILinkPoint.Unlink();
            return(uILinkPoint);
        }
Ejemplo n.º 19
0
 public override void OnActivate()
 {
     if (!PlayerInput.UsingGamepadUI || this._restoreButton == null)
     {
         return;
     }
     UILinkPointNavigator.ChangePoint(3002);
 }
Ejemplo n.º 20
0
        public UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap)
        {
            UILinkPointNavigator.SetPosition(id, snap.Position);
            UILinkPoint point = UILinkPointNavigator.Points[id];

            point.Unlink();
            return(point);
        }
Ejemplo n.º 21
0
 // Token: 0x060010C9 RID: 4297 RVA: 0x00405B36 File Offset: 0x00403D36
 public override void OnActivate()
 {
     Main.LoadWorlds();
     this.UpdateWorldsList();
     if (PlayerInput.UsingGamepadUI)
     {
         UILinkPointNavigator.ChangePoint(3000 + ((this._worldList.Count == 0) ? 1 : 2));
     }
 }
Ejemplo n.º 22
0
 // Token: 0x060010D4 RID: 4308 RVA: 0x004065F9 File Offset: 0x004047F9
 public override void OnActivate()
 {
     Main.ClearPendingPlayerSelectCallbacks();
     Main.LoadPlayers();
     this.UpdatePlayersList();
     if (PlayerInput.UsingGamepadUI)
     {
         UILinkPointNavigator.ChangePoint(3000 + ((this._playerList.Count == 0) ? 1 : 2));
     }
 }
Ejemplo n.º 23
0
 public override void OnActivate()
 {
     Main.LoadPlayers();
     Main.ActivePlayerFileData = new PlayerFileData();
     UpdatePlayersList();
     if (PlayerInput.UsingGamepadUI)
     {
         UILinkPointNavigator.ChangePoint(3000 + ((_playerList.Count == 0) ? 1 : 2));
     }
 }
Ejemplo n.º 24
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand            = 6;
            UILinkPointNavigator.Shortcuts.FANCYUI_SPECIAL_INSTRUCTIONS = 1;
            var num1 = 3002;

            UILinkPointNavigator.SetPosition(3000, this._cancelButton.GetDimensions().Center());
            var point1 = UILinkPointNavigator.Points[3000];

            point1.Unlink();
            point1.Right = 3001;
            point1.Up    = num1 + 40;
            UILinkPointNavigator.SetPosition(3001, this._submitButton.GetDimensions().Center());
            var point2 = UILinkPointNavigator.Points[3001];

            point2.Unlink();
            point2.Left = 3000;
            point2.Up   = num1 + 49;
            for (var index1 = 0; index1 < 5; ++index1)
            {
                for (var index2 = 0; index2 < 10; ++index2)
                {
                    var index3 = index1 * 10 + index2;
                    var ID     = num1 + index3;
                    if (this._keyList[index3] != null)
                    {
                        UILinkPointNavigator.SetPosition(ID, this._keyList[index3].GetDimensions().Center());
                        var point3 = UILinkPointNavigator.Points[ID];
                        point3.Unlink();
                        var num2 = index2 - 1;
                        while (num2 >= 0 && this._keyList[index1 * 10 + num2] == this._keyList[index3])
                        {
                            --num2;
                        }
                        point3.Left = num2 == -1 ? index1 * 10 + 9 + num1 : index1 * 10 + num2 + num1;
                        var index4 = index2 + 1;
                        while (index4 <= 9 && this._keyList[index1 * 10 + index4] == this._keyList[index3])
                        {
                            ++index4;
                        }
                        point3.Right = index4 == 10 || this._keyList[index3] == this._keyList[index4]
                            ? index1 * 10 + num1
                            : index1 * 10 + index4 + num1;
                        if (index1 != 0)
                        {
                            point3.Up = ID - 10;
                        }
                        point3.Down = index1 == 4 ? (index2 < 5 ? 3000 : 3001) : ID + 10;
                    }
                }
            }
        }
Ejemplo n.º 25
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 3;
            int       num1       = 3000;
            int       ID1        = num1;
            Rectangle rectangle1 = this._backpanel.GetInnerDimensions().ToRectangle();
            // ISSUE: explicit reference operation
            Vector2 vector2_1 = ((Rectangle)@rectangle1).get_Center().ToVector2();

            UILinkPointNavigator.SetPosition(ID1, vector2_1);
            int       ID2        = num1 + 1;
            Rectangle rectangle2 = this._outerContainer.GetInnerDimensions().ToRectangle();
            // ISSUE: explicit reference operation
            Vector2 vector2_2 = ((Rectangle)@rectangle2).get_Center().ToVector2();

            UILinkPointNavigator.SetPosition(ID2, vector2_2);
            int         index1 = num1;
            UILinkPoint point1 = UILinkPointNavigator.Points[index1];

            point1.Unlink();
            int num2 = index1 + 1;

            point1.Up = num2;
            int         index2 = index1 + 1;
            UILinkPoint point2 = UILinkPointNavigator.Points[index2];

            point2.Unlink();
            int num3 = index2 + 1;

            point2.Up = num3;
            int num4 = index2 - 1;

            point2.Down = num4;
            for (int index3 = 0; index3 < this._categoryButtons.Count; ++index3)
            {
                ++index2;
                UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = index2;
                int       ID3        = index2;
                Rectangle rectangle3 = this._categoryButtons[index3].GetInnerDimensions().ToRectangle();
                // ISSUE: explicit reference operation
                Vector2 vector2_3 = ((Rectangle)@rectangle3).get_Center().ToVector2();
                UILinkPointNavigator.SetPosition(ID3, vector2_3);
                UILinkPoint point3 = UILinkPointNavigator.Points[index2];
                point3.Unlink();
                int num5 = index3 == 0 ? -3 : index2 - 1;
                point3.Left = num5;
                int num6 = index3 == this._categoryButtons.Count - 1 ? -4 : index2 + 1;
                point3.Right = num6;
                int num7 = num1;
                point3.Down = num7;
            }
        }
        //public void Resize()
        //      {
        //          float num = this.spacing;
        //          for (int i = 0; i < this.buttonView.children.Count; i++)
        //          {
        //              if (this.buttonView.children[i].Visible)
        //              {
        //                  this.buttonView.children[i].X = num;
        //                  num += this.buttonView.children[i].Width + this.spacing;
        //              }
        //          }
        //          base.Width = num;
        //          this.buttonView.Width = base.Width;
        //      }

        public override void OnActivate()
        {
            if (PlayerInput.UsingGamepadUI)
            {
                UILinkPointNavigator.Points[3000].Unlink();
                UILinkPointNavigator.ChangePoint(3000);
            }

            Main.mapFullscreenScale = .25f;
            drawMap     = typeof(Main).Assembly.GetType("Terraria.Main").GetMethod("DrawMap", BindingFlags.Instance | BindingFlags.NonPublic);
            drawToMap   = typeof(Main).Assembly.GetType("Terraria.Main").GetMethod("DrawToMap", BindingFlags.Instance | BindingFlags.NonPublic);
            genprogress = typeof(GenerationProgress).GetField("_totalProgress", BindingFlags.Instance | BindingFlags.NonPublic);
        }
Ejemplo n.º 27
0
        public override void OnChatButtonClicked(NPC npc, bool firstButton)
        {
            if (npc.type == NPCID.Guide)
            {
                if (firstButton)
                {
                    if (!RaidsWorld.hasTalkedToGuide.Contains(Main.player[Main.myPlayer].GetModPlayer <TUAPlayer>().ID.ToString()))
                    {
                        Main.npcChatText = GetGuideStartText();
                        currentGuideText++;
                    }
                    else
                    {
                        switch (guideFocusText)
                        {
                        case 2:
                            UIManager.OpenRaidsUI();
                            giveRaidsDialog = true;
                            break;

                        case 1:
                            Main.playerInventory = true;
                            Main.npcChatText     = "";
                            Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                            Main.InGuideCraftMenu = true;
                            UILinkPointNavigator.GoToDefaultPage(0);
                            break;

                        default:
                            Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                            // If someone can find a better way to do this, do it immediately
                            ReflManager <Type> .GetItem("TMain").GetMethod("HelpText", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);

                            break;
                        }
                    }
                }

                else
                {
                    if (guideFocusText == 2)
                    {
                        guideFocusText = 0;
                    }
                    else
                    {
                        guideFocusText++;
                    }
                }
            }
        }
Ejemplo n.º 28
0
 public override void OnChatButtonClicked(bool firstButton, ref bool shop)
 {
     if (firstButton)
     {
         Main.PlaySound(12, -1, -1, 1);
         Main.npcChatText = NextHelpText();
     }
     else
     {
         Main.playerInventory = true;
         Main.npcChatText     = "";
         Main.PlaySound(12, -1, -1, 1);
         Main.InGuideCraftMenu = true;
         UILinkPointNavigator.GoToDefaultPage(0);
     }
 }
Ejemplo n.º 29
0
        ////////////////

        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            if (firstButton)
            {
                var mymod = (IntrinsicsMod)this.mod;
                mymod.IsTrading = true;

                Main.playerInventory = true;
                Main.npcChatText     = "";
                Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                UILinkPointNavigator.GoToDefaultPage(0);
            }
            else
            {
                this.UpdateChatWithTip();
            }
        }
        public static void Draw(ref int num, SpriteBatch sb)
        {
            Vector2   vector    = new Vector2(Main.screenWidth - 212, 142 + 256);
            Texture2D texture2D =
                ModContent.GetTexture("DynamicDungeon/DungeonAssets/DungeonEditorAssets/EditorButton");

            if (Collision.CheckAABBvAABBCollision(vector, texture2D.Size(), new Vector2(Main.mouseX, Main.mouseY), Vector2.One) && (Main.mouseItem.stack < 1 || Main.mouseItem.dye > 0))
            {
                num = 4;
            }
            if (num == 4)
            {
                sb.Draw(texture2D, vector, null, Main.OurFavoriteColor, 0f, new Vector2(2f), 0.9f, SpriteEffects.None, 0f);
            }
            sb.Draw(texture2D, vector, null, Color.White, 0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0f);
            UILinkPointNavigator.SetPosition(305, vector + texture2D.Size() * 0.75f);
        }