Beispiel #1
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;
            }
        }
Beispiel #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;
            }
        }
Beispiel #3
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();
                }
            }
        }
        //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);
        }
Beispiel #5
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;
            }
        }
Beispiel #6
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);
        }
Beispiel #7
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;
            }
        }
Beispiel #8
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);
        }
Beispiel #9
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();
        }
Beispiel #10
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));
        }
Beispiel #11
0
        private UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap)
        {
            UILinkPointNavigator.SetPosition(id, snap.Position);
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[id];

            uILinkPoint.Unlink();
            return(uILinkPoint);
        }
Beispiel #12
0
        public UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap)
        {
            UILinkPointNavigator.SetPosition(id, snap.Position);
            UILinkPoint point = UILinkPointNavigator.Points[id];

            point.Unlink();
            return(point);
        }
Beispiel #13
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;
                    }
                }
            }
        }
        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 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);
        }
        public void Draw(SpriteBatch spriteBatch)
        {
            Vector2 vector  = new Vector2(10f, 54f);
            Vector2 vector2 = new Vector2(0f, 24f);

            if (_toggles.Count == 0)
            {
                LazyInit();
            }

            Player localPlayer = Main.LocalPlayer;
            int    num         = 0;
            int    num2        = 0;

            for (int i = 0; i < _toggles.Count; i++)
            {
                if (_toggles[i].IsAvailableFor(localPlayer))
                {
                    num2++;
                }
            }

            if (num2 >= 10)
            {
                vector += new Vector2(0f, -24f);
            }

            for (int j = 0; j < _toggles.Count; j++)
            {
                IBuilderAccToggle builderAccToggle = _toggles[j];
                if (builderAccToggle.IsAvailableFor(localPlayer))
                {
                    builderAccToggle.Draw(spriteBatch, vector, localPlayer);
                    UILinkPointNavigator.SetPosition(6000 + num, vector);
                    num++;
                    vector += vector2;
                }
            }
        }
Beispiel #17
0
        public void Draw(SpriteBatch spriteBatch)
        {
            Vector2 vector2_1 = new Vector2(10f, 54f);
            Vector2 vector2_2 = new Vector2(0.0f, 24f);

            if (this._toggles.Count == 0)
            {
                this.LazyInit();
            }
            Player localPlayer = Main.LocalPlayer;
            int    num1        = 0;
            int    num2        = 0;

            for (int index = 0; index < this._toggles.Count; ++index)
            {
                if (this._toggles[index].IsAvailableFor(localPlayer))
                {
                    ++num2;
                }
            }
            if (num2 >= 10)
            {
                vector2_1 += new Vector2(0.0f, -24f);
            }
            for (int index = 0; index < this._toggles.Count; ++index)
            {
                BuilderAccTogglesUI.IBuilderAccToggle toggle = this._toggles[index];
                if (toggle.IsAvailableFor(localPlayer))
                {
                    toggle.Draw(spriteBatch, vector2_1, localPlayer);
                    UILinkPointNavigator.SetPosition(6000 + num1, vector2_1);
                    ++num1;
                    vector2_1 += vector2_2;
                }
            }
        }
Beispiel #18
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int num = 3000;
            List <SnapPoint> snapPoints = GetSnapPoints();
            SnapPoint        snapPoint  = null;
            SnapPoint        snapPoint2 = null;
            SnapPoint        snapPoint3 = null;
            SnapPoint        snapPoint4 = null;
            SnapPoint        snapPoint5 = null;
            SnapPoint        snapPoint6 = null;

            for (int i = 0; i < snapPoints.Count; i++)
            {
                SnapPoint snapPoint7 = snapPoints[i];
                switch (snapPoint7.Name)
                {
                case "Back":
                    snapPoint = snapPoint7;
                    break;

                case "Create":
                    snapPoint2 = snapPoint7;
                    break;

                case "Name":
                    snapPoint3 = snapPoint7;
                    break;

                case "Seed":
                    snapPoint4 = snapPoint7;
                    break;

                case "RandomizeName":
                    snapPoint5 = snapPoint7;
                    break;

                case "RandomizeSeed":
                    snapPoint6 = snapPoint7;
                    break;
                }
            }
            List <SnapPoint> snapGroup  = GetSnapGroup(snapPoints, "size");
            List <SnapPoint> snapGroup2 = GetSnapGroup(snapPoints, "difficulty");
            List <SnapPoint> snapGroup3 = GetSnapGroup(snapPoints, "evil");

            UILinkPointNavigator.SetPosition(num, snapPoint.Position);
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[num];

            uILinkPoint.Unlink();
            UILinkPoint uILinkPoint2 = uILinkPoint;

            num++;
            UILinkPointNavigator.SetPosition(num, snapPoint2.Position);
            uILinkPoint = UILinkPointNavigator.Points[num];
            uILinkPoint.Unlink();
            UILinkPoint uILinkPoint3 = uILinkPoint;

            num++;
            UILinkPointNavigator.SetPosition(num, snapPoint5.Position);
            uILinkPoint = UILinkPointNavigator.Points[num];
            uILinkPoint.Unlink();
            UILinkPoint uILinkPoint4 = uILinkPoint;

            num++;
            UILinkPointNavigator.SetPosition(num, snapPoint3.Position);
            uILinkPoint = UILinkPointNavigator.Points[num];
            uILinkPoint.Unlink();
            UILinkPoint uILinkPoint5 = uILinkPoint;

            num++;
            UILinkPointNavigator.SetPosition(num, snapPoint6.Position);
            uILinkPoint = UILinkPointNavigator.Points[num];
            uILinkPoint.Unlink();
            UILinkPoint uILinkPoint6 = uILinkPoint;

            num++;
            UILinkPointNavigator.SetPosition(num, snapPoint4.Position);
            uILinkPoint = UILinkPointNavigator.Points[num];
            uILinkPoint.Unlink();
            UILinkPoint uILinkPoint7 = uILinkPoint;

            num++;
            UILinkPoint[] array = new UILinkPoint[snapGroup.Count];
            for (int j = 0; j < snapGroup.Count; j++)
            {
                UILinkPointNavigator.SetPosition(num, snapGroup[j].Position);
                uILinkPoint = UILinkPointNavigator.Points[num];
                uILinkPoint.Unlink();
                array[j] = uILinkPoint;
                num++;
            }
            UILinkPoint[] array2 = new UILinkPoint[snapGroup2.Count];
            for (int k = 0; k < snapGroup2.Count; k++)
            {
                UILinkPointNavigator.SetPosition(num, snapGroup2[k].Position);
                uILinkPoint = UILinkPointNavigator.Points[num];
                uILinkPoint.Unlink();
                array2[k] = uILinkPoint;
                num++;
            }
            UILinkPoint[] array3 = new UILinkPoint[snapGroup3.Count];
            for (int l = 0; l < snapGroup3.Count; l++)
            {
                UILinkPointNavigator.SetPosition(num, snapGroup3[l].Position);
                uILinkPoint = UILinkPointNavigator.Points[num];
                uILinkPoint.Unlink();
                array3[l] = uILinkPoint;
                num++;
            }
            LoopHorizontalLineLinks(array);
            LoopHorizontalLineLinks(array2);
            EstablishUpDownRelationship(array, array2);
            for (int m = 0; m < array.Length; m++)
            {
                array[m].Up = uILinkPoint7.ID;
            }
            if (true)
            {
                LoopHorizontalLineLinks(array3);
                EstablishUpDownRelationship(array2, array3);
                for (int n = 0; n < array3.Length; n++)
                {
                    array3[n].Down = uILinkPoint2.ID;
                }
                array3[array3.Length - 1].Down = uILinkPoint3.ID;
                uILinkPoint3.Up = array3[array3.Length - 1].ID;
                uILinkPoint2.Up = array3[0].ID;
            }
            else
            {
                for (int num2 = 0; num2 < array2.Length; num2++)
                {
                    array2[num2].Down = uILinkPoint2.ID;
                }
                array2[array2.Length - 1].Down = uILinkPoint3.ID;
                uILinkPoint3.Up = array2[array2.Length - 1].ID;
                uILinkPoint2.Up = array2[0].ID;
            }
            uILinkPoint3.Left  = uILinkPoint2.ID;
            uILinkPoint2.Right = uILinkPoint3.ID;
            uILinkPoint5.Down  = uILinkPoint7.ID;
            uILinkPoint5.Left  = uILinkPoint4.ID;
            uILinkPoint4.Right = uILinkPoint5.ID;
            uILinkPoint7.Up    = uILinkPoint5.ID;
            uILinkPoint7.Down  = array[0].ID;
            uILinkPoint7.Left  = uILinkPoint6.ID;
            uILinkPoint6.Right = uILinkPoint7.ID;
            uILinkPoint6.Up    = uILinkPoint4.ID;
            uILinkPoint6.Down  = array[0].ID;
            uILinkPoint4.Down  = uILinkPoint6.ID;
        }
