Пример #1
0
        public static List <string> getProfessionDescription(int whichProfession)
        {
            List <string> descriptions   = new List <string>();
            string        professionName = AlchemyLevelUpMenu.GetProfessionName(whichProfession);

            descriptions.Add(professionName);
            descriptions.Add(AlchemyLevelUpMenu.GetProfessionDescription(whichProfession));
            return(descriptions);
        }
Пример #2
0
        static string getProfessionTitleFromNumber(int whichProfession)
        {
            string s = Professions.GetProfessionTitleFromNumber(whichProfession);

            if (s == null)
            {
                return(AlchemyLevelUpMenu.getProfessionTitleFromNumber(whichProfession));
            }
            return(s);
        }
Пример #3
0
        public AlchemySkillsPage(int x, int y, int width, int height, int skillOrderIndex)
            : base(x, y, width, height, false)
        {
            this.skillOrderIndex = skillOrderIndex;
            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);

            int num5       = 0;
            int xStart     = 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 yStart     = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 3;
            int skillIndex = 4;

            while (skillIndex < 10)
            {
                int    whichProfession = Professions.getProfessionForSkill(skillIndex + 1);
                string professionBlurb = Professions.GetProfessionTitleFromNumber(whichProfession);
                string professionTitle = AlchemyLevelUpMenu.GetProfessionDescription(whichProfession);
                bool   flag            = EquivalentExchange.instance.currentPlayerData.AlchemyLevel > skillIndex;

                if (flag && (skillIndex + 1) % 5 == 0)
                {
                    List <ClickableTextureComponent> skillBars             = this.skillBars;
                    ClickableTextureComponent        skillTextureComponent = new ClickableTextureComponent(string.Concat(whichProfession), new Rectangle(num5 + xStart - Game1.pixelZoom + skillIndex * (Game1.tileSize / 2 + Game1.pixelZoom), yStart + skillOrderIndex * (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);
                    skillBars.Add(skillTextureComponent);
                }
                skillIndex += 5;
            }
            num5 += Game1.pixelZoom * 6;

            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;
            }

            string hoverText = "";
            List <ClickableTextureComponent> skillAreas       = this.skillAreas;
            ClickableTextureComponent        textureComponent = new ClickableTextureComponent("Alchemy", new Rectangle(xStart - Game1.tileSize * 2 - Game1.tileSize * 3 / 4, yStart + skillOrderIndex * (Game1.tileSize / 2 + Game1.pixelZoom * 6), Game1.tileSize * 2 + Game1.pixelZoom * 5, 9 * Game1.pixelZoom), string.Concat((object)skillOrderIndex), hoverText, (Texture2D)null, Rectangle.Empty, 1f, false);
            int num2 = skillOrderIndex;

            textureComponent.myID = num2;
            int num3 = skillOrderIndex < 4 ? skillOrderIndex + 1 : 10201;

            textureComponent.downNeighborID = num3;
            int num4 = skillOrderIndex > 0 ? skillOrderIndex - 1 : 12341;

            textureComponent.upNeighborID = num4;
            int num9 = 100 + skillOrderIndex;

            textureComponent.rightNeighborID = num9;
            skillAreas.Add(textureComponent);
        }
Пример #4
0
        public AlchemyLevelUpMenu(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.title = string.Concat(new object[]
            {
                "Level ",
                this.currentLevel,
                " Alchemy"
            });

            this.extraInfoForLevel = this.GetExtraInfoForLevel(this.currentLevel, Game1.player.luckLevel);
            sourceRectForLevelIcon = new Rectangle(0, 0, 16, 16);
            if (this.currentLevel > 0 && this.currentLevel % 5 == 0)
            {
                this.professionsToChoose.Clear();
                this.isProfessionChooser = true;
                if (this.currentLevel == 5)
                {
                    this.professionsToChoose.Add(Professions.Shaper);
                    this.professionsToChoose.Add(Professions.Sage);
                }
                else if (Game1.player.professions.Contains(Professions.Shaper))
                {
                    this.professionsToChoose.Add(Professions.Transmuter);
                    this.professionsToChoose.Add(Professions.Adept);
                }
                else
                {
                    this.professionsToChoose.Add(Professions.Aurumancer);
                    this.professionsToChoose.Add(Professions.Conduit);
                }
                this.leftProfessionDescription  = AlchemyLevelUpMenu.getProfessionDescription(this.professionsToChoose[0]);
                this.rightProfessionDescription = AlchemyLevelUpMenu.getProfessionDescription(this.professionsToChoose[1]);
            }
            int num = 0;

            this.height = num + Game1.tileSize * 4 + this.extraInfoForLevel.Count <string>() * Game1.tileSize * 3 / 4;
            Game1.player.freezePause = 100;
            this.gameWindowSizeChanged(Rectangle.Empty, Rectangle.Empty);
        }
Пример #5
0
 public override void performHoverAction(int x, int y)
 {
     this.hoverText       = "";
     this.hoverTitle      = "";
     this.professionImage = null;
     foreach (ClickableTextureComponent skillBar in this.skillBars)
     {
         skillBar.scale = (float)Game1.pixelZoom;
         if (skillBar.containsPoint(x, y) && skillBar.hoverText.Length > 0 && !skillBar.name.Equals("-1"))
         {
             this.hoverText       = AlchemyLevelUpMenu.GetProfessionDescription(Convert.ToInt32(skillBar.name));
             this.hoverTitle      = Professions.GetProfessionTitleFromNumber(Convert.ToInt32(skillBar.name));
             this.professionImage = DrawingUtil.GetProfessionTexture(Convert.ToInt32(skillBar.name));
             skillBar.scale       = 0.0f;
         }
     }
     foreach (ClickableTextureComponent skillArea in this.skillAreas)
     {
         if (skillArea.containsPoint(x, y) && skillArea.hoverText.Length > 0)
         {
             this.hoverText  = skillArea.hoverText;
             this.hoverTitle = skillArea.name;
             break;
         }
     }
     if (this.playerPanel.Contains(x, y))
     {
         this.playerPanelTimer = this.playerPanelTimer - Game1.currentGameTime.ElapsedGameTime.Milliseconds;
         if (this.playerPanelTimer > 0)
         {
             return;
         }
         this.playerPanelIndex = (this.playerPanelIndex + 1) % 4;
         this.playerPanelTimer = 150;
     }
     else
     {
         this.playerPanelIndex = 0;
     }
 }