Esempio n. 1
0
        public SkillsPage(int x, int y, int width, int height)
            : base(x, y, width, height)
        {
            int baseX = xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 80;
            int baseY = yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)height / 2f) + 80;

            playerPanel = new Rectangle(xPositionOnScreen + 64, yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder, 128, 192);
            if (Game1.player.canUnderstandDwarves)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11587"), Game1.mouseCursors, new Rectangle(129, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10201,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasRustyKey)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 68, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11588"), Game1.mouseCursors, new Rectangle(145, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10202,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasClubCard)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 136, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11589"), Game1.mouseCursors, new Rectangle(161, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10203,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasSpecialCharm)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 204, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11590"), Game1.mouseCursors, new Rectangle(176, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10204,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasSkullKey)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 272, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11591"), Game1.mouseCursors, new Rectangle(192, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10210,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasMagnifyingGlass)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 340, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.magnifyingglass"), Game1.mouseCursors, new Rectangle(208, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10205,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasDarkTalisman)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 408, baseY, 64, 64), null, Game1.content.LoadString("Strings\\Objects:DarkTalisman"), Game1.mouseCursors, new Rectangle(225, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10206,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.hasMagicInk)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 476, baseY, 64, 64), null, Game1.content.LoadString("Strings\\Objects:MagicInk"), Game1.mouseCursors, new Rectangle(241, 320, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10207,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.eventsSeen.Contains(2120303))
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 544, baseY, 64, 64), null, Game1.content.LoadString("Strings\\Objects:BearPaw"), Game1.mouseCursors, new Rectangle(192, 336, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10208,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.eventsSeen.Contains(3910979))
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 612, baseY, 64, 64), null, Game1.content.LoadString("Strings\\Objects:SpringOnionBugs"), Game1.mouseCursors, new Rectangle(208, 336, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10209,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            if (Game1.player.HasTownKey)
            {
                specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX, baseY, 64, 64), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:KeyToTheTown"), Game1.objectSpriteSheet, Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, 912, 16, 16), 4f, drawShadow: true)
                {
                    myID            = 10211,
                    rightNeighborID = -99998,
                    leftNeighborID  = -99998,
                    upNeighborID    = 4
                });
            }
            else
            {
                specialItems.Add(null);
            }
            int spacing = 680 / specialItems.Count;

            for (int m = 0; m < specialItems.Count; m++)
            {
                if (specialItems[m] != null)
                {
                    specialItems[m].bounds.X = baseX + m * spacing;
                }
            }
            ClickableComponent.SetUpNeighbors(specialItems, 4);
            ClickableComponent.ChainNeighborsLeftRight(specialItems);
            int addedX = 0;
            int drawX  = (LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru || LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.it) ? (xPositionOnScreen + width - 448 - 48 + 4) : (xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 256 - 4);
            int drawY  = yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - 12;

            for (int l = 4; l < 10; l += 5)
            {
                for (int i = 0; i < 5; i++)
                {
                    string professionBlurb  = "";
                    string professionTitle  = "";
                    bool   drawRed          = false;
                    int    professionNumber = -1;
                    switch (i)
                    {
                    case 0:
                        drawRed          = (Game1.player.FarmingLevel > l);
                        professionNumber = Game1.player.getProfessionForSkill(0, l + 1);
                        parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 1:
                        drawRed          = (Game1.player.MiningLevel > l);
                        professionNumber = Game1.player.getProfessionForSkill(3, l + 1);
                        parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 2:
                        drawRed          = (Game1.player.ForagingLevel > l);
                        professionNumber = Game1.player.getProfessionForSkill(2, l + 1);
                        parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 3:
                        drawRed          = (Game1.player.FishingLevel > l);
                        professionNumber = Game1.player.getProfessionForSkill(1, l + 1);
                        parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 4:
                        drawRed          = (Game1.player.CombatLevel > l);
                        professionNumber = Game1.player.getProfessionForSkill(4, l + 1);
                        parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 5:
                        drawRed          = (Game1.player.LuckLevel > l);
                        professionNumber = Game1.player.getProfessionForSkill(5, l + 1);
                        parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;
                    }
                    if (drawRed && (l + 1) % 5 == 0)
                    {
                        skillBars.Add(new ClickableTextureComponent(string.Concat(professionNumber), new Rectangle(addedX + drawX - 4 + l * 36, drawY + i * 56, 56, 36), null, professionBlurb, Game1.mouseCursors, new Rectangle(159, 338, 14, 9), 4f, drawShadow: true)
                        {
                            myID            = ((l + 1 == 5) ? (100 + i) : (200 + i)),
                            leftNeighborID  = ((l + 1 == 5) ? i : (100 + i)),
                            rightNeighborID = ((l + 1 == 5) ? (200 + i) : (-1)),
                            downNeighborID  = -99998
                        });
                    }
                }
                addedX += 24;
            }
            for (int k = 0; k < skillBars.Count; k++)
            {
                if (k < skillBars.Count - 1 && Math.Abs(skillBars[k + 1].myID - skillBars[k].myID) < 50)
                {
                    skillBars[k].downNeighborID   = skillBars[k + 1].myID;
                    skillBars[k + 1].upNeighborID = skillBars[k].myID;
                }
            }
            if (skillBars.Count > 1 && skillBars.Last().myID >= 200 && skillBars[skillBars.Count - 2].myID >= 200)
            {
                skillBars.Last().upNeighborID = skillBars[skillBars.Count - 2].myID;
            }
            for (int j = 0; j < 5; j++)
            {
                int index = j;
                switch (index)
                {
                case 1:
                    index = 3;
                    break;

                case 3:
                    index = 1;
                    break;
                }
                string text = "";
                switch (index)
                {
                case 0:
                    if (Game1.player.FarmingLevel > 0)
                    {
                        text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11592", Game1.player.FarmingLevel) + Environment.NewLine + Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11594", Game1.player.FarmingLevel);
                    }
                    break;

                case 2:
                    if (Game1.player.ForagingLevel > 0)
                    {
                        text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11596", Game1.player.ForagingLevel);
                    }
                    break;

                case 1:
                    if (Game1.player.FishingLevel > 0)
                    {
                        text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11598", Game1.player.FishingLevel);
                    }
                    break;

                case 3:
                    if (Game1.player.MiningLevel > 0)
                    {
                        text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11600", Game1.player.MiningLevel);
                    }
                    break;

                case 4:
                    if (Game1.player.CombatLevel > 0)
                    {
                        text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11602", Game1.player.CombatLevel * 5);
                    }
                    break;
                }
                skillAreas.Add(new ClickableTextureComponent(string.Concat(index), new Rectangle(drawX - 128 - 48, drawY + j * 56, 148, 36), string.Concat(index), text, null, Rectangle.Empty, 1f)
                {
                    myID            = j,
                    downNeighborID  = ((j < 4) ? (j + 1) : (-99998)),
                    upNeighborID    = ((j > 0) ? (j - 1) : 12341),
                    rightNeighborID = 100 + j
                });
            }
        }