Beispiel #19
0
        private void SetupGamepadPoints2(SpriteBatch spriteBatch)
        {
            int num = 7;

            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int num2;
            int iD = num2 = 3001;
            List <SnapPoint> snapPoints = GetSnapPoints();

            RemoveSnapPointsOutOfScreen(spriteBatch, snapPoints);
            UILinkPointNavigator.SetPosition(iD, _backPanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[num2];

            uILinkPoint.Unlink();
            uILinkPoint.Up = num2 + 1;
            UILinkPoint uILinkPoint2 = uILinkPoint;

            num2++;
            int num3 = 0;
            List <List <SnapPoint> > list = new List <List <SnapPoint> >();

            for (int i = 0; i < num; i++)
            {
                List <SnapPoint> emoteGroup = GetEmoteGroup(snapPoints, i);
                if (emoteGroup.Count > 0)
                {
                    list.Add(emoteGroup);
                }
                num3 += (int)Math.Ceiling((float)emoteGroup.Count / 14f);
            }
            SnapPoint[,] array = new SnapPoint[14, num3];
            int num4 = 0;

            for (int j = 0; j < list.Count; j++)
            {
                List <SnapPoint> list2 = list[j];
                for (int k = 0; k < list2.Count; k++)
                {
                    int num5 = num4 + k / 14;
                    int num6 = k % 14;
                    array[num6, num5] = list2[k];
                }
                num4 += (int)Math.Ceiling((float)list2.Count / 14f);
            }
            int[,] array2 = new int[14, num3];
            int up = 0;

            for (int l = 0; l < array.GetLength(1); l++)
            {
                for (int m = 0; m < array.GetLength(0); m++)
                {
                    SnapPoint snapPoint = array[m, l];
                    if (snapPoint != null)
                    {
                        UILinkPointNavigator.Points[num2].Unlink();
                        UILinkPointNavigator.SetPosition(num2, snapPoint.Position);
                        array2[m, l] = num2;
                        if (m == 0)
                        {
                            up = num2;
                        }
                        num2++;
                    }
                }
            }
            uILinkPoint2.Up = up;
            for (int n = 0; n < array.GetLength(1); n++)
            {
                for (int num7 = 0; num7 < array.GetLength(0); num7++)
                {
                    int num8 = array2[num7, n];
                    if (num8 == 0)
                    {
                        continue;
                    }
                    UILinkPoint uILinkPoint3 = UILinkPointNavigator.Points[num8];
                    if (TryGetPointOnGrid(array2, num7, n, -1, 0))
                    {
                        uILinkPoint3.Left = array2[num7 - 1, n];
                    }
                    else
                    {
                        uILinkPoint3.Left = uILinkPoint3.ID;
                        for (int num9 = num7; num9 < array.GetLength(0); num9++)
                        {
                            if (TryGetPointOnGrid(array2, num9, n, 0, 0))
                            {
                                uILinkPoint3.Left = array2[num9, n];
                            }
                        }
                    }
                    if (TryGetPointOnGrid(array2, num7, n, 1, 0))
                    {
                        uILinkPoint3.Right = array2[num7 + 1, n];
                    }
                    else
                    {
                        uILinkPoint3.Right = uILinkPoint3.ID;
                        for (int num10 = num7; num10 >= 0; num10--)
                        {
                            if (TryGetPointOnGrid(array2, num10, n, 0, 0))
                            {
                                uILinkPoint3.Right = array2[num10, n];
                            }
                        }
                    }
                    if (TryGetPointOnGrid(array2, num7, n, 0, -1))
                    {
                        uILinkPoint3.Up = array2[num7, n - 1];
                    }
                    else
                    {
                        uILinkPoint3.Up = uILinkPoint3.ID;
                        for (int num11 = n - 1; num11 >= 0; num11--)
                        {
                            if (TryGetPointOnGrid(array2, num7, num11, 0, 0))
                            {
                                uILinkPoint3.Up = array2[num7, num11];
                                break;
                            }
                        }
                    }
                    if (TryGetPointOnGrid(array2, num7, n, 0, 1))
                    {
                        uILinkPoint3.Down = array2[num7, n + 1];
                        continue;
                    }
                    uILinkPoint3.Down = uILinkPoint3.ID;
                    for (int num12 = n + 1; num12 < array.GetLength(1); num12++)
                    {
                        if (TryGetPointOnGrid(array2, num7, num12, 0, 0))
                        {
                            uILinkPoint3.Down = array2[num7, num12];
                            break;
                        }
                    }
                    if (uILinkPoint3.Down == uILinkPoint3.ID)
                    {
                        uILinkPoint3.Down = uILinkPoint2.ID;
                    }
                }
            }
        }
Beispiel #20
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int num = 3000;

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

            uILinkPoint.Unlink();
            uILinkPoint.Right = num2 + 1;
            num2        = num + 1;
            uILinkPoint = UILinkPointNavigator.Points[num2];
            uILinkPoint.Unlink();
            uILinkPoint.Left = num2 - 1;
            float            scaleFactor       = 1f / Main.UIScale;
            Rectangle        clippingRectangle = _containerPanel.GetClippingRectangle(spriteBatch);
            Vector2          minimum           = clippingRectangle.TopLeft() * scaleFactor;
            Vector2          maximum           = clippingRectangle.BottomRight() * scaleFactor;
            List <SnapPoint> snapPoints        = GetSnapPoints();

            for (int i = 0; i < snapPoints.Count; i++)
            {
                if (!snapPoints[i].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[i]);
                    i--;
                }
            }
            SnapPoint[,] array = new SnapPoint[_playerList.Count, 4];
            foreach (SnapPoint item in snapPoints.Where((SnapPoint a) => a.Name == "Play"))
            {
                array[item.Id, 0] = item;
            }
            foreach (SnapPoint item2 in snapPoints.Where((SnapPoint a) => a.Name == "Favorite"))
            {
                array[item2.Id, 1] = item2;
            }
            foreach (SnapPoint item3 in snapPoints.Where((SnapPoint a) => a.Name == "Cloud"))
            {
                array[item3.Id, 2] = item3;
            }
            foreach (SnapPoint item4 in snapPoints.Where((SnapPoint a) => a.Name == "Delete"))
            {
                array[item4.Id, 3] = item4;
            }
            num2 = num + 2;
            int[] array2 = new int[_playerList.Count];
            for (int j = 0; j < array2.Length; j++)
            {
                array2[j] = -1;
            }
            for (int k = 0; k < 4; k++)
            {
                int num3 = -1;
                for (int l = 0; l < array.GetLength(0); l++)
                {
                    if (array[l, k] != null)
                    {
                        uILinkPoint = UILinkPointNavigator.Points[num2];
                        uILinkPoint.Unlink();
                        UILinkPointNavigator.SetPosition(num2, array[l, k].Position);
                        if (num3 != -1)
                        {
                            uILinkPoint.Up = num3;
                            UILinkPointNavigator.Points[num3].Down = num2;
                        }
                        if (array2[l] != -1)
                        {
                            uILinkPoint.Left = array2[l];
                            UILinkPointNavigator.Points[array2[l]].Right = num2;
                        }
                        uILinkPoint.Down = num;
                        if (k == 0)
                        {
                            UILinkPointNavigator.Points[num].Up = (UILinkPointNavigator.Points[num + 1].Up = num2);
                        }
                        num3      = num2;
                        array2[l] = num2;
                        UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num2;
                        num2++;
                    }
                }
            }
            if (PlayerInput.UsingGamepadUI && _playerList.Count == 0 && UILinkPointNavigator.CurrentPoint > 3001)
            {
                UILinkPointNavigator.ChangePoint(3001);
            }
        }