Esempio n. 2
0
        public SkillsPage(int x, int y, int width, int height)
            : base(x, y, width, height, false)
        {
            int x1 = this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 5 / 4;
            int y1 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)height / 2.0) + Game1.tileSize * 5 / 4;

            this.playerPanel = new Rectangle(this.xPositionOnScreen + Game1.tileSize, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder, Game1.tileSize * 2, Game1.tileSize * 3);
            if (Game1.player.canUnderstandDwarves)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1, y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11587"), Game1.mouseCursors, new Rectangle(129, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10201;
                textureComponent.myID = num1;
                int num2 = 10202;
                textureComponent.rightNeighborID = num2;
                int num3 = 4;
                textureComponent.upNeighborID = num3;
                specialItems.Add(textureComponent);
            }
            if (Game1.player.hasRustyKey)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1 + (Game1.tileSize + Game1.pixelZoom), y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11588"), Game1.mouseCursors, new Rectangle(145, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10202;
                textureComponent.myID = num1;
                int num2 = 10203;
                textureComponent.rightNeighborID = num2;
                int num3 = 10201;
                textureComponent.leftNeighborID = num3;
                int num4 = 4;
                textureComponent.upNeighborID = num4;
                specialItems.Add(textureComponent);
            }
            if (Game1.player.hasClubCard)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1 + 2 * (Game1.tileSize + Game1.pixelZoom), y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11589"), Game1.mouseCursors, new Rectangle(161, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10203;
                textureComponent.myID = num1;
                int num2 = 10204;
                textureComponent.rightNeighborID = num2;
                int num3 = 10202;
                textureComponent.leftNeighborID = num3;
                int num4 = 4;
                textureComponent.upNeighborID = num4;
                specialItems.Add(textureComponent);
            }
            if (Game1.player.hasSpecialCharm)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1 + 3 * (Game1.tileSize + Game1.pixelZoom), y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11590"), Game1.mouseCursors, new Rectangle(177, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10204;
                textureComponent.myID = num1;
                int num2 = 10205;
                textureComponent.rightNeighborID = num2;
                int num3 = 10203;
                textureComponent.leftNeighborID = num3;
                int num4 = 4;
                textureComponent.upNeighborID = num4;
                specialItems.Add(textureComponent);
            }
            if (Game1.player.hasSkullKey)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1 + 4 * (Game1.tileSize + Game1.pixelZoom), y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11591"), Game1.mouseCursors, new Rectangle(193, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10205;
                textureComponent.myID = num1;
                int num2 = 10206;
                textureComponent.rightNeighborID = num2;
                int num3 = 10204;
                textureComponent.leftNeighborID = num3;
                int num4 = 4;
                textureComponent.upNeighborID = num4;
                specialItems.Add(textureComponent);
            }
            if (Game1.player.hasDarkTalisman)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1 + 5 * (Game1.tileSize + Game1.pixelZoom), y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\Objects:DarkTalisman"), Game1.mouseCursors, new Rectangle(225, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10206;
                textureComponent.myID = num1;
                int num2 = 10207;
                textureComponent.rightNeighborID = num2;
                int num3 = 10205;
                textureComponent.leftNeighborID = num3;
                int num4 = 4;
                textureComponent.upNeighborID = num4;
                specialItems.Add(textureComponent);
            }
            if (Game1.player.hasMagicInk)
            {
                List <ClickableTextureComponent> specialItems     = this.specialItems;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent("", new Rectangle(x1 + 6 * (Game1.tileSize + Game1.pixelZoom), y1, Game1.tileSize, Game1.tileSize), (string)null, Game1.content.LoadString("Strings\\Objects:MagicInk"), Game1.mouseCursors, new Rectangle(241, 320, 16, 16), (float)Game1.pixelZoom, true);
                int num1 = 10207;
                textureComponent.myID = num1;
                int num2 = 10206;
                textureComponent.leftNeighborID = num2;
                int num3 = 4;
                textureComponent.upNeighborID = num3;
                specialItems.Add(textureComponent);
            }
            int num5 = 0;
            int num6 = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru ? this.xPositionOnScreen + width - Game1.tileSize * 7 - Game1.tileSize * 3 / 4 + Game1.pixelZoom : this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - Game1.pixelZoom;
            int num7 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 3;
            int num8 = 4;

            while (num8 < 10)
            {
                for (int index = 0; index < 5; ++index)
                {
                    string professionBlurb = "";
                    string professionTitle = "";
                    bool   flag            = false;
                    int    whichProfession = -1;
                    switch (index)
                    {
                    case 0:
                        flag            = Game1.player.FarmingLevel > num8;
                        whichProfession = Game1.player.getProfessionForSkill(0, num8 + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(whichProfession));
                        break;

                    case 1:
                        flag            = Game1.player.MiningLevel > num8;
                        whichProfession = Game1.player.getProfessionForSkill(3, num8 + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(whichProfession));
                        break;

                    case 2:
                        flag            = Game1.player.ForagingLevel > num8;
                        whichProfession = Game1.player.getProfessionForSkill(2, num8 + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(whichProfession));
                        break;

                    case 3:
                        flag            = Game1.player.FishingLevel > num8;
                        whichProfession = Game1.player.getProfessionForSkill(1, num8 + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(whichProfession));
                        break;

                    case 4:
                        flag            = Game1.player.CombatLevel > num8;
                        whichProfession = Game1.player.getProfessionForSkill(4, num8 + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(whichProfession));
                        break;

                    case 5:
                        flag            = Game1.player.LuckLevel > num8;
                        whichProfession = Game1.player.getProfessionForSkill(5, num8 + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(whichProfession));
                        break;
                    }
                    if (flag && (num8 + 1) % 5 == 0)
                    {
                        List <ClickableTextureComponent> skillBars        = this.skillBars;
                        ClickableTextureComponent        textureComponent = new ClickableTextureComponent(string.Concat((object)whichProfession), new Rectangle(num5 + num6 - Game1.pixelZoom + num8 * (Game1.tileSize / 2 + Game1.pixelZoom), num7 + index * (Game1.tileSize / 2 + Game1.pixelZoom * 6), 14 * Game1.pixelZoom, 9 * Game1.pixelZoom), (string)null, professionBlurb, Game1.mouseCursors, new Rectangle(159, 338, 14, 9), (float)Game1.pixelZoom, true);
                        int num1 = num8 + 1 == 5 ? 100 + index : 200 + index;
                        textureComponent.myID = num1;
                        int num2 = num8 + 1 == 5 ? index : 100 + index;
                        textureComponent.leftNeighborID = num2;
                        int num3 = num8 + 1 == 5 ? 200 + index : -1;
                        textureComponent.rightNeighborID = num3;
                        int num4 = 10201;
                        textureComponent.downNeighborID = num4;
                        skillBars.Add(textureComponent);
                    }
                }
                num5 += Game1.pixelZoom * 6;
                num8 += 5;
            }
            for (int index = 0; index < this.skillBars.Count; ++index)
            {
                if (index < this.skillBars.Count - 1 && Math.Abs(this.skillBars[index + 1].myID - this.skillBars[index].myID) < 50)
                {
                    this.skillBars[index].downNeighborID   = this.skillBars[index + 1].myID;
                    this.skillBars[index + 1].upNeighborID = this.skillBars[index].myID;
                }
            }
            if (this.skillBars.Count > 1 && this.skillBars.Last <ClickableTextureComponent>().myID >= 200 && this.skillBars[this.skillBars.Count - 2].myID >= 200)
            {
                this.skillBars.Last <ClickableTextureComponent>().upNeighborID = this.skillBars[this.skillBars.Count - 2].myID;
            }
            for (int index = 0; index < 5; ++index)
            {
                int num1 = index;
                switch (num1)
                {
                case 1:
                    num1 = 3;
                    break;

                case 3:
                    num1 = 1;
                    break;
                }
                string hoverText = "";
                switch (num1)
                {
                case 0:
                    if (Game1.player.FarmingLevel > 0)
                    {
                        hoverText = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11592", (object)Game1.player.FarmingLevel) + Environment.NewLine + Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11594", (object)Game1.player.FarmingLevel);
                        break;
                    }
                    break;

                case 1:
                    if (Game1.player.FishingLevel > 0)
                    {
                        hoverText = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11598", (object)Game1.player.FishingLevel);
                        break;
                    }
                    break;

                case 2:
                    if (Game1.player.ForagingLevel > 0)
                    {
                        hoverText = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11596", (object)Game1.player.ForagingLevel);
                        break;
                    }
                    break;

                case 3:
                    if (Game1.player.MiningLevel > 0)
                    {
                        hoverText = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11600", (object)Game1.player.MiningLevel);
                        break;
                    }
                    break;

                case 4:
                    if (Game1.player.CombatLevel > 0)
                    {
                        hoverText = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11602", (object)(Game1.player.CombatLevel * 5));
                        break;
                    }
                    break;
                }
                List <ClickableTextureComponent> skillAreas       = this.skillAreas;
                ClickableTextureComponent        textureComponent = new ClickableTextureComponent(string.Concat((object)num1), new Rectangle(num6 - Game1.tileSize * 2 - Game1.tileSize * 3 / 4, num7 + index * (Game1.tileSize / 2 + Game1.pixelZoom * 6), Game1.tileSize * 2 + Game1.pixelZoom * 5, 9 * Game1.pixelZoom), string.Concat((object)num1), hoverText, (Texture2D)null, Rectangle.Empty, 1f, false);
                int num2 = index;
                textureComponent.myID = num2;
                int num3 = index < 4 ? index + 1 : 10201;
                textureComponent.downNeighborID = num3;
                int num4 = index > 0 ? index - 1 : 12341;
                textureComponent.upNeighborID = num4;
                int num9 = 100 + index;
                textureComponent.rightNeighborID = num9;
                skillAreas.Add(textureComponent);
            }
        }
        // Token: 0x06000FCE RID: 4046 RVA: 0x00147358 File Offset: 0x00145558
        public SkillsPage(int x, int y, int width, int height) : base(x, y, width, height, false)
        {
            int baseX = this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 5 / 4;
            int baseY = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)height / 2f) + Game1.tileSize * 5 / 4;

            this.playerPanel = new Rectangle(this.xPositionOnScreen + Game1.tileSize, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder, Game1.tileSize * 2, Game1.tileSize * 3);
            if (Game1.player.canUnderstandDwarves)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX, baseY, Game1.tileSize, Game1.tileSize), null, "Dwarvish Translation Guide", Game1.mouseCursors, new Rectangle(129, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            if (Game1.player.hasRustyKey)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + (Game1.tileSize + Game1.pixelZoom), baseY, Game1.tileSize, Game1.tileSize), null, "Rusty Key", Game1.mouseCursors, new Rectangle(145, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            if (Game1.player.hasClubCard)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 2 * (Game1.tileSize + Game1.pixelZoom), baseY, Game1.tileSize, Game1.tileSize), null, "Club Card", Game1.mouseCursors, new Rectangle(161, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            if (Game1.player.hasSpecialCharm)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 3 * (Game1.tileSize + Game1.pixelZoom), baseY, Game1.tileSize, Game1.tileSize), null, "Special Charm", Game1.mouseCursors, new Rectangle(177, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            if (Game1.player.hasSkullKey)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 4 * (Game1.tileSize + Game1.pixelZoom), baseY, Game1.tileSize, Game1.tileSize), null, "Skull Key", Game1.mouseCursors, new Rectangle(193, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            if (Game1.player.hasDarkTalisman)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 5 * (Game1.tileSize + Game1.pixelZoom), baseY, Game1.tileSize, Game1.tileSize), null, "Dark Talisman", Game1.mouseCursors, new Rectangle(225, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            if (Game1.player.hasMagicInk)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(baseX + 6 * (Game1.tileSize + Game1.pixelZoom), baseY, Game1.tileSize, Game1.tileSize), null, "Magic Ink", Game1.mouseCursors, new Rectangle(241, 320, 16, 16), (float)Game1.pixelZoom, true));
            }
            int addedX = 0;
            int drawX  = this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - Game1.pixelZoom;
            int drawY  = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 3;

            for (int i = 4; i < 10; i += 5)
            {
                for (int j = 0; j < 5; j++)
                {
                    string professionBlurb  = "";
                    string professionTitle  = "";
                    bool   drawRed          = false;
                    int    professionNumber = -1;
                    switch (j)
                    {
                    case 0:
                        drawRed          = (Game1.player.FarmingLevel > i);
                        professionNumber = Game1.player.getProfessionForSkill(0, i + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 1:
                        drawRed          = (Game1.player.MiningLevel > i);
                        professionNumber = Game1.player.getProfessionForSkill(3, i + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 2:
                        drawRed          = (Game1.player.ForagingLevel > i);
                        professionNumber = Game1.player.getProfessionForSkill(2, i + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 3:
                        drawRed          = (Game1.player.FishingLevel > i);
                        professionNumber = Game1.player.getProfessionForSkill(1, i + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 4:
                        drawRed          = (Game1.player.CombatLevel > i);
                        professionNumber = Game1.player.getProfessionForSkill(4, i + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;

                    case 5:
                        drawRed          = (Game1.player.LuckLevel > i);
                        professionNumber = Game1.player.getProfessionForSkill(5, i + 1);
                        this.parseProfessionDescription(ref professionBlurb, ref professionTitle, LevelUpMenu.getProfessionDescription(professionNumber));
                        break;
                    }
                    if (drawRed && (i + 1) % 5 == 0)
                    {
                        this.skillBars.Add(new ClickableTextureComponent(string.Concat(professionNumber), new Rectangle(addedX + drawX - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom), drawY + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6), 14 * Game1.pixelZoom, 9 * Game1.pixelZoom), null, professionBlurb, Game1.mouseCursors, new Rectangle(159, 338, 14, 9), (float)Game1.pixelZoom, true));
                    }
                }
                addedX += Game1.pixelZoom * 6;
            }
            for (int k = 0; k < 5; k++)
            {
                int index = k;
                if (index == 1)
                {
                    index = 3;
                }
                else if (index == 3)
                {
                    index = 1;
                }
                string text = "";
                switch (index)
                {
                case 0:
                    if (Game1.player.FarmingLevel > 0)
                    {
                        text = string.Concat(new object[]
                        {
                            "+",
                            Game1.player.FarmingLevel,
                            " Hoe Efficiency",
                            Environment.NewLine,
                            "+",
                            Game1.player.FarmingLevel,
                            " Water Can Efficiency"
                        });
                    }
                    break;

                case 1:
                    if (Game1.player.FishingLevel > 0)
                    {
                        text = "+" + Game1.player.FishingLevel + " Fishing Rod Efficiency";
                    }
                    break;

                case 2:
                    if (Game1.player.ForagingLevel > 0)
                    {
                        text = "+" + Game1.player.ForagingLevel + " Axe Efficiency";
                    }
                    break;

                case 3:
                    if (Game1.player.MiningLevel > 0)
                    {
                        text = "+" + Game1.player.MiningLevel + " Pickaxe Efficiency";
                    }
                    break;

                case 4:
                    if (Game1.player.CombatLevel > 0)
                    {
                        text = "+" + Game1.player.CombatLevel * 5 + " Health";
                    }
                    break;
                }
                this.skillAreas.Add(new ClickableTextureComponent(string.Concat(index), new Rectangle(drawX - Game1.tileSize * 2 - Game1.tileSize * 3 / 4, drawY + k * (Game1.tileSize / 2 + Game1.pixelZoom * 6), Game1.tileSize * 2 + Game1.pixelZoom * 5, 9 * Game1.pixelZoom), string.Concat(index), text, null, Rectangle.Empty, 1f, false));
            }
        }
        // Token: 0x06000F1B RID: 3867 RVA: 0x001353E0 File Offset: 0x001335E0
        public override void update(GameTime time)
        {
            if (!this.isActive)
            {
                base.exitThisMenu(true);
                return;
            }
            for (int i = this.littleStars.Count - 1; i >= 0; i--)
            {
                if (this.littleStars[i].update(time))
                {
                    this.littleStars.RemoveAt(i);
                }
            }
            if (Game1.random.NextDouble() < 0.03)
            {
                Vector2 position = new Vector2(0f, (float)(Game1.random.Next(this.yPositionOnScreen - Game1.tileSize * 2, this.yPositionOnScreen - Game1.pixelZoom) / (Game1.pixelZoom * 5) * Game1.pixelZoom * 5 + Game1.tileSize / 2));
                if (Game1.random.NextDouble() < 0.5)
                {
                    position.X = (float)Game1.random.Next(this.xPositionOnScreen + this.width / 2 - 57 * Game1.pixelZoom, this.xPositionOnScreen + this.width / 2 - 33 * Game1.pixelZoom);
                }
                else
                {
                    position.X = (float)Game1.random.Next(this.xPositionOnScreen + this.width / 2 + 29 * Game1.pixelZoom, this.xPositionOnScreen + this.width - 40 * Game1.pixelZoom);
                }
                if (position.Y < (float)(this.yPositionOnScreen - Game1.tileSize - Game1.pixelZoom * 2))
                {
                    position.X = (float)Game1.random.Next(this.xPositionOnScreen + this.width / 2 - 29 * Game1.pixelZoom, this.xPositionOnScreen + this.width / 2 + 29 * Game1.pixelZoom);
                }
                position.X = position.X / (float)(Game1.pixelZoom * 5) * (float)Game1.pixelZoom * 5f;
                this.littleStars.Add(new TemporaryAnimatedSprite(Game1.mouseCursors, new Rectangle(364, 79, 5, 5), 80f, 7, 1, position, false, false, 1f, 0f, Color.White, (float)Game1.pixelZoom, 0f, 0f, 0f, false)
                {
                    local = true
                });
            }
            if (this.timerBeforeStart > 0)
            {
                this.timerBeforeStart -= time.ElapsedGameTime.Milliseconds;
                return;
            }
            if (this.isActive && this.isProfessionChooser)
            {
                this.leftProfessionColor  = Game1.textColor;
                this.rightProfessionColor = Game1.textColor;
                Game1.player.completelyStopAnimatingOrDoingAction();
                Game1.player.freezePause = 100;
                if (Game1.getMouseY() > this.yPositionOnScreen + Game1.tileSize * 3 && Game1.getMouseY() < this.yPositionOnScreen + this.height)
                {
                    if (Game1.getMouseX() > this.xPositionOnScreen && Game1.getMouseX() < this.xPositionOnScreen + this.width / 2)
                    {
                        this.leftProfessionColor = Color.Green;
                        if (((Mouse.GetState().LeftButton == ButtonState.Pressed && this.oldMouseState.LeftButton == ButtonState.Released) || (Game1.options.gamepadControls && GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.A) && !Game1.oldPadState.IsButtonDown(Buttons.A))) && this.readyToClose())
                        {
                            Game1.player.professions.Add(this.professionsToChoose[0]);
                            this.getImmediateProfessionPerk(this.professionsToChoose[0]);
                            this.isActive            = false;
                            this.informationUp       = false;
                            this.isProfessionChooser = false;
                        }
                    }
                    else if (Game1.getMouseX() > this.xPositionOnScreen + this.width / 2 && Game1.getMouseX() < this.xPositionOnScreen + this.width)
                    {
                        this.rightProfessionColor = Color.Green;
                        if (((Mouse.GetState().LeftButton == ButtonState.Pressed && this.oldMouseState.LeftButton == ButtonState.Released) || (Game1.options.gamepadControls && GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.A) && !Game1.oldPadState.IsButtonDown(Buttons.A))) && this.readyToClose())
                        {
                            Game1.player.professions.Add(this.professionsToChoose[1]);
                            this.getImmediateProfessionPerk(this.professionsToChoose[1]);
                            this.isActive            = false;
                            this.informationUp       = false;
                            this.isProfessionChooser = false;
                        }
                    }
                }
                this.height = Game1.tileSize * 8;
            }
            this.oldMouseState = Mouse.GetState();
            if (this.isActive && !this.informationUp && this.starIcon != null)
            {
                if (this.starIcon.containsPoint(Game1.getOldMouseX(), Game1.getOldMouseY()))
                {
                    this.starIcon.sourceRect.X = 294;
                }
                else
                {
                    this.starIcon.sourceRect.X = 310;
                }
            }
            if (this.isActive && this.starIcon != null && !this.informationUp && (this.oldMouseState.LeftButton == ButtonState.Pressed || (Game1.options.gamepadControls && Game1.oldPadState.IsButtonDown(Buttons.A))) && this.starIcon.containsPoint(this.oldMouseState.X, this.oldMouseState.Y))
            {
                this.newCraftingRecipes.Clear();
                this.extraInfoForLevel.Clear();
                Game1.player.completelyStopAnimatingOrDoingAction();
                Game1.playSound("bigSelect");
                this.informationUp       = true;
                this.isProfessionChooser = false;
                this.currentLevel        = Game1.player.newLevels.First <Point>().Y;
                this.currentSkill        = Game1.player.newLevels.First <Point>().X;
                this.title = Game1.content.LoadString("Strings\\UI:LevelUp_Title", new object[]
                {
                    this.currentLevel,
                    Farmer.getSkillNameFromIndex(this.currentSkill)
                });
                this.extraInfoForLevel = this.getExtraInfoForLevel(this.currentSkill, this.currentLevel);
                switch (this.currentSkill)
                {
                case 0:
                    this.sourceRectForLevelIcon = new Rectangle(0, 0, 16, 16);
                    break;

                case 1:
                    this.sourceRectForLevelIcon = new Rectangle(16, 0, 16, 16);
                    break;

                case 2:
                    this.sourceRectForLevelIcon = new Rectangle(80, 0, 16, 16);
                    break;

                case 3:
                    this.sourceRectForLevelIcon = new Rectangle(32, 0, 16, 16);
                    break;

                case 4:
                    this.sourceRectForLevelIcon = new Rectangle(128, 16, 16, 16);
                    break;

                case 5:
                    this.sourceRectForLevelIcon = new Rectangle(64, 0, 16, 16);
                    break;
                }
                if ((this.currentLevel == 5 || this.currentLevel == 10) && this.currentSkill != 5)
                {
                    this.professionsToChoose.Clear();
                    this.isProfessionChooser = true;
                    if (this.currentLevel == 5)
                    {
                        this.professionsToChoose.Add(this.currentSkill * 6);
                        this.professionsToChoose.Add(this.currentSkill * 6 + 1);
                    }
                    else if (Game1.player.professions.Contains(this.currentSkill * 6))
                    {
                        this.professionsToChoose.Add(this.currentSkill * 6 + 2);
                        this.professionsToChoose.Add(this.currentSkill * 6 + 3);
                    }
                    else
                    {
                        this.professionsToChoose.Add(this.currentSkill * 6 + 4);
                        this.professionsToChoose.Add(this.currentSkill * 6 + 5);
                    }
                    this.leftProfessionDescription  = LevelUpMenu.getProfessionDescription(this.professionsToChoose[0]);
                    this.rightProfessionDescription = LevelUpMenu.getProfessionDescription(this.professionsToChoose[1]);
                }
                int newHeight = 0;
                foreach (KeyValuePair <string, string> v in CraftingRecipe.craftingRecipes)
                {
                    string conditions = v.Value.Split(new char[]
                    {
                        '/'
                    })[4];
                    if (conditions.Contains(Farmer.getSkillNameFromIndex(this.currentSkill)) && conditions.Contains(string.Concat(this.currentLevel)))
                    {
                        this.newCraftingRecipes.Add(new CraftingRecipe(v.Key, false));
                        if (!Game1.player.craftingRecipes.ContainsKey(v.Key))
                        {
                            Game1.player.craftingRecipes.Add(v.Key, 0);
                        }
                        newHeight += (this.newCraftingRecipes.Last <CraftingRecipe>().bigCraftable ? (Game1.tileSize * 2) : Game1.tileSize);
                    }
                }
                foreach (KeyValuePair <string, string> v2 in CraftingRecipe.cookingRecipes)
                {
                    string conditions2 = v2.Value.Split(new char[]
                    {
                        '/'
                    })[3];
                    if (conditions2.Contains(Farmer.getSkillNameFromIndex(this.currentSkill)) && conditions2.Contains(string.Concat(this.currentLevel)))
                    {
                        this.newCraftingRecipes.Add(new CraftingRecipe(v2.Key, true));
                        if (!Game1.player.cookingRecipes.ContainsKey(v2.Key))
                        {
                            Game1.player.cookingRecipes.Add(v2.Key, 0);
                        }
                        newHeight += (this.newCraftingRecipes.Last <CraftingRecipe>().bigCraftable ? (Game1.tileSize * 2) : Game1.tileSize);
                    }
                }
                this.height = newHeight + Game1.tileSize * 4 + this.extraInfoForLevel.Count * Game1.tileSize * 3 / 4;
                Game1.player.freezePause = 100;
            }
            if (this.isActive && this.informationUp)
            {
                Game1.player.completelyStopAnimatingOrDoingAction();
                if (this.okButton.containsPoint(Game1.getOldMouseX(), Game1.getOldMouseY()) && !this.isProfessionChooser)
                {
                    this.okButton.scale = Math.Min(1.1f, this.okButton.scale + 0.05f);
                    if ((this.oldMouseState.LeftButton == ButtonState.Pressed || (Game1.options.gamepadControls && Game1.oldPadState.IsButtonDown(Buttons.A))) && this.readyToClose())
                    {
                        this.getLevelPerk(this.currentSkill, this.currentLevel);
                        this.isActive      = false;
                        this.informationUp = false;
                    }
                }
                else
                {
                    this.okButton.scale = Math.Max(1f, this.okButton.scale - 0.05f);
                }
                Game1.player.freezePause = 100;
            }
        }
        // Token: 0x06000F10 RID: 3856 RVA: 0x001349F8 File Offset: 0x00132BF8
        public LevelUpMenu(int skill, int level) : base(Game1.viewport.Width / 2 - 384, Game1.viewport.Height / 2 - 256, 768, 512, false)
        {
            this.timerBeforeStart = 250;
            this.isActive         = true;
            this.width            = Game1.tileSize * 12;
            this.height           = Game1.tileSize * 8;
            this.okButton         = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width + 4, this.yPositionOnScreen + this.height - Game1.tileSize - IClickableMenu.borderWidth, Game1.tileSize, Game1.tileSize), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
            this.newCraftingRecipes.Clear();
            this.extraInfoForLevel.Clear();
            Game1.player.completelyStopAnimatingOrDoingAction();
            this.informationUp       = true;
            this.isProfessionChooser = false;
            this.currentLevel        = level;
            this.currentSkill        = skill;
            if (level == 10)
            {
                Game1.getSteamAchievement("Achievement_SingularTalent");
                if (Game1.player.farmingLevel == 10 && Game1.player.miningLevel == 10 && Game1.player.fishingLevel == 10 && Game1.player.foragingLevel == 10 && Game1.player.combatLevel == 10)
                {
                    Game1.getSteamAchievement("Achievement_MasterOfTheFiveWays");
                }
            }
            this.title = Game1.content.LoadString("Strings\\UI:LevelUp_Title", new object[]
            {
                this.currentLevel,
                Farmer.getSkillNameFromIndex(this.currentSkill)
            });
            this.extraInfoForLevel = this.getExtraInfoForLevel(this.currentSkill, this.currentLevel);
            switch (this.currentSkill)
            {
            case 0:
                this.sourceRectForLevelIcon = new Rectangle(0, 0, 16, 16);
                break;

            case 1:
                this.sourceRectForLevelIcon = new Rectangle(16, 0, 16, 16);
                break;

            case 2:
                this.sourceRectForLevelIcon = new Rectangle(80, 0, 16, 16);
                break;

            case 3:
                this.sourceRectForLevelIcon = new Rectangle(32, 0, 16, 16);
                break;

            case 4:
                this.sourceRectForLevelIcon = new Rectangle(128, 16, 16, 16);
                break;

            case 5:
                this.sourceRectForLevelIcon = new Rectangle(64, 0, 16, 16);
                break;
            }
            if ((this.currentLevel == 5 || this.currentLevel == 10) && this.currentSkill != 5)
            {
                this.professionsToChoose.Clear();
                this.isProfessionChooser = true;
                if (this.currentLevel == 5)
                {
                    this.professionsToChoose.Add(this.currentSkill * 6);
                    this.professionsToChoose.Add(this.currentSkill * 6 + 1);
                }
                else if (Game1.player.professions.Contains(this.currentSkill * 6))
                {
                    this.professionsToChoose.Add(this.currentSkill * 6 + 2);
                    this.professionsToChoose.Add(this.currentSkill * 6 + 3);
                }
                else
                {
                    this.professionsToChoose.Add(this.currentSkill * 6 + 4);
                    this.professionsToChoose.Add(this.currentSkill * 6 + 5);
                }
                this.leftProfessionDescription  = LevelUpMenu.getProfessionDescription(this.professionsToChoose[0]);
                this.rightProfessionDescription = LevelUpMenu.getProfessionDescription(this.professionsToChoose[1]);
            }
            int newHeight = 0;

            foreach (KeyValuePair <string, string> v in CraftingRecipe.craftingRecipes)
            {
                string conditions = v.Value.Split(new char[]
                {
                    '/'
                })[4];
                if (conditions.Contains(Farmer.getSkillNameFromIndex(this.currentSkill)) && conditions.Contains(string.Concat(this.currentLevel)))
                {
                    this.newCraftingRecipes.Add(new CraftingRecipe(v.Key, false));
                    if (!Game1.player.craftingRecipes.ContainsKey(v.Key))
                    {
                        Game1.player.craftingRecipes.Add(v.Key, 0);
                    }
                    newHeight += (this.newCraftingRecipes.Last <CraftingRecipe>().bigCraftable ? (Game1.tileSize * 2) : Game1.tileSize);
                }
            }
            foreach (KeyValuePair <string, string> v2 in CraftingRecipe.cookingRecipes)
            {
                string conditions2 = v2.Value.Split(new char[]
                {
                    '/'
                })[3];
                if (conditions2.Contains(Farmer.getSkillNameFromIndex(this.currentSkill)) && conditions2.Contains(string.Concat(this.currentLevel)))
                {
                    this.newCraftingRecipes.Add(new CraftingRecipe(v2.Key, true));
                    if (!Game1.player.cookingRecipes.ContainsKey(v2.Key))
                    {
                        Game1.player.cookingRecipes.Add(v2.Key, 0);
                        if (!Game1.player.hasOrWillReceiveMail("robinKitchenLetter"))
                        {
                            Game1.mailbox.Enqueue("robinKitchenLetter");
                        }
                    }
                    newHeight += (this.newCraftingRecipes.Last <CraftingRecipe>().bigCraftable ? (Game1.tileSize * 2) : Game1.tileSize);
                }
            }
            this.height = newHeight + Game1.tileSize * 4 + this.extraInfoForLevel.Count * Game1.tileSize * 3 / 4;
            Game1.player.freezePause = 100;
            this.gameWindowSizeChanged(Rectangle.Empty, Rectangle.Empty);
        }
Esempio n. 6
0
        public SkillsPage(int x, int y, int width, int height) : base(x, y, width, height, false)
        {
            int num = this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 5 / 4;
            int y2  = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)height / 2f) + Game1.tileSize * 5 / 4;

            this.playerPanel = new Rectangle(this.xPositionOnScreen + Game1.tileSize, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder, Game1.tileSize * 2, Game1.tileSize * 3);
            if (Game1.player.canUnderstandDwarves)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num, y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11587", new object[0]), Game1.mouseCursors, new Rectangle(129, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID            = 10201,
                    rightNeighborID = 10202,
                    upNeighborID    = 4
                });
            }
            if (Game1.player.hasRustyKey)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num + (Game1.tileSize + Game1.pixelZoom), y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11588", new object[0]), Game1.mouseCursors, new Rectangle(145, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID            = 10202,
                    rightNeighborID = 10203,
                    leftNeighborID  = 10201,
                    upNeighborID    = 4
                });
            }
            if (Game1.player.hasClubCard)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num + 2 * (Game1.tileSize + Game1.pixelZoom), y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11589", new object[0]), Game1.mouseCursors, new Rectangle(161, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID            = 10203,
                    rightNeighborID = 10204,
                    leftNeighborID  = 10202,
                    upNeighborID    = 4
                });
            }
            if (Game1.player.hasSpecialCharm)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num + 3 * (Game1.tileSize + Game1.pixelZoom), y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11590", new object[0]), Game1.mouseCursors, new Rectangle(177, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID            = 10204,
                    rightNeighborID = 10205,
                    leftNeighborID  = 10203,
                    upNeighborID    = 4
                });
            }
            if (Game1.player.hasSkullKey)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num + 4 * (Game1.tileSize + Game1.pixelZoom), y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11591", new object[0]), Game1.mouseCursors, new Rectangle(193, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID            = 10205,
                    rightNeighborID = 10206,
                    leftNeighborID  = 10204,
                    upNeighborID    = 4
                });
            }
            if (Game1.player.hasDarkTalisman)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num + 5 * (Game1.tileSize + Game1.pixelZoom), y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\Objects:DarkTalisman", new object[0]), Game1.mouseCursors, new Rectangle(225, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID            = 10206,
                    rightNeighborID = 10207,
                    leftNeighborID  = 10205,
                    upNeighborID    = 4
                });
            }
            if (Game1.player.hasMagicInk)
            {
                this.specialItems.Add(new ClickableTextureComponent("", new Rectangle(num + 6 * (Game1.tileSize + Game1.pixelZoom), y2, Game1.tileSize, Game1.tileSize), null, Game1.content.LoadString("Strings\\Objects:MagicInk", new object[0]), Game1.mouseCursors, new Rectangle(241, 320, 16, 16), (float)Game1.pixelZoom, true)
                {
                    myID           = 10207,
                    leftNeighborID = 10206,
                    upNeighborID   = 4
                });
            }
            int num2 = 0;
            int num3 = (LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru) ? (this.xPositionOnScreen + width - Game1.tileSize * 7 - Game1.tileSize * 3 / 4 + Game1.pixelZoom) : (this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - Game1.pixelZoom);
            int num4 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 3;

            for (int i = 4; i < 10; i += 5)
            {
                for (int j = 0; j < 5; j++)
                {
                    string text  = "";
                    string text2 = "";
                    bool   flag  = false;
                    int    num5  = -1;
                    switch (j)
                    {
                    case 0:
                        flag = (Game1.player.FarmingLevel > i);
                        num5 = Game1.player.getProfessionForSkill(0, i + 1);
                        this.parseProfessionDescription(ref text, ref text2, LevelUpMenu.getProfessionDescription(num5));
                        break;

                    case 1:
                        flag = (Game1.player.MiningLevel > i);
                        num5 = Game1.player.getProfessionForSkill(3, i + 1);
                        this.parseProfessionDescription(ref text, ref text2, LevelUpMenu.getProfessionDescription(num5));
                        break;

                    case 2:
                        flag = (Game1.player.ForagingLevel > i);
                        num5 = Game1.player.getProfessionForSkill(2, i + 1);
                        this.parseProfessionDescription(ref text, ref text2, LevelUpMenu.getProfessionDescription(num5));
                        break;

                    case 3:
                        flag = (Game1.player.FishingLevel > i);
                        num5 = Game1.player.getProfessionForSkill(1, i + 1);
                        this.parseProfessionDescription(ref text, ref text2, LevelUpMenu.getProfessionDescription(num5));
                        break;

                    case 4:
                        flag = (Game1.player.CombatLevel > i);
                        num5 = Game1.player.getProfessionForSkill(4, i + 1);
                        this.parseProfessionDescription(ref text, ref text2, LevelUpMenu.getProfessionDescription(num5));
                        break;

                    case 5:
                        flag = (Game1.player.LuckLevel > i);
                        num5 = Game1.player.getProfessionForSkill(5, i + 1);
                        this.parseProfessionDescription(ref text, ref text2, LevelUpMenu.getProfessionDescription(num5));
                        break;
                    }
                    if (flag && (i + 1) % 5 == 0)
                    {
                        this.skillBars.Add(new ClickableTextureComponent(string.Concat(num5), new Rectangle(num2 + num3 - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom), num4 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6), 14 * Game1.pixelZoom, 9 * Game1.pixelZoom), null, text, Game1.mouseCursors, new Rectangle(159, 338, 14, 9), (float)Game1.pixelZoom, true)
                        {
                            myID            = ((i + 1 == 5) ? (100 + j) : (200 + j)),
                            leftNeighborID  = ((i + 1 == 5) ? j : (100 + j)),
                            rightNeighborID = ((i + 1 == 5) ? (200 + j) : -1),
                            downNeighborID  = 10201
                        });
                    }
                }
                num2 += Game1.pixelZoom * 6;
            }
            for (int k = 0; k < this.skillBars.Count; k++)
            {
                if (k < this.skillBars.Count - 1 && Math.Abs(this.skillBars[k + 1].myID - this.skillBars[k].myID) < 50)
                {
                    this.skillBars[k].downNeighborID   = this.skillBars[k + 1].myID;
                    this.skillBars[k + 1].upNeighborID = this.skillBars[k].myID;
                }
            }
            if (this.skillBars.Count > 1 && this.skillBars.Last <ClickableTextureComponent>().myID >= 200 && this.skillBars[this.skillBars.Count - 2].myID >= 200)
            {
                this.skillBars.Last <ClickableTextureComponent>().upNeighborID = this.skillBars[this.skillBars.Count - 2].myID;
            }
            for (int l = 0; l < 5; l++)
            {
                int num6 = l;
                if (num6 == 1)
                {
                    num6 = 3;
                }
                else if (num6 == 3)
                {
                    num6 = 1;
                }
                string text3 = "";
                switch (num6)
                {
                case 0:
                    if (Game1.player.FarmingLevel > 0)
                    {
                        text3 = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11592", new object[]
                        {
                            Game1.player.FarmingLevel
                        }) + Environment.NewLine + Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11594", new object[]
                        {
                            Game1.player.FarmingLevel
                        });
                    }
                    break;

                case 1:
                    if (Game1.player.FishingLevel > 0)
                    {
                        text3 = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11598", new object[]
                        {
                            Game1.player.FishingLevel
                        });
                    }
                    break;

                case 2:
                    if (Game1.player.ForagingLevel > 0)
                    {
                        text3 = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11596", new object[]
                        {
                            Game1.player.ForagingLevel
                        });
                    }
                    break;

                case 3:
                    if (Game1.player.MiningLevel > 0)
                    {
                        text3 = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11600", new object[]
                        {
                            Game1.player.MiningLevel
                        });
                    }
                    break;

                case 4:
                    if (Game1.player.CombatLevel > 0)
                    {
                        text3 = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11602", new object[]
                        {
                            Game1.player.CombatLevel * 5
                        });
                    }
                    break;
                }
                this.skillAreas.Add(new ClickableTextureComponent(string.Concat(num6), new Rectangle(num3 - Game1.tileSize * 2 - Game1.tileSize * 3 / 4, num4 + l * (Game1.tileSize / 2 + Game1.pixelZoom * 6), Game1.tileSize * 2 + Game1.pixelZoom * 5, 9 * Game1.pixelZoom), string.Concat(num6), text3, null, Rectangle.Empty, 1f, false)
                {
                    myID            = l,
                    downNeighborID  = ((l < 4) ? (l + 1) : 10201),
                    upNeighborID    = ((l > 0) ? (l - 1) : 12341),
                    rightNeighborID = 100 + l
                });
            }
        }