Beispiel #21
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int ID1 = 3000;

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

            point1.Unlink();
            point1.Right = index1 + 1;
            int         index2 = ID1 + 1;
            UILinkPoint point2 = UILinkPointNavigator.Points[index2];

            point2.Unlink();
            point2.Left = index2 - 1;
            Rectangle        clippingRectangle = this._containerPanel.GetClippingRectangle(spriteBatch);
            Vector2          minimum           = clippingRectangle.TopLeft();
            Vector2          maximum           = clippingRectangle.BottomRight();
            List <SnapPoint> snapPoints        = this.GetSnapPoints();

            for (int index3 = 0; index3 < snapPoints.Count; ++index3)
            {
                if (!snapPoints[index3].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[index3]);
                    --index3;
                }
            }
            SnapPoint[,] snapPointArray = new SnapPoint[this._playerList.Count, 4];
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Play")))
            {
                snapPointArray[snapPoint.ID, 0] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Favorite")))
            {
                snapPointArray[snapPoint.ID, 1] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Cloud")))
            {
                snapPointArray[snapPoint.ID, 2] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Delete")))
            {
                snapPointArray[snapPoint.ID, 3] = snapPoint;
            }
            int ID2 = ID1 + 2;

            int[] numArray = new int[this._playerList.Count];
            for (int index3 = 0; index3 < numArray.Length; ++index3)
            {
                numArray[index3] = -1;
            }
            for (int index3 = 0; index3 < 4; ++index3)
            {
                int index4 = -1;
                for (int index5 = 0; index5 < snapPointArray.GetLength(0); ++index5)
                {
                    if (snapPointArray[index5, index3] != null)
                    {
                        UILinkPoint point3 = UILinkPointNavigator.Points[ID2];
                        point3.Unlink();
                        UILinkPointNavigator.SetPosition(ID2, snapPointArray[index5, index3].Position);
                        if (index4 != -1)
                        {
                            point3.Up = index4;
                            UILinkPointNavigator.Points[index4].Down = ID2;
                        }
                        if (numArray[index5] != -1)
                        {
                            point3.Left = numArray[index5];
                            UILinkPointNavigator.Points[numArray[index5]].Right = ID2;
                        }
                        point3.Down = ID1;
                        if (index3 == 0)
                        {
                            UILinkPointNavigator.Points[ID1].Up = UILinkPointNavigator.Points[ID1 + 1].Up = ID2;
                        }
                        index4           = ID2;
                        numArray[index5] = ID2;
                        UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = ID2;
                        ++ID2;
                    }
                }
            }
            if (!PlayerInput.UsingGamepadUI || this._playerList.Count != 0 || UILinkPointNavigator.CurrentPoint <= 3001)
            {
                return;
            }
            UILinkPointNavigator.ChangePoint(3001);
        }
Beispiel #22
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int num  = 3001;
            int num2 = num;
            List <SnapPoint> snapPoints = GetSnapPoints();

            UILinkPointNavigator.SetPosition(num, _backPanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[num2];

            uILinkPoint.Unlink();
            uILinkPoint.Up = num2 + 1;
            UILinkPoint uILinkPoint2 = uILinkPoint;

            num2++;
            float     scaleFactor       = 1f / Main.UIScale;
            Rectangle clippingRectangle = _container.GetClippingRectangle(spriteBatch);
            Vector2   minimum           = clippingRectangle.TopLeft() * scaleFactor;
            Vector2   maximum           = clippingRectangle.BottomRight() * scaleFactor;

            for (int i = 0; i < snapPoints.Count; i++)
            {
                if (!snapPoints[i].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[i]);
                    i--;
                }
            }
            int num3 = 0;
            int num4 = 0;
            int num5 = 7;
            List <List <SnapPoint> > list = new List <List <SnapPoint> >();

            for (int j = 0; j < num5; j++)
            {
                List <SnapPoint> emoteGroup = GetEmoteGroup(snapPoints, j);
                if (emoteGroup.Count > 0)
                {
                    list.Add(emoteGroup);
                }
            }
            List <SnapPoint>[] array = list.ToArray();
            for (int k = 0; k < array.Length; k++)
            {
                List <SnapPoint> list2 = array[k];
                int num6 = list2.Count / 14;
                if (list2.Count % 14 > 0)
                {
                    num6++;
                }
                int num7 = 14;
                if (list2.Count % 14 != 0)
                {
                    num7 = list2.Count % 14;
                }
                for (int l = 0; l < list2.Count; l++)
                {
                    uILinkPoint = UILinkPointNavigator.Points[num2];
                    uILinkPoint.Unlink();
                    UILinkPointNavigator.SetPosition(num2, list2[l].Position);
                    int num8 = 14;
                    if (l / 14 == num6 - 1 && list2.Count % 14 != 0)
                    {
                        num8 = list2.Count % 14;
                    }
                    int num9 = l % 14;
                    uILinkPoint.Left  = num2 - 1;
                    uILinkPoint.Right = num2 + 1;
                    uILinkPoint.Up    = num2 - 14;
                    uILinkPoint.Down  = num2 + 14;
                    if (num9 == num8 - 1)
                    {
                        uILinkPoint.Right = num2 - num8 + 1;
                    }
                    if (num9 == 0)
                    {
                        uILinkPoint.Left = num2 + num8 - 1;
                    }
                    if (num9 == 0)
                    {
                        uILinkPoint2.Up = num2;
                    }
                    if (l < 14)
                    {
                        if (num3 == 0)
                        {
                            uILinkPoint.Up = -1;
                        }
                        else
                        {
                            uILinkPoint.Up = num2 - 14;
                            if (num9 >= num3)
                            {
                                uILinkPoint.Up -= 14;
                            }
                            int num10 = k - 1;
                            while (num10 > 0 && array[num10].Count <= num9)
                            {
                                uILinkPoint.Up -= 14;
                                num10--;
                            }
                        }
                    }
                    int down = num;
                    if (k == array.Length - 1)
                    {
                        if (l / 14 < num6 - 1 && num9 >= list2.Count % 14)
                        {
                            uILinkPoint.Down = down;
                        }
                        if (l / 14 == num6 - 1)
                        {
                            uILinkPoint.Down = down;
                        }
                    }
                    else if (l / 14 == num6 - 1)
                    {
                        uILinkPoint.Down = num2 + 14;
                        for (int m = k + 1; m < array.Length && array[m].Count <= num9; m++)
                        {
                            uILinkPoint.Down += 14;
                        }
                        if (k == array.Length - 1)
                        {
                            uILinkPoint.Down = down;
                        }
                    }
                    else if (num9 >= num7)
                    {
                        uILinkPoint.Down = num2 + 14 + 14;
                        for (int n = k + 1; n < array.Length && array[n].Count <= num9; n++)
                        {
                            uILinkPoint.Down += 14;
                        }
                    }
                    num2++;
                }
                num3  = num7;
                num4  = 14 - num3;
                num2 += num4;
            }
        }
Beispiel #23
0
        private void DrawInterfaceInfoAccs()
        {
            bool   flaghitlife = false;
            int    num         = -1;
            int    num2        = -10;
            int    num3        = 0;
            string text        = "";
            float  num4        = 215f;
            int    num5        = 0;
            Player player      = Main.player[Main.myPlayer];

            for (int i = 0; i < 14; i++)
            {
                string text2 = "";
                string text3 = "";
                if ((Main.npcChatText == null || Main.npcChatText == "") && Main.player[Main.myPlayer].sign < 0 && ZZLocalizationMod.modConfiguration.uitext)
                {
                    if (i == (Main.playerInventory? 0:-1) && !ZZPlayerInfo.visible)
                    {
                        text2 = "每秒" + player.lifeRegen + "生命再生";
                        text3 = "生命再生速度";
                    }
                    if (i == (Main.playerInventory? 1:-1) && !ZZPlayerInfo.visible)
                    {
                        text2 = "每秒" + player.manaRegen + "魔力再生";
                        text3 = "魔力再生速度";
                    }
                    if (i == (Main.playerInventory? 2:-1) && !ZZPlayerInfo.visible)
                    {
                        text2 = player.wingTimeMax + "最大飞行时间";
                        text3 = "飞行时间";
                    }
                    if (i == (Main.playerInventory? 3:-1) && !ZZPlayerInfo.visible)
                    {
                        text2 = "获得" + player.endurance * 100 + "%伤害减免";
                        text3 = "伤害减免";
                    }
                    if (i == (Main.playerInventory? 4:-1) && !ZZPlayerInfo.visible)
                    {
                        text2 = "召唤物栏已用/上限:" + player.slotsMinions + " / " + player.maxMinions;
                        text3 = "召唤栏";
                    }
                    if (i == (Main.playerInventory? 5:-1) && !ZZPlayerInfo.visible)
                    {
                        text2 = "哨兵炮塔上限:" + player.maxTurrets;
                        text3 = "炮塔栏";
                    }

                    if (i == (Main.playerInventory? 6:-1) && !ZZPlayerInfo.visible && ModLoader.GetMod("ThoriumMod") != null)
                    {
                        ModPlayer playerthorium = Main.player[Main.myPlayer].GetModPlayer(ModLoader.GetMod("ThoriumMod"), "ThoriumPlayer");
                        text2 = "瑟银乐师灵感: " + ModLoader.GetMod("ThoriumMod").GetPlayer("ThoriumPlayer").GetType().GetField("bardResource").GetValue(playerthorium) + "灵感";
                        text3 = "瑟银乐师灵感";
                    }

                    if (i == (Main.playerInventory? 8:0) && !flaghitlife)
                    {
                        int num15      = 2500;
                        int num16      = 300;
                        NPC npcaround  = null;
                        NPC npcaround2 = null;
                        NPC npcaround3 = null;
                        text3 = "敌人生命显示";
                        for (int l = 0; l < 200; l++)
                        {
                            if (Main.npc[l].active && !Main.npc[l].townNPC && Main.npc[l].life < Main.npc[l].lifeMax)
                            {
                                NPC   type     = Main.npc[l];
                                float distance = (Main.npc[l].Center - Main.player[Main.myPlayer].Center).Length();
                                if (distance < (float)num15)
                                {
                                    Player player3 = Main.player[Main.myPlayer];
                                    Player player4 = player3;

                                    if (npcaround != null)
                                    {
                                        if (((npcaround.Center - Main.player[Main.myPlayer].Center).Length() - distance > (float)num16) && ((npcaround.Center - Main.player[Main.myPlayer].Center).Length() < 800))
                                        {
                                            npcaround = type;
                                        }
                                    }
                                    else
                                    {
                                        npcaround = type;
                                    }

                                    if (npcaround2 == null)
                                    {
                                        npcaround2 = type;
                                        npcaround3 = null;
                                    }
                                    else
                                    {
                                        npcaround3 = type;
                                    }

                                    if (npcaround == type)
                                    {
                                        npcaround2 = null;
                                    }
                                }
                            }
                        }

                        if (npcaround == null)
                        {
                            text2 = "";
                        }
                        else
                        {
                            text2 = npcaround.GivenOrTypeName + ": " + npcaround.life + " / " + npcaround.lifeMax;
                        }
                        if (npcaround2 != null)
                        {
                            text2 += "\n" + npcaround2.GivenOrTypeName + ": " + npcaround2.life + " / " + npcaround2.lifeMax;
                        }
                        if (npcaround3 != null)
                        {
                            text2 += "\n" + npcaround3.GivenOrTypeName + ": " + npcaround3.life + " / " + npcaround3.lifeMax;
                        }
                        flaghitlife = true;
                    }

                    if (i == (Main.playerInventory? 13:6) && ZZLocalizationMod.modConfiguration.zonetext && !ZZPlayerInfo.visible)
                    {
                        text2 = zoneString(player);
                        text3 = "所处环境";
                    }
                }
                if (text2 != "")
                {
                    int num26;
                    int num27;
                    if (!Main.playerInventory)
                    {
                        num26 = Main.screenWidth - 520;
                        num27 = -80;
                    }
                    else
                    {
                        bool shouldDrawInfoIconsHorizontally = Main.ShouldDrawInfoIconsHorizontally;
                        if (shouldDrawInfoIconsHorizontally)
                        {
                            num26 = Main.screenWidth - 520 + 20 * num3 - 10;
                            num27 = -80;
                        }
                        else
                        {
                            int num28 = (int)(74f * Main.inventoryScale);
                            num26 = Main.screenWidth - 520;
                            /* num26 = 697 - num28 * 4 + Main.screenWidth - 800 + 20 * (num3 % 2);*/
                            num27 = 114 + num28 * 7 + num28 / 2 + 20 * (num3 / 2) + 8 * (num3 / 4) - 340;
                            if (Main.EquipPage == 2)
                            {
                                /*num26 += num28 + num28 / 2;*/
                                num27 -= num28;
                            }
                        }
                    }

                    num26 += num5;
                    if (num >= 0)
                    {
                        num3++;
                        int num29 = 22;
                        if (Main.screenHeight < 650)
                        {
                            num29 = 20;
                        }
                        Vector2 vector = new Vector2((float)num26, (float)(num27 + 74 + num29 * i + 52) + 300);
                        int     num30  = num;
                        if (num30 == 8)
                        {
                            num30 = 7;
                        }
                        Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White;
                        bool flag14 = false;
                        if (!Main.playerInventory)
                        {
                            vector = new Vector2((float)num26, (float)num27);
                            if ((float)Main.mouseX >= vector.X && (float)Main.mouseY >= vector.Y && (float)Main.mouseX <= vector.X + (float)this.infoIconTexture[num].Width && (float)Main.mouseY <= vector.Y + (float)this.infoIconTexture[num].Height)
                            {
                                flag14 = true;
                                Main.player[Main.myPlayer].mouseInterface = true;
                                if (Main.mouseLeft && Main.mouseLeftRelease)
                                {
                                    Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                                    Main.mouseLeftRelease = false;
                                    Main.player[Main.myPlayer].hideInfo[num30] = !Main.player[Main.myPlayer].hideInfo[num30];
                                }
                                if (!Main.mouseText)
                                {
                                    text           = text3;
                                    Main.mouseText = true;
                                }
                            }
                            if (Main.player[Main.myPlayer].hideInfo[num30])
                            {
                                white = new Microsoft.Xna.Framework.Color(80, 80, 80, 70);
                            }
                        }
                        else if ((float)Main.mouseX >= vector.X && (float)Main.mouseY >= vector.Y && (float)Main.mouseX <= vector.X + (float)this.infoIconTexture[num].Width && (float)Main.mouseY <= vector.Y + (float)this.infoIconTexture[num].Height && !Main.mouseText)
                        {
                            num2           = i;
                            text           = text3;
                            Main.mouseText = true;
                        }
                        UILinkPointNavigator.SetPosition(1558 + num3 - 1, vector);
                        Main.spriteBatch.Draw(this.infoIconTexture[num], vector, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, this.infoIconTexture[num].Width, this.infoIconTexture[num].Height)), white, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
                        if (flag14)
                        {
                            Main.spriteBatch.Draw(this.infoIconTexture[13], vector - Vector2.One * 2f, null, Main.OurFavoriteColor, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
                        }
                        num26 += 20;
                    }
                    UILinkPointNavigator.Shortcuts.INFOACCCOUNT = num3;
                    if (Main.playerInventory)
                    {
                        Vector2 vector2 = new Vector2(1f);
                        Vector2 vector3 = Main.fontMouseText.MeasureString(text2);
                        if (vector3.X > num4)
                        {
                            vector2.X = num4 / vector3.X;
                        }
                        if (vector2.X < 0.58f)
                        {
                            vector2.Y = 1f - vector2.X / 3f;
                        }
                        for (int num31 = 0; num31 < 5; num31++)
                        {
                            int num32 = 0;
                            int num33 = 0;
                            Microsoft.Xna.Framework.Color black = Microsoft.Xna.Framework.Color.Black;
                            if (num31 == 0)
                            {
                                num32 = -2;
                            }
                            if (num31 == 1)
                            {
                                num32 = 2;
                            }
                            if (num31 == 2)
                            {
                                num33 = -2;
                            }
                            if (num31 == 3)
                            {
                                num33 = 2;
                            }
                            if (num31 == 4)
                            {
                                black = new Microsoft.Xna.Framework.Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor);
                            }
                            if (i > num2 && i < num2 + 2)
                            {
                                black = new Microsoft.Xna.Framework.Color((int)(black.R / 3), (int)(black.G / 3), (int)(black.B / 3), (int)(black.A / 3));
                            }
                            int num34 = 22;
                            if (Main.screenHeight < 650)
                            {
                                num34 = 20;
                            }
                            DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, text2, new Vector2((float)(num26 + num32), (float)(num27 + 74 + num34 * i + num33) + 100), black, 0f, default(Vector2), vector2, SpriteEffects.None, 0f);
                        }
                    }
                    if (!Main.playerInventory)
                    {
                        Vector2 vector2 = new Vector2(1f);
                        Vector2 vector3 = Main.fontMouseText.MeasureString(text2);
                        if (vector3.X > num4)
                        {
                            vector2.X = num4 / vector3.X;
                        }
                        if (vector2.X < 0.58f)
                        {
                            vector2.Y = 1f - vector2.X / 3f;
                        }
                        for (int num31 = 0; num31 < 5; num31++)
                        {
                            int num32 = 0;
                            int num33 = 0;
                            Microsoft.Xna.Framework.Color black = Microsoft.Xna.Framework.Color.Black;
                            if (num31 == 0)
                            {
                                num32 = -2;
                            }
                            if (num31 == 1)
                            {
                                num32 = 2;
                            }
                            if (num31 == 2)
                            {
                                num33 = -2;
                            }
                            if (num31 == 3)
                            {
                                num33 = 2;
                            }
                            if (num31 == 4)
                            {
                                black = new Microsoft.Xna.Framework.Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor);
                            }
                            if (i > num2 && i < num2 + 2)
                            {
                                black = new Microsoft.Xna.Framework.Color((int)(black.R / 3), (int)(black.G / 3), (int)(black.B / 3), (int)(black.A / 3));
                            }
                            int num34 = 22;
                            if (Main.screenHeight < 650)
                            {
                                num34 = 20;
                            }
                            DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, text2, new Vector2((float)(num26 + num32), (float)(num27 + 74 + num34 * i + num33) + 100), black, 0f, default(Vector2), vector2, SpriteEffects.None, 0f);
                        }
                    }
                }
            }
        }
Beispiel #24
0
        // Token: 0x060010CD RID: 4301 RVA: 0x00405D60 File Offset: 0x00403F60
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 2;
            int num = 3000;

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

            uILinkPoint.Unlink();
            uILinkPoint.Right = num2 + 1;
            num2        = num + 1;
            uILinkPoint = UILinkPointNavigator.Points[num2];
            uILinkPoint.Unlink();
            uILinkPoint.Left = num2 - 1;
            Rectangle        expr_A6    = this._containerPanel.GetClippingRectangle(spriteBatch);
            Vector2          minimum    = expr_A6.TopLeft();
            Vector2          maximum    = expr_A6.BottomRight();
            List <SnapPoint> snapPoints = this.GetSnapPoints();

            for (int i = 0; i < snapPoints.Count; i++)
            {
                if (!snapPoints[i].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[i]);
                    i--;
                }
            }
            SnapPoint[,] array = new SnapPoint[this._worldList.Count, 5];
            IEnumerable <SnapPoint> arg_135_0 = snapPoints;

            foreach (SnapPoint current in arg_135_0.Where((a) => { return(a.Name == "Play"); }))
            {
                array[current.ID, 0] = current;
            }
            IEnumerable <SnapPoint> arg_195_0 = snapPoints;

            foreach (SnapPoint current2 in arg_195_0.Where((a) => { return(a.Name == "Favorite"); }))
            {
                array[current2.ID, 1] = current2;
            }
            IEnumerable <SnapPoint> arg_1F5_0 = snapPoints;

            foreach (SnapPoint current3 in arg_1F5_0.Where((a) => { return(a.Name == "Cloud"); }))
            {
                array[current3.ID, 2] = current3;
            }
            IEnumerable <SnapPoint> arg_255_0 = snapPoints;

            foreach (SnapPoint current4 in arg_255_0.Where((a) => { return(a.Name == "Seed"); }))
            {
                array[current4.ID, 3] = current4;
            }
            IEnumerable <SnapPoint> arg_2B5_0 = snapPoints;

            foreach (SnapPoint current5 in arg_2B5_0.Where((a) => { return(a.Name == "Delete"); }))
            {
                array[current5.ID, 4] = current5;
            }
            num2 = num + 2;
            int[] array2 = new int[this._worldList.Count];
            for (int j = 0; j < array2.Length; j++)
            {
                array2[j] = -1;
            }
            for (int k = 0; k < 5; k++)
            {
                int num3 = -1;
                for (int l = 0; l < array.GetLength(0); l++)
                {
                    if (array[l, k] != null)
                    {
                        uILinkPoint = UILinkPointNavigator.Points[num2];
                        uILinkPoint.Unlink();
                        UILinkPointNavigator.SetPosition(num2, array[l, k].Position);
                        if (num3 != -1)
                        {
                            uILinkPoint.Up = num3;
                            UILinkPointNavigator.Points[num3].Down = num2;
                        }
                        if (array2[l] != -1)
                        {
                            uILinkPoint.Left = array2[l];
                            UILinkPointNavigator.Points[array2[l]].Right = num2;
                        }
                        uILinkPoint.Down = num;
                        if (k == 0)
                        {
                            UILinkPointNavigator.Points[num].Up = (UILinkPointNavigator.Points[num + 1].Up = num2);
                        }
                        num3      = num2;
                        array2[l] = num2;
                        UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num2;
                        num2++;
                    }
                }
            }
            if (PlayerInput.UsingGamepadUI && this._worldList.Count == 0 && UILinkPointNavigator.CurrentPoint > 3001)
            {
                UILinkPointNavigator.ChangePoint(3001);
            }
        }
Beispiel #25
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int ID1 = 3000;
            List <SnapPoint> snapPoints = this.GetSnapPoints();
            SnapPoint        snapPoint1 = (SnapPoint)null;
            SnapPoint        snapPoint2 = (SnapPoint)null;
            SnapPoint        snapPoint3 = (SnapPoint)null;
            SnapPoint        snapPoint4 = (SnapPoint)null;
            SnapPoint        snapPoint5 = (SnapPoint)null;
            SnapPoint        snapPoint6 = (SnapPoint)null;

            for (int index = 0; index < snapPoints.Count; ++index)
            {
                SnapPoint snapPoint7 = snapPoints[index];
                string    name       = snapPoint7.Name;
                if (!(name == "Back"))
                {
                    if (!(name == "Create"))
                    {
                        if (!(name == "Name"))
                        {
                            if (!(name == "Seed"))
                            {
                                if (!(name == "RandomizeName"))
                                {
                                    if (name == "RandomizeSeed")
                                    {
                                        snapPoint6 = snapPoint7;
                                    }
                                }
                                else
                                {
                                    snapPoint5 = snapPoint7;
                                }
                            }
                            else
                            {
                                snapPoint4 = snapPoint7;
                            }
                        }
                        else
                        {
                            snapPoint3 = snapPoint7;
                        }
                    }
                    else
                    {
                        snapPoint2 = snapPoint7;
                    }
                }
                else
                {
                    snapPoint1 = snapPoint7;
                }
            }
            List <SnapPoint> snapGroup1 = this.GetSnapGroup(snapPoints, "size");
            List <SnapPoint> snapGroup2 = this.GetSnapGroup(snapPoints, "difficulty");
            List <SnapPoint> snapGroup3 = this.GetSnapGroup(snapPoints, "evil");

            UILinkPointNavigator.SetPosition(ID1, snapPoint1.Position);
            UILinkPoint point1 = UILinkPointNavigator.Points[ID1];

            point1.Unlink();
            UILinkPoint uiLinkPoint1 = point1;
            int         ID2          = ID1 + 1;

            UILinkPointNavigator.SetPosition(ID2, snapPoint2.Position);
            UILinkPoint point2 = UILinkPointNavigator.Points[ID2];

            point2.Unlink();
            UILinkPoint uiLinkPoint2 = point2;
            int         ID3          = ID2 + 1;

            UILinkPointNavigator.SetPosition(ID3, snapPoint5.Position);
            UILinkPoint point3 = UILinkPointNavigator.Points[ID3];

            point3.Unlink();
            UILinkPoint uiLinkPoint3 = point3;
            int         ID4          = ID3 + 1;

            UILinkPointNavigator.SetPosition(ID4, snapPoint3.Position);
            UILinkPoint point4 = UILinkPointNavigator.Points[ID4];

            point4.Unlink();
            UILinkPoint uiLinkPoint4 = point4;
            int         ID5          = ID4 + 1;

            UILinkPointNavigator.SetPosition(ID5, snapPoint6.Position);
            UILinkPoint point5 = UILinkPointNavigator.Points[ID5];

            point5.Unlink();
            UILinkPoint uiLinkPoint5 = point5;
            int         ID6          = ID5 + 1;

            UILinkPointNavigator.SetPosition(ID6, snapPoint4.Position);
            UILinkPoint point6 = UILinkPointNavigator.Points[ID6];

            point6.Unlink();
            UILinkPoint uiLinkPoint6 = point6;
            int         ID7          = ID6 + 1;

            UILinkPoint[] uiLinkPointArray1 = new UILinkPoint[snapGroup1.Count];
            for (int index = 0; index < snapGroup1.Count; ++index)
            {
                UILinkPointNavigator.SetPosition(ID7, snapGroup1[index].Position);
                UILinkPoint point7 = UILinkPointNavigator.Points[ID7];
                point7.Unlink();
                uiLinkPointArray1[index] = point7;
                ++ID7;
            }
            UILinkPoint[] uiLinkPointArray2 = new UILinkPoint[snapGroup2.Count];
            for (int index = 0; index < snapGroup2.Count; ++index)
            {
                UILinkPointNavigator.SetPosition(ID7, snapGroup2[index].Position);
                UILinkPoint point7 = UILinkPointNavigator.Points[ID7];
                point7.Unlink();
                uiLinkPointArray2[index] = point7;
                ++ID7;
            }
            UILinkPoint[] uiLinkPointArray3 = new UILinkPoint[snapGroup3.Count];
            for (int index = 0; index < snapGroup3.Count; ++index)
            {
                UILinkPointNavigator.SetPosition(ID7, snapGroup3[index].Position);
                UILinkPoint point7 = UILinkPointNavigator.Points[ID7];
                point7.Unlink();
                uiLinkPointArray3[index] = point7;
                ++ID7;
            }
            this.LoopHorizontalLineLinks(uiLinkPointArray1);
            this.LoopHorizontalLineLinks(uiLinkPointArray2);
            this.EstablishUpDownRelationship(uiLinkPointArray1, uiLinkPointArray2);
            for (int index = 0; index < uiLinkPointArray1.Length; ++index)
            {
                uiLinkPointArray1[index].Up = uiLinkPoint6.ID;
            }
            if (true)
            {
                this.LoopHorizontalLineLinks(uiLinkPointArray3);
                this.EstablishUpDownRelationship(uiLinkPointArray2, uiLinkPointArray3);
                for (int index = 0; index < uiLinkPointArray3.Length; ++index)
                {
                    uiLinkPointArray3[index].Down = uiLinkPoint1.ID;
                }
                uiLinkPointArray3[uiLinkPointArray3.Length - 1].Down = uiLinkPoint2.ID;
                uiLinkPoint2.Up = uiLinkPointArray3[uiLinkPointArray3.Length - 1].ID;
                uiLinkPoint1.Up = uiLinkPointArray3[0].ID;
            }
            else
            {
                for (int index = 0; index < uiLinkPointArray2.Length; ++index)
                {
                    uiLinkPointArray2[index].Down = uiLinkPoint1.ID;
                }
                uiLinkPointArray2[uiLinkPointArray2.Length - 1].Down = uiLinkPoint2.ID;
                uiLinkPoint2.Up = uiLinkPointArray2[uiLinkPointArray2.Length - 1].ID;
                uiLinkPoint1.Up = uiLinkPointArray2[0].ID;
            }
            uiLinkPoint2.Left  = uiLinkPoint1.ID;
            uiLinkPoint1.Right = uiLinkPoint2.ID;
            uiLinkPoint4.Down  = uiLinkPoint6.ID;
            uiLinkPoint4.Left  = uiLinkPoint3.ID;
            uiLinkPoint3.Right = uiLinkPoint4.ID;
            uiLinkPoint6.Up    = uiLinkPoint4.ID;
            uiLinkPoint6.Down  = uiLinkPointArray1[0].ID;
            uiLinkPoint6.Left  = uiLinkPoint5.ID;
            uiLinkPoint5.Right = uiLinkPoint6.ID;
            uiLinkPoint5.Up    = uiLinkPoint3.ID;
            uiLinkPoint5.Down  = uiLinkPointArray1[0].ID;
            uiLinkPoint3.Down  = uiLinkPoint5.ID;
        }
Beispiel #26
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 2;
            int       index1     = 3000;
            int       ID1        = index1;
            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        = index1 + 1;
            Rectangle rectangle2 = this._newPanel.GetInnerDimensions().ToRectangle();
            // ISSUE: explicit reference operation
            Vector2 vector2_2 = ((Rectangle)@rectangle2).get_Center().ToVector2();

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

            point1.Unlink();
            point1.Right = index2 + 1;
            int         index3 = index1 + 1;
            UILinkPoint point2 = UILinkPointNavigator.Points[index3];

            point2.Unlink();
            point2.Left = index3 - 1;
            Rectangle        clippingRectangle = this._containerPanel.GetClippingRectangle(spriteBatch);
            Vector2          minimum           = clippingRectangle.TopLeft();
            Vector2          maximum           = clippingRectangle.BottomRight();
            List <SnapPoint> snapPoints        = this.GetSnapPoints();

            for (int index4 = 0; index4 < snapPoints.Count; ++index4)
            {
                if (!snapPoints[index4].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[index4]);
                    --index4;
                }
            }
            SnapPoint[,] snapPointArray = new SnapPoint[this._worldList.Count, 5];
            List <SnapPoint> snapPointList1 = snapPoints;

            // ISSUE: reference to a compiler-generated field
            if (UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate9 == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate9 = new Func <SnapPoint, bool>((object)null, __methodptr(\u003CSetupGamepadPoints\u003Eb__4));
            }
            // ISSUE: reference to a compiler-generated field
            Func <SnapPoint, bool> anonymousMethodDelegate9 = UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate9;

            foreach (SnapPoint snapPoint in (IEnumerable <SnapPoint>)Enumerable.Where <SnapPoint>((IEnumerable <M0>)snapPointList1, (Func <M0, bool>)anonymousMethodDelegate9))
            {
                snapPointArray[snapPoint.ID, 0] = snapPoint;
            }
            List <SnapPoint> snapPointList2 = snapPoints;

            // ISSUE: reference to a compiler-generated field
            if (UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegatea == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegatea = new Func <SnapPoint, bool>((object)null, __methodptr(\u003CSetupGamepadPoints\u003Eb__5));
            }
            // ISSUE: reference to a compiler-generated field
            Func <SnapPoint, bool> anonymousMethodDelegatea = UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegatea;

            foreach (SnapPoint snapPoint in (IEnumerable <SnapPoint>)Enumerable.Where <SnapPoint>((IEnumerable <M0>)snapPointList2, (Func <M0, bool>)anonymousMethodDelegatea))
            {
                snapPointArray[snapPoint.ID, 1] = snapPoint;
            }
            List <SnapPoint> snapPointList3 = snapPoints;

            // ISSUE: reference to a compiler-generated field
            if (UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegateb == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegateb = new Func <SnapPoint, bool>((object)null, __methodptr(\u003CSetupGamepadPoints\u003Eb__6));
            }
            // ISSUE: reference to a compiler-generated field
            Func <SnapPoint, bool> anonymousMethodDelegateb = UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegateb;

            foreach (SnapPoint snapPoint in (IEnumerable <SnapPoint>)Enumerable.Where <SnapPoint>((IEnumerable <M0>)snapPointList3, (Func <M0, bool>)anonymousMethodDelegateb))
            {
                snapPointArray[snapPoint.ID, 2] = snapPoint;
            }
            List <SnapPoint> snapPointList4 = snapPoints;

            // ISSUE: reference to a compiler-generated field
            if (UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegatec == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegatec = new Func <SnapPoint, bool>((object)null, __methodptr(\u003CSetupGamepadPoints\u003Eb__7));
            }
            // ISSUE: reference to a compiler-generated field
            Func <SnapPoint, bool> anonymousMethodDelegatec = UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegatec;

            foreach (SnapPoint snapPoint in (IEnumerable <SnapPoint>)Enumerable.Where <SnapPoint>((IEnumerable <M0>)snapPointList4, (Func <M0, bool>)anonymousMethodDelegatec))
            {
                snapPointArray[snapPoint.ID, 3] = snapPoint;
            }
            List <SnapPoint> snapPointList5 = snapPoints;

            // ISSUE: reference to a compiler-generated field
            if (UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegated == null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: method pointer
                UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegated = new Func <SnapPoint, bool>((object)null, __methodptr(\u003CSetupGamepadPoints\u003Eb__8));
            }
            // ISSUE: reference to a compiler-generated field
            Func <SnapPoint, bool> anonymousMethodDelegated = UIWorldSelect.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegated;

            foreach (SnapPoint snapPoint in (IEnumerable <SnapPoint>)Enumerable.Where <SnapPoint>((IEnumerable <M0>)snapPointList5, (Func <M0, bool>)anonymousMethodDelegated))
            {
                snapPointArray[snapPoint.ID, 4] = snapPoint;
            }
            int ID3 = index1 + 2;

            int[] numArray = new int[this._worldList.Count];
            for (int index4 = 0; index4 < numArray.Length; ++index4)
            {
                numArray[index4] = -1;
            }
            for (int index4 = 0; index4 < 5; ++index4)
            {
                int index5 = -1;
                for (int index6 = 0; index6 < snapPointArray.GetLength(0); ++index6)
                {
                    if (snapPointArray[index6, index4] != null)
                    {
                        UILinkPoint point3 = UILinkPointNavigator.Points[ID3];
                        point3.Unlink();
                        UILinkPointNavigator.SetPosition(ID3, snapPointArray[index6, index4].Position);
                        if (index5 != -1)
                        {
                            point3.Up = index5;
                            UILinkPointNavigator.Points[index5].Down = ID3;
                        }
                        if (numArray[index6] != -1)
                        {
                            point3.Left = numArray[index6];
                            UILinkPointNavigator.Points[numArray[index6]].Right = ID3;
                        }
                        point3.Down = index1;
                        if (index4 == 0)
                        {
                            UILinkPointNavigator.Points[index1].Up = UILinkPointNavigator.Points[index1 + 1].Up = ID3;
                        }
                        index5           = ID3;
                        numArray[index6] = ID3;
                        UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = ID3;
                        ++ID3;
                    }
                }
            }
            if (!PlayerInput.UsingGamepadUI || this._worldList.Count != 0 || UILinkPointNavigator.CurrentPoint <= 3001)
            {
                return;
            }
            UILinkPointNavigator.ChangePoint(3001);
        }
Beispiel #27
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 2;
            int       index1     = 3000;
            int       ID1        = index1;
            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        = index1 + 1;
            Rectangle rectangle2 = this._newPanel.GetInnerDimensions().ToRectangle();
            // ISSUE: explicit reference operation
            Vector2 vector2_2 = ((Rectangle)@rectangle2).get_Center().ToVector2();

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

            point1.Unlink();
            point1.Right = index2 + 1;
            int         index3 = index1 + 1;
            UILinkPoint point2 = UILinkPointNavigator.Points[index3];

            point2.Unlink();
            point2.Left = index3 - 1;
            Rectangle        clippingRectangle = this._containerPanel.GetClippingRectangle(spriteBatch);
            Vector2          minimum           = clippingRectangle.TopLeft();
            Vector2          maximum           = clippingRectangle.BottomRight();
            List <SnapPoint> snapPoints        = this.GetSnapPoints();

            for (int index4 = 0; index4 < snapPoints.Count; ++index4)
            {
                if (!snapPoints[index4].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[index4]);
                    --index4;
                }
            }
            SnapPoint[,] snapPointArray = new SnapPoint[this._worldList.Count, 5];
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Play")))
            {
                snapPointArray[snapPoint.ID, 0] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Favorite")))
            {
                snapPointArray[snapPoint.ID, 1] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Cloud")))
            {
                snapPointArray[snapPoint.ID, 2] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Seed")))
            {
                snapPointArray[snapPoint.ID, 3] = snapPoint;
            }
            foreach (SnapPoint snapPoint in snapPoints.Where <SnapPoint>((Func <SnapPoint, bool>)(a => a.Name == "Delete")))
            {
                snapPointArray[snapPoint.ID, 4] = snapPoint;
            }
            int ID3 = index1 + 2;

            int[] numArray = new int[this._worldList.Count];
            for (int index4 = 0; index4 < numArray.Length; ++index4)
            {
                numArray[index4] = -1;
            }
            for (int index4 = 0; index4 < 5; ++index4)
            {
                int index5 = -1;
                for (int index6 = 0; index6 < snapPointArray.GetLength(0); ++index6)
                {
                    if (snapPointArray[index6, index4] != null)
                    {
                        UILinkPoint point3 = UILinkPointNavigator.Points[ID3];
                        point3.Unlink();
                        UILinkPointNavigator.SetPosition(ID3, snapPointArray[index6, index4].Position);
                        if (index5 != -1)
                        {
                            point3.Up = index5;
                            UILinkPointNavigator.Points[index5].Down = ID3;
                        }
                        if (numArray[index6] != -1)
                        {
                            point3.Left = numArray[index6];
                            UILinkPointNavigator.Points[numArray[index6]].Right = ID3;
                        }
                        point3.Down = index1;
                        if (index4 == 0)
                        {
                            UILinkPointNavigator.Points[index1].Up = UILinkPointNavigator.Points[index1 + 1].Up = ID3;
                        }
                        index5           = ID3;
                        numArray[index6] = ID3;
                        UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = ID3;
                        ++ID3;
                    }
                }
            }
            if (!PlayerInput.UsingGamepadUI || this._worldList.Count != 0 || UILinkPointNavigator.CurrentPoint <= 3001)
            {
                return;
            }
            UILinkPointNavigator.ChangePoint(3001);
        }
Beispiel #28
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int ID1    = 3001;
            int index1 = ID1;
            List <SnapPoint> snapPoints = this.GetSnapPoints();

            UILinkPointNavigator.SetPosition(ID1, this._backPanel.GetInnerDimensions().ToRectangle().Center.ToVector2());
            UILinkPoint point1 = UILinkPointNavigator.Points[index1];

            point1.Unlink();
            point1.Up = index1 + 1;
            UILinkPoint uiLinkPoint       = point1;
            int         ID2               = index1 + 1;
            float       num1              = 1f / Main.UIScale;
            Rectangle   clippingRectangle = this._container.GetClippingRectangle(spriteBatch);
            Vector2     minimum           = clippingRectangle.TopLeft() * num1;
            Vector2     maximum           = clippingRectangle.BottomRight() * num1;

            for (int index2 = 0; index2 < snapPoints.Count; ++index2)
            {
                if (!snapPoints[index2].Position.Between(minimum, maximum))
                {
                    snapPoints.Remove(snapPoints[index2]);
                    --index2;
                }
            }
            int num2 = 0;
            int num3 = 7;
            List <List <SnapPoint> > snapPointListList = new List <List <SnapPoint> >();

            for (int groupIndex = 0; groupIndex < num3; ++groupIndex)
            {
                List <SnapPoint> emoteGroup = this.GetEmoteGroup(snapPoints, groupIndex);
                if (emoteGroup.Count > 0)
                {
                    snapPointListList.Add(emoteGroup);
                }
            }
            List <SnapPoint>[] array = snapPointListList.ToArray();
            for (int index2 = 0; index2 < array.Length; ++index2)
            {
                List <SnapPoint> snapPointList = array[index2];
                int num4 = snapPointList.Count / 14;
                if (snapPointList.Count % 14 > 0)
                {
                    ++num4;
                }
                int num5 = 14;
                if (snapPointList.Count % 14 != 0)
                {
                    num5 = snapPointList.Count % 14;
                }
                for (int index3 = 0; index3 < snapPointList.Count; ++index3)
                {
                    UILinkPoint point2 = UILinkPointNavigator.Points[ID2];
                    point2.Unlink();
                    UILinkPointNavigator.SetPosition(ID2, snapPointList[index3].Position);
                    int num6 = 14;
                    if (index3 / 14 == num4 - 1 && snapPointList.Count % 14 != 0)
                    {
                        num6 = snapPointList.Count % 14;
                    }
                    int num7 = index3 % 14;
                    point2.Left  = ID2 - 1;
                    point2.Right = ID2 + 1;
                    point2.Up    = ID2 - 14;
                    point2.Down  = ID2 + 14;
                    if (num7 == num6 - 1)
                    {
                        point2.Right = ID2 - num6 + 1;
                    }
                    if (num7 == 0)
                    {
                        point2.Left = ID2 + num6 - 1;
                    }
                    if (num7 == 0)
                    {
                        uiLinkPoint.Up = ID2;
                    }
                    if (index3 < 14)
                    {
                        if (num2 == 0)
                        {
                            point2.Up = -1;
                        }
                        else
                        {
                            point2.Up = ID2 - 14;
                            if (num7 >= num2)
                            {
                                point2.Up -= 14;
                            }
                            for (int index4 = index2 - 1; index4 > 0 && array[index4].Count <= num7; --index4)
                            {
                                point2.Up -= 14;
                            }
                        }
                    }
                    int num8 = ID1;
                    if (index2 == array.Length - 1)
                    {
                        if (index3 / 14 < num4 - 1 && num7 >= snapPointList.Count % 14)
                        {
                            point2.Down = num8;
                        }
                        if (index3 / 14 == num4 - 1)
                        {
                            point2.Down = num8;
                        }
                    }
                    else if (index3 / 14 == num4 - 1)
                    {
                        point2.Down = ID2 + 14;
                        for (int index4 = index2 + 1; index4 < array.Length && array[index4].Count <= num7; ++index4)
                        {
                            point2.Down += 14;
                        }
                        if (index2 == array.Length - 1)
                        {
                            point2.Down = num8;
                        }
                    }
                    else if (num7 >= num5)
                    {
                        point2.Down = ID2 + 14 + 14;
                        for (int index4 = index2 + 1; index4 < array.Length && array[index4].Count <= num7; ++index4)
                        {
                            point2.Down += 14;
                        }
                    }
                    ++ID2;
                }
                num2 = num5;
                int num9 = 14 - num2;
                ID2 += num9;
            }
        }
Beispiel #29
0
        private void SetupGamepadPoints2(SpriteBatch spriteBatch)
        {
            int num1 = 7;

            UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
            int ID1;
            int index1 = ID1 = 3001;
            List <SnapPoint> snapPoints = this.GetSnapPoints();

            this.RemoveSnapPointsOutOfScreen(spriteBatch, snapPoints);
            Vector2 vector2 = this._backPanel.GetInnerDimensions().ToRectangle().Center.ToVector2();

            UILinkPointNavigator.SetPosition(ID1, vector2);
            UILinkPoint point1 = UILinkPointNavigator.Points[index1];

            point1.Unlink();
            point1.Up = index1 + 1;
            UILinkPoint uiLinkPoint = point1;
            int         ID2         = index1 + 1;
            int         length      = 0;
            List <List <SnapPoint> > snapPointListList = new List <List <SnapPoint> >();

            for (int groupIndex = 0; groupIndex < num1; ++groupIndex)
            {
                List <SnapPoint> emoteGroup = this.GetEmoteGroup(snapPoints, groupIndex);
                if (emoteGroup.Count > 0)
                {
                    snapPointListList.Add(emoteGroup);
                }
                length += (int)Math.Ceiling((double)emoteGroup.Count / 14.0);
            }
            SnapPoint[,] snapPointArray = new SnapPoint[14, length];
            int num2 = 0;

            for (int index2 = 0; index2 < snapPointListList.Count; ++index2)
            {
                List <SnapPoint> snapPointList = snapPointListList[index2];
                for (int index3 = 0; index3 < snapPointList.Count; ++index3)
                {
                    int index4 = num2 + index3 / 14;
                    int index5 = index3 % 14;
                    snapPointArray[index5, index4] = snapPointList[index3];
                }
                num2 += (int)Math.Ceiling((double)snapPointList.Count / 14.0);
            }
            int[,] grid = new int[14, length];
            int num3 = 0;

            for (int index2 = 0; index2 < snapPointArray.GetLength(1); ++index2)
            {
                for (int index3 = 0; index3 < snapPointArray.GetLength(0); ++index3)
                {
                    SnapPoint snapPoint = snapPointArray[index3, index2];
                    if (snapPoint != null)
                    {
                        UILinkPointNavigator.Points[ID2].Unlink();
                        UILinkPointNavigator.SetPosition(ID2, snapPoint.Position);
                        grid[index3, index2] = ID2;
                        if (index3 == 0)
                        {
                            num3 = ID2;
                        }
                        ++ID2;
                    }
                }
            }
            uiLinkPoint.Up = num3;
            for (int y1 = 0; y1 < snapPointArray.GetLength(1); ++y1)
            {
                for (int x1 = 0; x1 < snapPointArray.GetLength(0); ++x1)
                {
                    int index2 = grid[x1, y1];
                    if (index2 != 0)
                    {
                        UILinkPoint point2 = UILinkPointNavigator.Points[index2];
                        if (this.TryGetPointOnGrid(grid, x1, y1, -1, 0))
                        {
                            point2.Left = grid[x1 - 1, y1];
                        }
                        else
                        {
                            point2.Left = point2.ID;
                            for (int x2 = x1; x2 < snapPointArray.GetLength(0); ++x2)
                            {
                                if (this.TryGetPointOnGrid(grid, x2, y1, 0, 0))
                                {
                                    point2.Left = grid[x2, y1];
                                }
                            }
                        }
                        if (this.TryGetPointOnGrid(grid, x1, y1, 1, 0))
                        {
                            point2.Right = grid[x1 + 1, y1];
                        }
                        else
                        {
                            point2.Right = point2.ID;
                            for (int x2 = x1; x2 >= 0; --x2)
                            {
                                if (this.TryGetPointOnGrid(grid, x2, y1, 0, 0))
                                {
                                    point2.Right = grid[x2, y1];
                                }
                            }
                        }
                        if (this.TryGetPointOnGrid(grid, x1, y1, 0, -1))
                        {
                            point2.Up = grid[x1, y1 - 1];
                        }
                        else
                        {
                            point2.Up = point2.ID;
                            for (int y2 = y1 - 1; y2 >= 0; --y2)
                            {
                                if (this.TryGetPointOnGrid(grid, x1, y2, 0, 0))
                                {
                                    point2.Up = grid[x1, y2];
                                    break;
                                }
                            }
                        }
                        if (this.TryGetPointOnGrid(grid, x1, y1, 0, 1))
                        {
                            point2.Down = grid[x1, y1 + 1];
                        }
                        else
                        {
                            point2.Down = point2.ID;
                            for (int y2 = y1 + 1; y2 < snapPointArray.GetLength(1); ++y2)
                            {
                                if (this.TryGetPointOnGrid(grid, x1, y2, 0, 0))
                                {
                                    point2.Down = grid[x1, y2];
                                    break;
                                }
                            }
                            if (point2.Down == point2.ID)
                            {
                                point2.Down = uiLinkPoint.ID;
                            }
                        }
                    }
                }
            }
        }
Beispiel #30
0
        private void SetupGamepadPoints(SpriteBatch spriteBatch)
        {
            UILinkPointNavigator.Shortcuts.BackButtonCommand            = 6;
            UILinkPointNavigator.Shortcuts.FANCYUI_SPECIAL_INSTRUCTIONS = 1;
            int num  = 3002;
            int num2 = num;

            UILinkPointNavigator.SetPosition(3000, _cancelButton.GetDimensions().Center());
            UILinkPoint uILinkPoint = UILinkPointNavigator.Points[3000];

            uILinkPoint.Unlink();
            uILinkPoint.Right = 3001;
            uILinkPoint.Up    = num + 40;
            UILinkPointNavigator.SetPosition(3001, _submitButton.GetDimensions().Center());
            uILinkPoint = UILinkPointNavigator.Points[3001];
            uILinkPoint.Unlink();
            uILinkPoint.Left = 3000;
            uILinkPoint.Up   = num + 49;
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    int num3 = i * 10 + j;
                    num2 = num + num3;
                    if (_keyList[num3] != null)
                    {
                        UILinkPointNavigator.SetPosition(num2, _keyList[num3].GetDimensions().Center());
                        uILinkPoint = UILinkPointNavigator.Points[num2];
                        uILinkPoint.Unlink();
                        int num4 = j - 1;
                        while (num4 >= 0 && _keyList[i * 10 + num4] == _keyList[num3])
                        {
                            num4--;
                        }
                        if (num4 != -1)
                        {
                            uILinkPoint.Left = i * 10 + num4 + num;
                        }
                        else
                        {
                            uILinkPoint.Left = i * 10 + 9 + num;
                        }
                        int k;
                        for (k = j + 1; k <= 9 && _keyList[i * 10 + k] == _keyList[num3]; k++)
                        {
                        }
                        if (k != 10 && _keyList[num3] != _keyList[k])
                        {
                            uILinkPoint.Right = i * 10 + k + num;
                        }
                        else
                        {
                            uILinkPoint.Right = i * 10 + num;
                        }
                        if (i != 0)
                        {
                            uILinkPoint.Up = num2 - 10;
                        }
                        if (i != 4)
                        {
                            uILinkPoint.Down = num2 + 10;
                        }
                        else
                        {
                            uILinkPoint.Down = ((j < 5) ? 3000 : 3001);
                        }
                    }
                }
            }
        }