private void drawLuckSkill(SkillsPage skills) { SpriteBatch b = Game1.spriteBatch; int j = 5; int num; int num2; num = skills.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - 8; num2 = skills.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 2; int num3 = 0; for (int i = 0; i < 10; i++) { bool flag = false; bool flag2 = false; string text = ""; int num4 = 0; Rectangle empty = Rectangle.Empty; flag = (Game1.player.LuckLevel > i); if (i == 0) { text = "Luck"; } num4 = Game1.player.LuckLevel; flag2 = (Game1.player.addedLuckLevel.Value > 0); empty = new Rectangle(50, 428, 10, 10); if (!text.Equals("")) { b.DrawString(Game1.smallFont, text, new Vector2((float)num - Game1.smallFont.MeasureString(text).X - (float)(Game1.pixelZoom * 4) - (float)Game1.tileSize, (float)(num2 + Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Game1.textColor); b.Draw(Game1.mouseCursors, new Vector2((float)(num - Game1.pixelZoom * 16), (float)(num2 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(empty), Color.Black * 0.3f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num - Game1.pixelZoom * 15), (float)(num2 - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(empty), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (!flag && (i + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145 + (flag ? 14 : 0), 338, 14, 9)), Color.White * (flag ? 1f : 0.65f), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } else if ((i + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129 + (flag ? 8 : 0), 338, 8, 9)), Color.White * (flag ? 1f : 0.65f), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (i == 9) { NumberSprite.draw(num4, b, new Vector2((float)(num3 + num + (i + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 3 + ((num4 >= 10) ? (Game1.pixelZoom * 3) : 0)), (float)(num2 + Game1.pixelZoom * 4 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(num4, b, new Vector2((float)(num3 + num + (i + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 4 + ((num4 >= 10) ? (Game1.pixelZoom * 3) : 0)), (float)(num2 + Game1.pixelZoom * 3 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), (flag2 ? Color.LightGreen : Color.SandyBrown) * ((num4 == 0) ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } if ((i + 1) % 5 == 0) { num3 += Game1.pixelZoom * 6; } } skills.drawMouse(b); }
private void DrawLevelTenProfessionCost(SpriteBatch spriteBatch) { var firstRowBottomLocation = _professionButtonRowStartLocation.Y + GetRowHeight <TierOneProfession>(); var costTextLocation = new Vector2(_professionButtonRowStartLocation.X, firstRowBottomLocation + CostTextYOffset <TierTwoProfession>() + _rowPadding); spriteBatch.DrawString(Game1.dialogueFont, CostText, costTextLocation, Game1.textColor); var pointNumberLocation = new Vector2(costTextLocation.X + Game1.dialogueFont.MeasureString(CostText).X + (NumberSprite.getWidth(PerSaveOptions.Instance.CostOfTierTwoPrestige) * 3.0).Ceiling(), costTextLocation.Y + Game1.pixelZoom * 5); NumberSprite.draw(PerSaveOptions.Instance.CostOfTierTwoPrestige, spriteBatch, pointNumberLocation, Color.SandyBrown, 1f, .85f, 1f, 0); }
private void DrawPrestigePoints(SpriteBatch spriteBatch) { const string pointText = "Prestige Points:"; var yOffset = 5 * Game1.pixelZoom; var textLocation = new Vector2(xPositionOnScreen + spaceToClearSideBorder / 2 + borderWidth, yPositionOnScreen + yOffset + (int)Math.Floor(Game1.tileSize * 3.15)); spriteBatch.DrawString(Game1.dialogueFont, pointText, textLocation, Game1.textColor); var pointNumberLocation = new Vector2(textLocation.X + Game1.dialogueFont.MeasureString(pointText).X + (int)Math.Floor(Game1.pixelZoom * 4.25) + NumberSprite.getWidth(_prestige.PrestigePoints), textLocation.Y + Game1.pixelZoom * 5); NumberSprite.draw(_prestige.PrestigePoints, spriteBatch, pointNumberLocation, Color.SandyBrown, 1f, .85f, 1f, 0); _professionButtonRowStartLocation = new Vector2(textLocation.X, textLocation.Y + Game1.dialogueFont.MeasureString(pointText).Y + _rowPadding); }
public override void draw(SpriteBatch b) { b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f); Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen - 64 + 8, width + 21, height + 64, speaker: false, drawOnlyBox: true); foreach (ClickableComponent c in elevators) { b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 4, c.bounds.Y + 4), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f); b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X, c.bounds.Y), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f); NumberSprite.draw(position: new Vector2(c.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(c.name)) * 6, c.bounds.Y + 24 - NumberSprite.getHeight() / 4), number: Convert.ToInt32(c.name), b: b, c: (Game1.CurrentMineLevel == Convert.ToInt32(c.name)) ? (Color.Gray * 0.75f) : Color.Gold, scale: 0.5f, layerDepth: 0.86f, alpha: 1f, secondDigitOffset: 0); } drawMouse(b); base.draw(b); }
// Token: 0x06000F4B RID: 3915 RVA: 0x0013AFFC File Offset: 0x001391FC public override void draw(SpriteBatch b) { b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f); Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen - Game1.tileSize + Game1.tileSize / 8, this.width + Game1.tileSize / 3, this.height + Game1.tileSize, false, true, null, false); foreach (ClickableComponent c in this.elevators) { b.Draw(Game1.mouseCursors, new Vector2((float)(c.bounds.X - Game1.pixelZoom), (float)(c.bounds.Y + Game1.pixelZoom)), new Rectangle?(new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10)), Color.Black * 0.5f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.865f); b.Draw(Game1.mouseCursors, new Vector2((float)c.bounds.X, (float)c.bounds.Y), new Rectangle?(new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10)), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.868f); Vector2 textPosition = new Vector2((float)(c.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(c.name)) * 6), (float)(c.bounds.Y + Game1.pixelZoom * 6 - NumberSprite.getHeight() / 4)); NumberSprite.draw(Convert.ToInt32(c.name), b, textPosition, ((Game1.mine.mineLevel == Convert.ToInt32(c.name) && Game1.currentLocation.Equals(Game1.mine)) || (Convert.ToInt32(c.name) == 0 && !Game1.currentLocation.Equals(Game1.mine))) ? (Color.Gray * 0.75f) : Color.Gold, 0.5f, 0.86f, 1f, 0, 0); } base.drawMouse(b); base.draw(b); }
private void DrawLevelFiveProfessionCost(SpriteBatch spriteBatch) { var costTextLocation = _professionButtonRowStartLocation; costTextLocation.Y += CostTextYOffset <TierOneProfession>(); spriteBatch.DrawString(Game1.dialogueFont, CostText, costTextLocation, Game1.textColor); var pointNumberLocation = new Vector2(costTextLocation.X + Game1.dialogueFont.MeasureString(CostText).X + (NumberSprite.getWidth(PerSaveOptions.Instance.CostOfTierOnePrestige) * 3.0).Ceiling(), costTextLocation.Y + Game1.pixelZoom * 5); NumberSprite.draw(PerSaveOptions.Instance.CostOfTierOnePrestige, spriteBatch, pointNumberLocation, Color.SandyBrown, 1f, .85f, 1f, 0); if (_leftProfessionStartingXLocation == 0) { _leftProfessionStartingXLocation = pointNumberLocation.X.Ceiling() + NumberSprite.digitWidth; } }
private static void drawElevator(SpriteBatch b, ClickableComponent elevator) { b.Draw(Game1.mouseCursors, new Vector2((elevator.bounds.X - 4), (elevator.bounds.Y + 4)), new Rectangle(elevator.scale > 1.0 ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f); b.Draw(Game1.mouseCursors, new Vector2(elevator.bounds.X, elevator.bounds.Y), new Rectangle(elevator.scale > 1.0f ? 267 : 256, 256, 10, 10), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f); int floor = Convert.ToInt32(elevator.name); Vector2 vector2 = new Vector2((elevator.bounds.X + 16 + NumberSprite.numberOfDigits(floor) * 6), (elevator.bounds.Y + 24 - NumberSprite.getHeight() / 4)); bool skull = ((Game1.CurrentMineLevel == floor + 120) && Game1.currentLocation.Equals(Game1.mine)) || (floor == 0 && Game1.currentLocation.Name == "SkullCave"); NumberSprite.draw(floor, b, vector2, skull? Color.Gray * 0.75f : Color.Gold, 0.5f, 0.86f, 1f, 0, 0); }
public override void Draw(SpriteBatch spriteBatch) { Vector2 location = new Vector2(Bounds.X, Bounds.Y); spriteBatch.DrawString(Game1.smallFont, Text, location, Game1.textColor); location.Y += Game1.smallFont.MeasureString(Text).Y + _linePadding; _minusButton.Draw(spriteBatch, Value == Minimum ? Color.Gray : Color.White); Vector2 numberLocation = location; int controlAreaWidth = _plusButton.Bounds.X + _plusButton.Bounds.Width - Bounds.X; numberLocation.X += controlAreaWidth / 2 + GetNumberXOffset(Value) / 2; numberLocation.Y += _linePadding; NumberSprite.draw(Value, spriteBatch, numberLocation, Color.SandyBrown, 1f, .85f, 1f, 0); _plusButton.Draw(spriteBatch, Value == Maximum ? Color.Gray : Color.White); }
public override void draw(SpriteBatch b) { Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black); b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f); Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen - 64 + 8, this.width + 21, this.height + 64, false, true, (string)null, false); foreach (ClickableComponent levelButton in this.levelButtons) { b.Draw(Game1.mouseCursors, new Vector2((float)(levelButton.bounds.X - 4), (float)(levelButton.bounds.Y + 4)), new Rectangle?(new Rectangle((double)levelButton.scale > 1.0 ? 267 : 256, 256, 10, 10)), Color.Black * 0.5f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f); b.Draw(Game1.mouseCursors, new Vector2((float)levelButton.bounds.X, (float)levelButton.bounds.Y), new Rectangle?(new Rectangle((double)levelButton.scale > 1.0 ? 267 : 256, 256, 10, 10)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f); Vector2 position = new Vector2((float)(levelButton.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(levelButton.name)) * 6), (float)(levelButton.bounds.Y + 24 - NumberSprite.getHeight() / 4)); NumberSprite.draw(Convert.ToInt32(levelButton.name), b, position, Game1.CurrentMineLevel == Convert.ToInt32(levelButton.name) ? Color.Gray * 0.75f : Color.Gold, 0.5f, 0.86f, 1f, 0, 0); } this.drawMouse(b); base.draw(b); }
public override void Draw(SpriteBatch spriteBatch) { var location = new Vector2(Bounds.X, Bounds.Y); spriteBatch.DrawString(Game1.smallFont, Text, location, Game1.textColor); location.Y += Game1.smallFont.MeasureString(Text).Y + _linePadding; _minusButton.Draw(spriteBatch, Value == Minimum ? Color.Gray : Color.White); var numberLocation = location; numberLocation.X += _minusButton.Bounds.Width * 3 + (int)Math.Ceiling(NumberSprite.getWidth(Value) * 1.5); numberLocation.Y += _linePadding; NumberSprite.draw(Value, spriteBatch, numberLocation, Color.SandyBrown, 1f, .85f, 1f, 0); _plusButton.Draw(spriteBatch, Value == Maximum ? Color.Gray : Color.White); }
private void DrawPrestigePoints(SpriteBatch spriteBatch) { const string pointText = "Prestige Points:"; var yOffset = 5 * Game1.pixelZoom; var yLocation = yPositionOnScreen + yOffset + (Game1.tileSize * 3.15).Floor(); var textLocation = new Vector2(xPositionOnScreen + spaceToClearSideBorder / 2 + borderWidth, yLocation); spriteBatch.DrawString(Game1.dialogueFont, pointText, textLocation, Game1.textColor); var xPadding = (Game1.pixelZoom * 4.25).Floor(); var prestigePointWidth = (NumberSprite.getWidth(PerSaveOptions.Instance.CostOfTierTwoPrestige) * 3.0).Ceiling(); var pointNumberLocation = new Vector2(textLocation.X + Game1.dialogueFont.MeasureString(pointText).X + xPadding + prestigePointWidth, textLocation.Y + Game1.pixelZoom * 5); NumberSprite.draw(_prestige.PrestigePoints, spriteBatch, pointNumberLocation, Color.SandyBrown, 1f, .85f, 1f, 0); _professionButtonRowStartLocation = new Vector2(textLocation.X, textLocation.Y + Game1.dialogueFont.MeasureString(pointText).Y + _rowPadding); _prestigePointBonusLocation = new Vector2(pointNumberLocation.X + prestigePointWidth + xPadding, yLocation); }
public override void draw(SpriteBatch b) { base.draw(b); foreach (ClickableComponent current in this.elevators) { int floor = Convert.ToInt32(current.name); Vector2 vector2 = new Vector2(current.bounds.X + 16 + NumberSprite.numberOfDigits(floor) * 6, current.bounds.Y + 24 - NumberSprite.getHeight() / 4); bool skull = ((Game1.CurrentMineLevel == floor + 120) && Game1.currentLocation.Equals(Game1.mine)) || (floor == 0 && Game1.currentLocation.Name == "SkullCave"); NumberSprite.draw(floor, b, vector2, skull ? Color.Gray * 0.75f : Color.Gold, 0.5f, 0.86f, 1f, 0, 0); } this.drawMouse(b); }
public static void renderSkillBar(int x, int y, Texture2D iconTex, Rectangle icon, int level, float progress, Color skillCol) { if (!show) { return; } if (Game1.activeClickableMenu != null || Game1.eventUp || !Context.IsPlayerFree) { return; } var b = Game1.spriteBatch; if (skillBg == null || skillFg == null) { setupExpBars(); } b.Draw(iconTex, new Rectangle(x, y, 32, 32), icon, Color.White); int extra = 0; if (level > 9) { extra += 16; } if (level > 99) { extra += 20; } NumberSprite.draw(level, b, new Vector2(x + 32 + 4 + 16 + extra, y + 16), Color.White, 0.75f, 0, 1, 0); if (progress < 0 || progress > 100) { return; } Rectangle barRect = new Rectangle(x + 32 + 4 + 32 + extra + 4, y + (32 - BAR_HEIGHT) / 2 - 1, BAR_WIDTH * 2, BAR_HEIGHT * 2); b.Draw(skillBg, barRect, new Rectangle(0, 0, BAR_WIDTH, BAR_HEIGHT), Color.White); barRect.Width = (int)(barRect.Width * progress); b.Draw(skillFg, barRect, new Rectangle(0, 0, barRect.Width / 2, BAR_HEIGHT), skillCol); }
public override void draw(SpriteBatch b) { base.draw(b); Game1.drawDialogueBox(calculatorX, calculatorY, calculatorWidth, calculatorHeight, speaker: false, drawOnlyBox: true); foreach (ClickableComponent c in digits) { if (c.name == clear) { b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 4, c.bounds.Y + 4), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f); b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X, c.bounds.Y), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.White * 0.6f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f); Vector2 textPosition = new Vector2(c.bounds.X + c.bounds.Width / 2 - SpriteText.getWidthOfString(c.name) / 2, c.bounds.Y + c.bounds.Height / 2 - SpriteText.getHeightOfString(c.name) / 2 - 4); SpriteText.drawString(b, c.name, (int)textPosition.X, (int)textPosition.Y); } else { b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 4, c.bounds.Y + 4), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f); b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X, c.bounds.Y), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f); NumberSprite.draw(position: new Vector2(c.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(c.name)) * 6, c.bounds.Y + 24 - NumberSprite.getHeight() / 4), number: Convert.ToInt32(c.name), b: b, c: Color.Gold, scale: 0.5f, layerDepth: 0.86f, alpha: 1f, secondDigitOffset: 0); } } drawMouse(b); }
public override void draw(SpriteBatch b) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, (string)null, false); int num1 = this.xPositionOnScreen + Game1.tileSize - Game1.pixelZoom * 3; int num2 = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder; b.Draw(Game1.timeOfDay >= 1900 ? Game1.nightbg : Game1.daybg, new Vector2((float)num1, (float)num2), Color.White); Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(Game1.player.bathingClothes ? 108 : this.playerPanelFrames[this.playerPanelIndex], 0, false, false, (AnimatedSprite.endOfAnimationBehavior)null, false), Game1.player.bathingClothes ? 108 : this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, Game1.player.bathingClothes ? 576 : 0, 16, 32), new Vector2((float)(num1 + Game1.tileSize / 2), (float)(num2 + Game1.tileSize / 2)), Vector2.Zero, 0.8f, 2, Color.White, 0.0f, 1f, Game1.player); if (Game1.timeOfDay >= 1900) { Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(this.playerPanelFrames[this.playerPanelIndex], 0, false, false, (AnimatedSprite.endOfAnimationBehavior)null, false), this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, 0, 16, 32), new Vector2((float)(num1 + Game1.tileSize / 2), (float)(num2 + Game1.tileSize / 2)), Vector2.Zero, 0.8f, 2, Color.DarkBlue * 0.3f, 0.0f, 1f, Game1.player); } b.DrawString(Game1.smallFont, Game1.player.name, new Vector2((float)(num1 + Game1.tileSize) - Game1.smallFont.MeasureString(Game1.player.name).X / 2f, (float)(num2 + 3 * Game1.tileSize + 4)), Game1.textColor); b.DrawString(Game1.smallFont, Game1.player.getTitle(), new Vector2((float)(num1 + Game1.tileSize) - Game1.smallFont.MeasureString(Game1.player.getTitle()).X / 2f, (float)(num2 + 4 * Game1.tileSize - Game1.tileSize / 2)), Game1.textColor); int num3 = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru ? this.xPositionOnScreen + this.width - Game1.tileSize * 7 - Game1.tileSize * 3 / 4 : this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - 8; int num4 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 2; int num5 = 0; for (int index1 = 0; index1 < 10; ++index1) { for (int index2 = 0; index2 < 5; ++index2) { bool flag1 = false; bool flag2 = false; string text = ""; int number = 0; Rectangle rectangle = Rectangle.Empty; switch (index2) { case 0: flag1 = Game1.player.FarmingLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11604"); } number = Game1.player.FarmingLevel; flag2 = Game1.player.addedFarmingLevel > 0; rectangle = new Rectangle(10, 428, 10, 10); break; case 1: flag1 = Game1.player.MiningLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11605"); } number = Game1.player.MiningLevel; flag2 = Game1.player.addedMiningLevel > 0; rectangle = new Rectangle(30, 428, 10, 10); break; case 2: flag1 = Game1.player.ForagingLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11606"); } number = Game1.player.ForagingLevel; flag2 = Game1.player.addedForagingLevel > 0; rectangle = new Rectangle(60, 428, 10, 10); break; case 3: flag1 = Game1.player.FishingLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11607"); } number = Game1.player.FishingLevel; flag2 = Game1.player.addedFishingLevel > 0; rectangle = new Rectangle(20, 428, 10, 10); break; case 4: flag1 = Game1.player.CombatLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11608"); } number = Game1.player.CombatLevel; flag2 = Game1.player.addedCombatLevel > 0; rectangle = new Rectangle(120, 428, 10, 10); break; case 5: flag1 = Game1.player.LuckLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11609"); } number = Game1.player.LuckLevel; flag2 = Game1.player.addedLuckLevel > 0; rectangle = new Rectangle(50, 428, 10, 10); break; } if (!text.Equals("")) { b.DrawString(Game1.smallFont, text, new Vector2((float)num3 - Game1.smallFont.MeasureString(text).X + (float)Game1.pixelZoom - (float)Game1.tileSize, (float)(num4 + Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Game1.textColor); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 - Game1.pixelZoom * 14), (float)(num4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(rectangle), Color.Black * 0.3f, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 - Game1.pixelZoom * 13), (float)(num4 - Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(rectangle), Color.White, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (!flag1 && (index1 + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - Game1.pixelZoom + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 - Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145 + (flag1 ? 14 : 0), 338, 14, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } else if ((index1 + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - Game1.pixelZoom + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 - Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129 + (flag1 ? 8 : 0), 338, 8, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (index1 == 9) { NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 3 + (number >= 10 ? Game1.pixelZoom * 3 : 0)), (float)(num4 + Game1.pixelZoom * 4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 4 + (number >= 10 ? Game1.pixelZoom * 3 : 0)), (float)(num4 + Game1.pixelZoom * 3 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), (flag2 ? Color.LightGreen : Color.SandyBrown) * (number == 0 ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } } if ((index1 + 1) % 5 == 0) { num5 += Game1.pixelZoom * 6; } } foreach (ClickableTextureComponent skillBar in this.skillBars) { skillBar.draw(b); } foreach (ClickableTextureComponent skillBar in this.skillBars) { if ((double)skillBar.scale == 0.0) { IClickableMenu.drawTextureBox(b, skillBar.bounds.X - Game1.tileSize / 4 - Game1.pixelZoom * 2, skillBar.bounds.Y - Game1.tileSize / 4 - Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Color.White); b.Draw(Game1.mouseCursors, new Vector2((float)(skillBar.bounds.X - Game1.pixelZoom * 2), (float)(skillBar.bounds.Y - Game1.tileSize / 2 + Game1.tileSize / 4)), new Rectangle?(new Rectangle(this.professionImage % 6 * 16, 624 + this.professionImage / 6 * 16, 16, 16)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } Game1.drawDialogueBox(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)this.height / 2.0) - Game1.tileSize / 2, this.width - Game1.tileSize - IClickableMenu.spaceToClearSideBorder * 2, this.height / 4 + Game1.tileSize, false, true, (string)null, false); this.drawBorderLabel(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11610"), Game1.smallFont, this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 3 / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)this.height / 2.0) - Game1.tileSize / 2); foreach (ClickableTextureComponent specialItem in this.specialItems) { specialItem.draw(b); } if (this.hoverText.Length <= 0) { return; } IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, this.hoverTitle.Length > 0 ? this.hoverTitle : (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null); }
public override void draw(SpriteBatch b) { if (this.cooking) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, (string)null, false); } this.drawHorizontalPartition(b, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize, false); this.inventory.draw(b); if (this.trashCan != null) { this.trashCan.draw(b); b.Draw(Game1.mouseCursors, new Vector2((float)(this.trashCan.bounds.X + 60), (float)(this.trashCan.bounds.Y + 40)), new Rectangle?(new Rectangle(686, 256, 18, 10)), Color.White, this.trashCanLidRotation, new Vector2(16f, 10f), (float)Game1.pixelZoom, SpriteEffects.None, 0.86f); } b.End(); b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); foreach (ClickableTextureComponent key in this.pagesOfCraftingRecipes[this.currentCraftingPage].Keys) { if (key.hoverText.Equals("ghosted")) { key.draw(b, Color.Black * 0.35f, 0.89f); } else if (!this.pagesOfCraftingRecipes[this.currentCraftingPage][key].doesFarmerHaveIngredientsInInventory(this.cooking ? Utility.getHomeOfFarmer(Game1.player).fridge.items : (List <Item>)null)) { key.draw(b, Color.LightGray * 0.4f, 0.89f); } else { key.draw(b); if (this.pagesOfCraftingRecipes[this.currentCraftingPage][key].numberProducedPerCraft > 1) { NumberSprite.draw(this.pagesOfCraftingRecipes[this.currentCraftingPage][key].numberProducedPerCraft, b, new Vector2((float)(key.bounds.X + Game1.tileSize - 2), (float)(key.bounds.Y + Game1.tileSize - 2)), Color.Red, (float)(0.5 * ((double)key.scale / (double)Game1.pixelZoom)), 0.97f, 1f, 0, 0); } } } b.End(); b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); if (this.hoverItem != null) { IClickableMenu.drawToolTip(b, this.hoverText, this.hoverTitle, this.hoverItem, this.heldItem != null, -1, 0, -1, -1, (CraftingRecipe)null, -1); } else if (!string.IsNullOrEmpty(this.hoverText)) { IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, this.heldItem != null ? Game1.tileSize : 0, this.heldItem != null ? Game1.tileSize : 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null); } if (this.heldItem != null) { this.heldItem.drawInMenu(b, new Vector2((float)(Game1.getOldMouseX() + Game1.tileSize / 4), (float)(Game1.getOldMouseY() + Game1.tileSize / 4)), 1f); } base.draw(b); if (this.downButton != null && this.currentCraftingPage < this.pagesOfCraftingRecipes.Count - 1) { this.downButton.draw(b); } if (this.upButton != null && this.currentCraftingPage > 0) { this.upButton.draw(b); } if (this.cooking) { this.drawMouse(b); } if (this.hoverRecipe == null) { return; } SpriteBatch b1 = b; string text = " "; SpriteFont smallFont = Game1.smallFont; int xOffset = this.heldItem != null ? Game1.tileSize * 3 / 4 : 0; int yOffset = this.heldItem != null ? Game1.tileSize * 3 / 4 : 0; int moneyAmountToDisplayAtBottom = -1; string displayName = this.hoverRecipe.DisplayName; int healAmountToDisplay = -1; string[] buffIconsToDisplay; if (this.cooking && this.lastCookingHover != null) { if (Game1.objectInformation[(this.lastCookingHover as StardewValley.Object).parentSheetIndex].Split('/').Length > 7) { buffIconsToDisplay = Game1.objectInformation[(this.lastCookingHover as StardewValley.Object).parentSheetIndex].Split('/')[7].Split(' '); goto label_32; } } buffIconsToDisplay = (string[])null; label_32: Item lastCookingHover = this.lastCookingHover; int currencySymbol = 0; int extraItemToShowIndex = -1; int extraItemToShowAmount = -1; int overrideX = -1; int overrideY = -1; double num = 1.0; CraftingRecipe hoverRecipe = this.hoverRecipe; IClickableMenu.drawHoverText(b1, text, smallFont, xOffset, yOffset, moneyAmountToDisplayAtBottom, displayName, healAmountToDisplay, buffIconsToDisplay, lastCookingHover, currencySymbol, extraItemToShowIndex, extraItemToShowAmount, overrideX, overrideY, (float)num, hoverRecipe); }
public override void draw(SpriteBatch b) { if (this._standaloneMenu) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, (string)null, false, true, -1, -1, -1); } this.drawHorizontalPartition(b, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 256, false, -1, -1, -1); this.inventory.draw(b); if (this.trashCan != null) { this.trashCan.draw(b); b.Draw(Game1.mouseCursors, new Vector2((float)(this.trashCan.bounds.X + 60), (float)(this.trashCan.bounds.Y + 40)), new Rectangle?(new Rectangle(564 + Game1.player.trashCanLevel * 18, 129, 18, 10)), Color.White, this.trashCanLidRotation, new Vector2(16f, 10f), 4f, SpriteEffects.None, 0.86f); } b.End(); b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); foreach (ClickableTextureComponent key in this.pagesOfCraftingRecipes[this.currentCraftingPage].Keys) { if (key.hoverText.Equals("ghosted")) { key.draw(b, Color.Black * 0.35f, 0.89f, 0); } else if (!this.pagesOfCraftingRecipes[this.currentCraftingPage][key].doesFarmerHaveIngredientsInInventory(this.getContainerContents())) { key.draw(b, Color.LightGray * 0.4f, 0.89f, 0); if (this.pagesOfCraftingRecipes[this.currentCraftingPage][key].numberProducedPerCraft > 1) { NumberSprite.draw(this.pagesOfCraftingRecipes[this.currentCraftingPage][key].numberProducedPerCraft, b, new Vector2((float)(key.bounds.X + 64 - 2), (float)(key.bounds.Y + 64 - 2)), Color.LightGray * 0.75f, (float)(0.5 * ((double)key.scale / 4.0)), 0.97f, 1f, 0, 0); } } else { key.draw(b); if (this.pagesOfCraftingRecipes[this.currentCraftingPage][key].numberProducedPerCraft > 1) { NumberSprite.draw(this.pagesOfCraftingRecipes[this.currentCraftingPage][key].numberProducedPerCraft, b, new Vector2((float)(key.bounds.X + 64 - 2), (float)(key.bounds.Y + 64 - 2)), Color.White, (float)(0.5 * ((double)key.scale / 4.0)), 0.97f, 1f, 0, 0); } } } b.End(); b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); if (this.hoverItem != null) { IClickableMenu.drawToolTip(b, this.hoverText, this.hoverTitle, this.hoverItem, this.heldItem != null, -1, 0, -1, -1, (CraftingRecipe)null, -1); } else if (!string.IsNullOrEmpty(this.hoverText)) { if (this.hoverAmount > 0) { IClickableMenu.drawToolTip(b, this.hoverText, this.hoverTitle, (Item)null, true, -1, 0, -1, -1, (CraftingRecipe)null, this.hoverAmount); } else { IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, this.heldItem != null ? 64 : 0, this.heldItem != null ? 64 : 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null, (IList <Item>)null); } } if (this.heldItem != null) { this.heldItem.drawInMenu(b, new Vector2((float)(Game1.getOldMouseX() + 16), (float)(Game1.getOldMouseY() + 16)), 1f); } base.draw(b); if (this.downButton != null && this.currentCraftingPage < this.pagesOfCraftingRecipes.Count - 1) { this.downButton.draw(b); } if (this.upButton != null && this.currentCraftingPage > 0) { this.upButton.draw(b); } if (this._standaloneMenu) { Game1.mouseCursorTransparency = 1f; this.drawMouse(b); } if (this.hoverRecipe == null) { return; } SpriteBatch b1 = b; SpriteFont smallFont = Game1.smallFont; int xOffset = this.heldItem != null ? 48 : 0; int yOffset = this.heldItem != null ? 48 : 0; string displayName = this.hoverRecipe.DisplayName; string[] buffIconsToDisplay; if (this.cooking && this.lastCookingHover != null) { if (Game1.objectInformation[(int)((NetFieldBase <int, NetInt>)(this.lastCookingHover as StardewValley.Object).parentSheetIndex)].Split('/').Length > 7) { buffIconsToDisplay = Game1.objectInformation[(int)((NetFieldBase <int, NetInt>)(this.lastCookingHover as StardewValley.Object).parentSheetIndex)].Split('/')[7].Split(' '); goto label_35; } } buffIconsToDisplay = (string[])null; label_35: Item lastCookingHover = this.lastCookingHover; CraftingRecipe hoverRecipe = this.hoverRecipe; IList <Item> containerContents = this.getContainerContents(); IClickableMenu.drawHoverText(b1, " ", smallFont, xOffset, yOffset, -1, displayName, -1, buffIconsToDisplay, lastCookingHover, 0, -1, -1, -1, -1, 1f, hoverRecipe, containerContents); }
public override void draw(SpriteBatch b) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, (string)null, false); int num1 = this.xPositionOnScreen + 64 - 12; int num2 = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder; b.Draw(Game1.timeOfDay >= 1900 ? Game1.nightbg : Game1.daybg, new Vector2((float)num1, (float)num2), Color.White); Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame((bool)((NetFieldBase <bool, NetBool>)Game1.player.bathingClothes) ? 108 : this.playerPanelFrames[this.playerPanelIndex], 0, false, false, (AnimatedSprite.endOfAnimationBehavior)null, false), (bool)((NetFieldBase <bool, NetBool>)Game1.player.bathingClothes) ? 108 : this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, (bool)((NetFieldBase <bool, NetBool>)Game1.player.bathingClothes) ? 576 : 0, 16, 32), new Vector2((float)(num1 + 32), (float)(num2 + 32)), Vector2.Zero, 0.8f, 2, Color.White, 0.0f, 1f, Game1.player); if (Game1.timeOfDay >= 1900) { Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(this.playerPanelFrames[this.playerPanelIndex], 0, false, false, (AnimatedSprite.endOfAnimationBehavior)null, false), this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, 0, 16, 32), new Vector2((float)(num1 + 32), (float)(num2 + 32)), Vector2.Zero, 0.8f, 2, Color.DarkBlue * 0.3f, 0.0f, 1f, Game1.player); } b.DrawString(Game1.smallFont, Game1.player.Name, new Vector2((float)(num1 + 64) - Game1.smallFont.MeasureString(Game1.player.Name).X / 2f, (float)(num2 + 192 + 4)), Game1.textColor); b.DrawString(Game1.smallFont, Game1.player.getTitle(), new Vector2((float)(num1 + 64) - Game1.smallFont.MeasureString(Game1.player.getTitle()).X / 2f, (float)(num2 + 256 - 32)), Game1.textColor); int num3 = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru ? this.xPositionOnScreen + this.width - 448 - 48 : this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 256 - 8; int num4 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - 8; int num5 = 0; for (int index1 = 0; index1 < 10; ++index1) { for (int index2 = 0; index2 < (SpaceCore.instance.Helper.ModRegistry.IsLoaded("spacechase0.LuckSkill") ? 6 : 5); ++index2) { bool flag1 = false; bool flag2 = false; string text = ""; int number = 0; Rectangle rectangle = Rectangle.Empty; switch (index2) { case 0: flag1 = Game1.player.FarmingLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11604"); } number = Game1.player.FarmingLevel; flag2 = (int)((NetFieldBase <int, NetInt>)Game1.player.addedFarmingLevel) > 0; rectangle = new Rectangle(10, 428, 10, 10); break; case 1: flag1 = Game1.player.MiningLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11605"); } number = Game1.player.MiningLevel; flag2 = (int)((NetFieldBase <int, NetInt>)Game1.player.addedMiningLevel) > 0; rectangle = new Rectangle(30, 428, 10, 10); break; case 2: flag1 = Game1.player.ForagingLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11606"); } number = Game1.player.ForagingLevel; flag2 = (int)((NetFieldBase <int, NetInt>)Game1.player.addedForagingLevel) > 0; rectangle = new Rectangle(60, 428, 10, 10); break; case 3: flag1 = Game1.player.FishingLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11607"); } number = Game1.player.FishingLevel; flag2 = (int)((NetFieldBase <int, NetInt>)Game1.player.addedFishingLevel) > 0; rectangle = new Rectangle(20, 428, 10, 10); break; case 4: flag1 = Game1.player.CombatLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11608"); } number = Game1.player.CombatLevel; flag2 = (int)((NetFieldBase <int, NetInt>)Game1.player.addedCombatLevel) > 0; rectangle = new Rectangle(120, 428, 10, 10); break; case 5: flag1 = Game1.player.LuckLevel > index1; if (index1 == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11609"); } number = Game1.player.LuckLevel; flag2 = (int)((NetFieldBase <int, NetInt>)Game1.player.addedLuckLevel) > 0; rectangle = new Rectangle(50, 428, 10, 10); break; } if (!text.Equals("")) { b.DrawString(Game1.smallFont, text, new Vector2((float)((double)num3 - (double)Game1.smallFont.MeasureString(text).X + 4.0 - 64.0), (float)(num4 + 4 + index2 * 56)), Game1.textColor); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 - 56), (float)(num4 + index2 * 56)), new Rectangle?(rectangle), Color.Black * 0.3f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 - 52), (float)(num4 - 4 + index2 * 56)), new Rectangle?(rectangle), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } if (!flag1 && (index1 + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - 4 + index1 * 36), (float)(num4 + index2 * 56)), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * 36), (float)(num4 - 4 + index2 * 56)), new Rectangle?(new Rectangle(145 + (flag1 ? 14 : 0), 338, 14, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } else if ((index1 + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - 4 + index1 * 36), (float)(num4 + index2 * 56)), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * 36), (float)(num4 - 4 + index2 * 56)), new Rectangle?(new Rectangle(129 + (flag1 ? 8 : 0), 338, 8, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } if (index1 == 9) { NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * 36 + 12 + (number >= 10 ? 12 : 0)), (float)(num4 + 16 + index2 * 56)), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * 36 + 16 + (number >= 10 ? 12 : 0)), (float)(num4 + 12 + index2 * 56)), (flag2 ? Color.LightGreen : Color.SandyBrown) * (number == 0 ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } } if ((index1 + 1) % 5 == 0) { num5 += 24; } } ////////////////////////////////// int index2_ = SpaceCore.instance.Helper.ModRegistry.IsLoaded("spacechase0.LuckSkill") ? 6 : 5; foreach (var skillName in Skills.GetSkillList()) { num5 = 0; var skill = Skills.GetSkill(skillName); for (int index1 = 0; index1 < skill.ExperienceCurve.Length; ++index1) { bool flag1 = false; bool flag2 = false; string text = ""; int number = 0; flag1 = Game1.player.GetCustomSkillLevel(skill) > index1; if (index1 == 0) { text = skill.Name; } number = Game1.player.GetCustomSkillLevel(skill); // TODO: Detect skill buffs? Is that even possible? flag2 = false;// (int)((NetFieldBase<int, NetInt>)Game1.player.addedFarmingLevel) > 0; if (!text.Equals("")) { b.DrawString(Game1.smallFont, text, new Vector2((float)((double)num3 - (double)Game1.smallFont.MeasureString(text).X + 4.0 - 64.0), (float)(num4 + 4 + index2_ * 56)), Game1.textColor); if (skill.SkillsPageIcon != null) { b.Draw(skill.SkillsPageIcon, new Vector2((float)(num3 - 56), (float)(num4 + index2_ * 56)), null, Color.Black * 0.3f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.85f); b.Draw(skill.SkillsPageIcon, new Vector2((float)(num3 - 52), (float)(num4 - 4 + index2_ * 56)), null, Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } } if (!flag1 && (index1 + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - 4 + index1 * 36), (float)(num4 + index2_ * 56)), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * 36), (float)(num4 - 4 + index2_ * 56)), new Rectangle?(new Rectangle(145 + (flag1 ? 14 : 0), 338, 14, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } else if ((index1 + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - 4 + index1 * 36), (float)(num4 + index2_ * 56)), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * 36), (float)(num4 - 4 + index2_ * 56)), new Rectangle?(new Rectangle(129 + (flag1 ? 8 : 0), 338, 8, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } if (index1 == 9) { NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * 36 + 12 + (number >= 10 ? 12 : 0)), (float)(num4 + 16 + index2_ * 56)), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * 36 + 16 + (number >= 10 ? 12 : 0)), (float)(num4 + 12 + index2_ * 56)), (flag2 ? Color.LightGreen : Color.SandyBrown) * (number == 0 ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } if ((index1 + 1) % 5 == 0) { num5 += 24; } } ++index2_; } ////////////////////////////////// foreach (ClickableTextureComponent skillBar in this.skillBars) { skillBar.draw(b); } foreach (ClickableTextureComponent skillBar in this.skillBars) { if ((double)skillBar.scale == 0.0) { IClickableMenu.drawTextureBox(b, skillBar.bounds.X - 16 - 8, skillBar.bounds.Y - 16 - 16, 96, 96, Color.White); if (skillBar.name.StartsWith("C")) { skillBar.scale = (float)Game1.pixelZoom; if (skillBar.containsPoint(Game1.getMouseX(), Game1.getMouseY()) && !skillBar.name.Equals("-1") && skillBar.hoverText.Length > 0) { var professions = Skills.skills.SelectMany(x => x.Value.Professions).ToList(); var profession = professions.Where(x => $"C{x.Id}" == skillBar.name).FirstOrDefault(); this.hoverText = profession.Description; this.hoverTitle = profession.Name; var actuallyAProfessionImage = profession.Icon; skillBar.scale = 0.0f; b.Draw(actuallyAProfessionImage, new Vector2((float)(skillBar.bounds.X - Game1.pixelZoom * 2), (float)(skillBar.bounds.Y - Game1.tileSize / 2 + Game1.tileSize / 4)), new Rectangle(0, 0, 16, 16), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } else { b.Draw(Game1.mouseCursors, new Vector2((float)(skillBar.bounds.X - 8), (float)(skillBar.bounds.Y - 32 + 16)), new Rectangle?(new Rectangle(this.professionImage % 6 * 16, 624 + this.professionImage / 6 * 16, 16, 16)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } } Game1.drawDialogueBox(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 32 + WALLET_MOVE_X, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)this.height / 2.0) - 32 + WALLET_MOVE_Y, this.width - 64 - IClickableMenu.spaceToClearSideBorder * 2 + WALLET_MOVE_W, this.height / 4 + 64 + WALLET_MOVE_H, false, true, (string)null, false); this.drawBorderLabel(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11610"), Game1.smallFont, this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 96 + WALLET_MOVE_X, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)this.height / 2.0) - 32 + WALLET_MOVE_Y); foreach (ClickableTextureComponent specialItem in this.specialItems) { specialItem.draw(b); } if (this.hoverText.Length <= 0) { return; } IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, this.hoverTitle.Length > 0 ? this.hoverTitle : (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null); }
public override void draw(SpriteBatch b) { int x = xPositionOnScreen + 64 - 12; int y3 = yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder; b.Draw((Game1.timeOfDay >= 1900) ? Game1.nightbg : Game1.daybg, new Vector2(x, y3), Color.White); FarmerRenderer.isDrawingForUI = true; Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(Game1.player.bathingClothes ? 108 : playerPanelFrames[playerPanelIndex], 0, secondaryArm: false, flip: false), Game1.player.bathingClothes ? 108 : playerPanelFrames[playerPanelIndex], new Rectangle(playerPanelFrames[playerPanelIndex] * 16, Game1.player.bathingClothes ? 576 : 0, 16, 32), new Vector2(x + 32, y3 + 32), Vector2.Zero, 0.8f, 2, Color.White, 0f, 1f, Game1.player); if (Game1.timeOfDay >= 1900) { Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(playerPanelFrames[playerPanelIndex], 0, secondaryArm: false, flip: false), playerPanelFrames[playerPanelIndex], new Rectangle(playerPanelFrames[playerPanelIndex] * 16, 0, 16, 32), new Vector2(x + 32, y3 + 32), Vector2.Zero, 0.8f, 2, Color.DarkBlue * 0.3f, 0f, 1f, Game1.player); } FarmerRenderer.isDrawingForUI = false; b.DrawString(Game1.smallFont, Game1.player.Name, new Vector2((float)(x + 64) - Game1.smallFont.MeasureString(Game1.player.Name).X / 2f, y3 + 192 + 4), Game1.textColor); b.DrawString(Game1.smallFont, Game1.player.getTitle(), new Vector2((float)(x + 64) - Game1.smallFont.MeasureString(Game1.player.getTitle()).X / 2f, y3 + 256 - 32), Game1.textColor); x = ((LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru || LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.it) ? (xPositionOnScreen + width - 448 - 48) : (xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 256 - 8)); y3 = yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - 8; int addedX = 0; for (int j = 0; j < 10; j++) { for (int i = 0; i < 5; i++) { bool drawRed = false; bool addedSkill = false; string skill = ""; int skillLevel = 0; Rectangle iconSource = Rectangle.Empty; switch (i) { case 0: drawRed = (Game1.player.FarmingLevel > j); if (j == 0) { skill = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11604"); } skillLevel = Game1.player.FarmingLevel; addedSkill = ((int)Game1.player.addedFarmingLevel > 0); iconSource = new Rectangle(10, 428, 10, 10); break; case 1: drawRed = (Game1.player.MiningLevel > j); if (j == 0) { skill = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11605"); } skillLevel = Game1.player.MiningLevel; addedSkill = ((int)Game1.player.addedMiningLevel > 0); iconSource = new Rectangle(30, 428, 10, 10); break; case 2: drawRed = (Game1.player.ForagingLevel > j); if (j == 0) { skill = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11606"); } skillLevel = Game1.player.ForagingLevel; addedSkill = ((int)Game1.player.addedForagingLevel > 0); iconSource = new Rectangle(60, 428, 10, 10); break; case 3: drawRed = (Game1.player.FishingLevel > j); if (j == 0) { skill = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11607"); } skillLevel = Game1.player.FishingLevel; addedSkill = ((int)Game1.player.addedFishingLevel > 0 || (Game1.player.CurrentTool != null && Game1.player.CurrentTool.hasEnchantmentOfType <MasterEnchantment>())); iconSource = new Rectangle(20, 428, 10, 10); break; case 4: drawRed = (Game1.player.CombatLevel > j); if (j == 0) { skill = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11608"); } skillLevel = Game1.player.CombatLevel; addedSkill = ((int)Game1.player.addedCombatLevel > 0); iconSource = new Rectangle(120, 428, 10, 10); break; case 5: drawRed = (Game1.player.LuckLevel > j); if (j == 0) { skill = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11609"); } skillLevel = Game1.player.LuckLevel; addedSkill = ((int)Game1.player.addedLuckLevel > 0); iconSource = new Rectangle(50, 428, 10, 10); break; } if (!skill.Equals("")) { b.DrawString(Game1.smallFont, skill, new Vector2((float)x - Game1.smallFont.MeasureString(skill).X + 4f - 64f, y3 + 4 + i * 56), Game1.textColor); b.Draw(Game1.mouseCursors, new Vector2(x - 56, y3 + i * 56), iconSource, Color.Black * 0.3f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2(x - 52, y3 - 4 + i * 56), iconSource, Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } if (!drawRed && (j + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2(addedX + x - 4 + j * 36, y3 + i * 56), new Rectangle(145, 338, 14, 9), Color.Black * 0.35f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2(addedX + x + j * 36, y3 - 4 + i * 56), new Rectangle(145 + (drawRed ? 14 : 0), 338, 14, 9), Color.White * (drawRed ? 1f : 0.65f), 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } else if ((j + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2(addedX + x - 4 + j * 36, y3 + i * 56), new Rectangle(129, 338, 8, 9), Color.Black * 0.35f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2(addedX + x + j * 36, y3 - 4 + i * 56), new Rectangle(129 + (drawRed ? 8 : 0), 338, 8, 9), Color.White * (drawRed ? 1f : 0.65f), 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.87f); } if (j == 9) { NumberSprite.draw(skillLevel, b, new Vector2(addedX + x + (j + 2) * 36 + 12 + ((skillLevel >= 10) ? 12 : 0), y3 + 16 + i * 56), Color.Black * 0.35f, 1f, 0.85f, 1f, 0); NumberSprite.draw(skillLevel, b, new Vector2(addedX + x + (j + 2) * 36 + 16 + ((skillLevel >= 10) ? 12 : 0), y3 + 12 + i * 56), (addedSkill ? Color.LightGreen : Color.SandyBrown) * ((skillLevel == 0) ? 0.75f : 1f), 1f, 0.87f, 1f, 0); } } if ((j + 1) % 5 == 0) { addedX += 24; } } foreach (ClickableTextureComponent skillBar in skillBars) { skillBar.draw(b); } foreach (ClickableTextureComponent c in skillBars) { if (c.scale == 0f) { IClickableMenu.drawTextureBox(b, c.bounds.X - 16 - 8, c.bounds.Y - 16 - 16, 96, 96, Color.White); b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 8, c.bounds.Y - 32 + 16), new Rectangle(professionImage % 6 * 16, 624 + professionImage / 6 * 16, 16, 16), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } x = xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 32 + 16; y3 = yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + 320 - 8; if ((int)Game1.netWorldState.Value.GoldenWalnuts > 0) { b.Draw(Game1.objectSpriteSheet, new Vector2(x, y3), Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, 73, 16, 16), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); x += 48; b.DrawString(Game1.smallFont, string.Concat((object)Game1.netWorldState.Value.GoldenWalnuts), new Vector2(x, y3), Game1.textColor); x += 64; } if (Game1.player.QiGems > 0) { b.Draw(Game1.objectSpriteSheet, new Vector2(x, y3), Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, 858, 16, 16), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); x += 48; b.DrawString(Game1.smallFont, string.Concat(Game1.player.QiGems), new Vector2(x, y3), Game1.textColor); x += 64; } Game1.drawDialogueBox(xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 32, yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)height / 2f) - 32, width - 64 - IClickableMenu.spaceToClearSideBorder * 2, height / 4 + 64, speaker: false, drawOnlyBox: true); drawBorderLabel(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11610"), Game1.smallFont, xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 96, yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)height / 2f) - 32); foreach (ClickableTextureComponent specialItem in specialItems) { specialItem?.draw(b); } if (hoverText.Length > 0) { IClickableMenu.drawHoverText(b, hoverText, Game1.smallFont, 0, 0, -1, (hoverTitle.Length > 0) ? hoverTitle : null); } }
public override void draw(SpriteBatch b) { if (_standaloneMenu) { Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen, width, height, speaker: false, drawOnlyBox: true); } drawHorizontalPartition(b, yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 256); inventory.draw(b); if (trashCan != null) { trashCan.draw(b); b.Draw(Game1.mouseCursors, new Vector2(trashCan.bounds.X + 60, trashCan.bounds.Y + 40), new Rectangle(564 + Game1.player.trashCanLevel * 18, 129, 18, 10), Color.White, trashCanLidRotation, new Vector2(16f, 10f), 4f, SpriteEffects.None, 0.86f); } b.End(); b.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); foreach (ClickableTextureComponent c in pagesOfCraftingRecipes[currentCraftingPage].Keys) { if (c.hoverText.Equals("ghosted")) { c.draw(b, Color.Black * 0.35f, 0.89f); } else if (!pagesOfCraftingRecipes[currentCraftingPage][c].doesFarmerHaveIngredientsInInventory(getContainerContents())) { c.draw(b, Color.DimGray * 0.4f, 0.89f); if (pagesOfCraftingRecipes[currentCraftingPage][c].numberProducedPerCraft > 1) { NumberSprite.draw(pagesOfCraftingRecipes[currentCraftingPage][c].numberProducedPerCraft, b, new Vector2(c.bounds.X + 64 - 2, c.bounds.Y + 64 - 2), Color.LightGray * 0.75f, 0.5f * (c.scale / 4f), 0.97f, 1f, 0); } } else { c.draw(b); if (pagesOfCraftingRecipes[currentCraftingPage][c].numberProducedPerCraft > 1) { NumberSprite.draw(pagesOfCraftingRecipes[currentCraftingPage][c].numberProducedPerCraft, b, new Vector2(c.bounds.X + 64 - 2, c.bounds.Y + 64 - 2), Color.White, 0.5f * (c.scale / 4f), 0.97f, 1f, 0); } } } b.End(); b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); if (hoverItem != null) { IClickableMenu.drawToolTip(b, hoverText, hoverTitle, hoverItem, heldItem != null); } else if (!string.IsNullOrEmpty(hoverText)) { if (hoverAmount > 0) { IClickableMenu.drawToolTip(b, hoverText, hoverTitle, null, heldItem: true, -1, 0, -1, -1, null, hoverAmount); } else { IClickableMenu.drawHoverText(b, hoverText, Game1.smallFont, (heldItem != null) ? 64 : 0, (heldItem != null) ? 64 : 0); } } if (heldItem != null) { heldItem.drawInMenu(b, new Vector2(Game1.getOldMouseX() + 16, Game1.getOldMouseY() + 16), 1f); } base.draw(b); if (downButton != null && currentCraftingPage < pagesOfCraftingRecipes.Count - 1) { downButton.draw(b); } if (upButton != null && currentCraftingPage > 0) { upButton.draw(b); } if (_standaloneMenu) { Game1.mouseCursorTransparency = 1f; drawMouse(b); } if (hoverRecipe != null) { IClickableMenu.drawHoverText(b, " ", Game1.smallFont, (heldItem != null) ? 48 : 0, (heldItem != null) ? 48 : 0, -1, hoverRecipe.DisplayName + ((hoverRecipe.numberProducedPerCraft > 1) ? (" x" + hoverRecipe.numberProducedPerCraft) : ""), -1, (cooking && lastCookingHover != null && Game1.objectInformation[(lastCookingHover as Object).parentSheetIndex].Split('/').Length > 7) ? Game1.objectInformation[(lastCookingHover as Object).parentSheetIndex].Split('/')[7].Split(' ') : null, lastCookingHover, 0, -1, -1, -1, -1, 1f, hoverRecipe, getContainerContents()); } }
// Token: 0x06000E1D RID: 3613 RVA: 0x0011FC48 File Offset: 0x0011DE48 public override void draw(SpriteBatch b) { if (this.cooking) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, null, false); } base.drawHorizontalPartition(b, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize, false); this.inventory.draw(b); if (this.trashCan != null) { this.trashCan.draw(b); b.Draw(Game1.mouseCursors, new Vector2((float)(this.trashCan.bounds.X + 60), (float)(this.trashCan.bounds.Y + 40)), new Rectangle?(new Rectangle(686, 256, 18, 10)), Color.White, this.trashCanLidRotation, new Vector2(16f, 10f), (float)Game1.pixelZoom, SpriteEffects.None, 0.86f); } b.End(); b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null); foreach (ClickableTextureComponent c in this.pagesOfCraftingRecipes[this.currentCraftingPage].Keys) { if (c.hoverText.Equals("ghosted")) { c.draw(b, Color.Black * 0.35f, 0.89f); } else if (!this.pagesOfCraftingRecipes[this.currentCraftingPage][c].doesFarmerHaveIngredientsInInventory(this.cooking ? Utility.getHomeOfFarmer(Game1.player).fridge.items : null)) { c.draw(b, Color.LightGray * 0.4f, 0.89f); } else { c.draw(b); if (this.pagesOfCraftingRecipes[this.currentCraftingPage][c].numberProducedPerCraft > 1) { NumberSprite.draw(this.pagesOfCraftingRecipes[this.currentCraftingPage][c].numberProducedPerCraft, b, new Vector2((float)(c.bounds.X + Game1.tileSize - 2), (float)(c.bounds.Y + Game1.tileSize - 2)), Color.Red, 0.5f * (c.scale / (float)Game1.pixelZoom), 0.97f, 1f, 0, 0); } } } b.End(); b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); if (this.hoverItem != null) { IClickableMenu.drawToolTip(b, this.hoverText, this.hoverTitle, this.hoverItem, this.heldItem != null, -1, 0, -1, -1, null, -1); } else if (this.hoverText != null) { IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, (this.heldItem != null) ? Game1.tileSize : 0, (this.heldItem != null) ? Game1.tileSize : 0, -1, null, -1, null, null, 0, -1, -1, -1, -1, 1f, null); } if (this.heldItem != null) { this.heldItem.drawInMenu(b, new Vector2((float)(Game1.getOldMouseX() + Game1.tileSize / 4), (float)(Game1.getOldMouseY() + Game1.tileSize / 4)), 1f); } base.draw(b); if (this.downButton != null && this.currentCraftingPage < this.pagesOfCraftingRecipes.Count - 1) { this.downButton.draw(b); } if (this.upButton != null && this.currentCraftingPage > 0) { this.upButton.draw(b); } if (this.cooking) { base.drawMouse(b); } if (this.hoverRecipe != null) { IClickableMenu.drawHoverText(b, " ", Game1.smallFont, (this.heldItem != null) ? (Game1.tileSize * 3 / 4) : 0, (this.heldItem != null) ? (Game1.tileSize * 3 / 4) : 0, -1, this.hoverRecipe.name, -1, (this.cooking && this.lastCookingHover != null && Game1.objectInformation[(this.lastCookingHover as Object).parentSheetIndex].Split(new char[] { '/' }).Length >= 7) ? Game1.objectInformation[(this.lastCookingHover as Object).parentSheetIndex].Split(new char[] { '/' })[6].Split(new char[] { ' ' }) : null, this.lastCookingHover, 0, -1, -1, -1, -1, 1f, this.hoverRecipe); } }
public static void craftingPageDraw(StardewValley.Menus.CraftingPage menu, SpriteBatch b) { int craftingPage = (int)Class1.GetInstanceField(typeof(StardewValley.Menus.CraftingPage), menu, "currentCraftingPage"); bool cooking = (bool)Class1.GetInstanceField(typeof(StardewValley.Menus.CraftingPage), menu, "cooking"); if (cooking) { Game1.drawDialogueBox(menu.xPositionOnScreen, menu.yPositionOnScreen, menu.width, menu.height, false, true, (string)null, false); } Class1.getInvokeMethod(menu, "drawHorizontalPartition", new object[] { b, menu.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 256, false }); menu.inventory.draw(b); if (menu.trashCan != null) { menu.trashCan.draw(b); b.Draw(Game1.mouseCursors, new Vector2((float)(menu.trashCan.bounds.X + 60), (float)(menu.trashCan.bounds.Y + 40)), new Rectangle?(new Rectangle(686, 256, 18, 10)), Color.White, menu.trashCanLidRotation, new Vector2(16f, 10f), 4f, SpriteEffects.None, 0.86f); } //b.End(); //b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); IList <Item> fridge = (IList <Item>)Class1.getInvokeMethod(menu, "fridge", new object[] { }); foreach (ClickableTextureComponent key in menu.pagesOfCraftingRecipes[craftingPage].Keys) { if (key.hoverText.Equals("ghosted")) { key.draw(b, Color.Black * 0.35f, 0.89f); } else if (!menu.pagesOfCraftingRecipes[craftingPage][key].doesFarmerHaveIngredientsInInventory(cooking ? fridge : (IList <Item>)null)) { key.draw(b, Color.LightGray * 0.4f, 0.89f); } else { key.draw(b); if (menu.pagesOfCraftingRecipes[craftingPage][key].numberProducedPerCraft > 1) { NumberSprite.draw(menu.pagesOfCraftingRecipes[craftingPage][key].numberProducedPerCraft, b, new Vector2((float)(key.bounds.X + 64 - 2), (float)(key.bounds.Y + 64 - 2)), Color.Red, (float)(0.5 * ((double)key.scale / 4.0)), 0.97f, 1f, 0, 0); } } } //b.End(); //b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); Item hoverItem = (Item)Class1.GetInstanceField(menu.GetType(), menu, "hoverItem"); Item heldItem = (Item)Class1.GetInstanceField(menu.GetType(), menu, "heldItem"); Item lastCookingHover = (Item)Class1.GetInstanceField(menu.GetType(), menu, "lastCookingHover"); string hoverText = (string)Class1.GetInstanceField(menu.GetType(), menu, "hoverText"); string hoverTitle = (string)Class1.GetInstanceField(menu.GetType(), menu, "hoverTitle"); CraftingRecipe hoverRecipe = (CraftingRecipe)Class1.GetInstanceField(menu.GetType(), menu, "hoverRecipe"); if (hoverItem != null) { IClickableMenu.drawToolTip(b, hoverText, hoverTitle, hoverItem, heldItem != null, -1, 0, -1, -1, (CraftingRecipe)null, -1); } else if (!string.IsNullOrEmpty(hoverText)) { IClickableMenu.drawHoverText(b, hoverText, Game1.smallFont, heldItem != null ? 64 : 0, heldItem != null ? 64 : 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null); } if (heldItem != null) { heldItem.drawInMenu(b, new Vector2((float)(Game1.getOldMouseX() + 16), (float)(Game1.getOldMouseY() + 16)), 1f); } //(menu as IClickableMenu).draw(b); if (menu.downButton != null && craftingPage < menu.pagesOfCraftingRecipes.Count - 1) { menu.downButton.draw(b); } if (menu.upButton != null && craftingPage > 0) { menu.upButton.draw(b); } //if (cooking) //drawMouse(b); if (hoverRecipe == null) { return; } SpriteBatch b1 = b; string text = " "; SpriteFont smallFont = Game1.smallFont; int xOffset = heldItem != null ? 48 : 0; int yOffset = heldItem != null ? 48 : 0; int moneyAmountToDisplayAtBottom = -1; string displayName = hoverRecipe.DisplayName; int healAmountToDisplay = -1; string[] buffIconsToDisplay; if (cooking && lastCookingHover != null) { if (Game1.objectInformation[(int)((lastCookingHover as StardewValley.Object).parentSheetIndex)].Split('/').Length > 7) { buffIconsToDisplay = Game1.objectInformation[(int)((lastCookingHover as StardewValley.Object).parentSheetIndex)].Split('/')[7].Split(' '); goto label_32; } } buffIconsToDisplay = (string[])null; label_32: Item lastCookingHover2 = lastCookingHover; int currencySymbol = 0; int extraItemToShowIndex = -1; int extraItemToShowAmount = -1; int overrideX = -1; int overrideY = -1; double num = 1.0; CraftingRecipe hoverRecipe2 = hoverRecipe; IClickableMenu.drawHoverText(b1, text, smallFont, xOffset, yOffset, moneyAmountToDisplayAtBottom, displayName, healAmountToDisplay, buffIconsToDisplay, lastCookingHover2, currencySymbol, extraItemToShowIndex, extraItemToShowAmount, overrideX, overrideY, (float)num, hoverRecipe2); }
// Token: 0x06000FD3 RID: 4051 RVA: 0x00147DCC File Offset: 0x00145FCC public override void draw(SpriteBatch b) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, null, false); int x = this.xPositionOnScreen + Game1.tileSize; int y = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder; b.Draw((Game1.timeOfDay >= 1900) ? Game1.nightbg : Game1.daybg, new Vector2((float)x, (float)y), Color.White); Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(Game1.player.bathingClothes ? 108 : this.playerPanelFrames[this.playerPanelIndex], 0, false, false, null, false), Game1.player.bathingClothes ? 108 : this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, Game1.player.bathingClothes ? 576 : 0, 16, 32), new Vector2((float)(x + Game1.tileSize / 2), (float)(y + Game1.tileSize / 2)), Vector2.Zero, 0.8f, 2, Color.White, 0f, 1f, Game1.player); if (Game1.timeOfDay >= 1900) { Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(this.playerPanelFrames[this.playerPanelIndex], 0, false, false, null, false), this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, 0, 16, 32), new Vector2((float)(x + Game1.tileSize / 2), (float)(y + Game1.tileSize / 2)), Vector2.Zero, 0.8f, 2, Color.DarkBlue * 0.3f, 0f, 1f, Game1.player); } b.DrawString(Game1.smallFont, Game1.player.name, new Vector2((float)(x + Game1.tileSize) - Game1.smallFont.MeasureString(Game1.player.name).X / 2f, (float)(y + 3 * Game1.tileSize + 4)), Game1.textColor); b.DrawString(Game1.smallFont, Game1.player.getTitle(), new Vector2((float)(x + Game1.tileSize) - Game1.smallFont.MeasureString(Game1.player.getTitle()).X / 2f, (float)(y + 4 * Game1.tileSize - Game1.tileSize / 2)), Game1.textColor); x = this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - 8; y = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 2; int addedX = 0; for (int i = 0; i < 10; i++) { for (int j = 0; j < 5; j++) { bool drawRed = false; bool addedSkill = false; string skill = ""; int skillLevel = 0; Rectangle iconSource = Rectangle.Empty; switch (j) { case 0: drawRed = (Game1.player.FarmingLevel > i); if (i == 0) { skill = "Farming"; } skillLevel = Game1.player.FarmingLevel; addedSkill = (Game1.player.addedFarmingLevel > 0); iconSource = new Rectangle(10, 428, 10, 10); break; case 1: drawRed = (Game1.player.MiningLevel > i); if (i == 0) { skill = "Mining"; } skillLevel = Game1.player.MiningLevel; addedSkill = (Game1.player.addedMiningLevel > 0); iconSource = new Rectangle(30, 428, 10, 10); break; case 2: drawRed = (Game1.player.ForagingLevel > i); if (i == 0) { skill = "Foraging"; } skillLevel = Game1.player.ForagingLevel; addedSkill = (Game1.player.addedForagingLevel > 0); iconSource = new Rectangle(60, 428, 10, 10); break; case 3: drawRed = (Game1.player.FishingLevel > i); if (i == 0) { skill = "Fishing"; } skillLevel = Game1.player.FishingLevel; addedSkill = (Game1.player.addedFishingLevel > 0); iconSource = new Rectangle(20, 428, 10, 10); break; case 4: drawRed = (Game1.player.CombatLevel > i); if (i == 0) { skill = "Combat"; } skillLevel = Game1.player.CombatLevel; addedSkill = (Game1.player.addedCombatLevel > 0); iconSource = new Rectangle(120, 428, 10, 10); break; case 5: drawRed = (Game1.player.LuckLevel > i); if (i == 0) { skill = "Luck"; } skillLevel = Game1.player.LuckLevel; addedSkill = (Game1.player.addedLuckLevel > 0); iconSource = new Rectangle(50, 428, 10, 10); break; } if (!skill.Equals("")) { b.DrawString(Game1.smallFont, skill, new Vector2((float)x - Game1.smallFont.MeasureString(skill).X - (float)(Game1.pixelZoom * 4) - (float)Game1.tileSize, (float)(y + Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Game1.textColor); b.Draw(Game1.mouseCursors, new Vector2((float)(x - Game1.pixelZoom * 16), (float)(y + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(iconSource), Color.Black * 0.3f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(x - Game1.pixelZoom * 15), (float)(y - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(iconSource), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (!drawRed && (i + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(addedX + x - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(y + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2((float)(addedX + x + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(y - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145 + (drawRed ? 14 : 0), 338, 14, 9)), Color.White * (drawRed ? 1f : 0.65f), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } else if ((i + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(addedX + x - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(y + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(addedX + x + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(y - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129 + (drawRed ? 8 : 0), 338, 8, 9)), Color.White * (drawRed ? 1f : 0.65f), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (i == 9) { NumberSprite.draw(skillLevel, b, new Vector2((float)(addedX + x + (i + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 3 + ((skillLevel >= 10) ? (Game1.pixelZoom * 3) : 0)), (float)(y + Game1.pixelZoom * 4 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(skillLevel, b, new Vector2((float)(addedX + x + (i + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 4 + ((skillLevel >= 10) ? (Game1.pixelZoom * 3) : 0)), (float)(y + Game1.pixelZoom * 3 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), (addedSkill ? Color.LightGreen : Color.SandyBrown) * ((skillLevel == 0) ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } } if ((i + 1) % 5 == 0) { addedX += Game1.pixelZoom * 6; } } using (List <ClickableTextureComponent> .Enumerator enumerator = this.skillBars.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.draw(b); } } foreach (ClickableTextureComponent c in this.skillBars) { if (c.scale == 0f) { IClickableMenu.drawTextureBox(b, c.bounds.X - Game1.tileSize / 4 - Game1.pixelZoom * 2, c.bounds.Y - Game1.tileSize / 4 - Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Color.White); b.Draw(Game1.mouseCursors, new Vector2((float)(c.bounds.X - Game1.pixelZoom * 2), (float)(c.bounds.Y - Game1.tileSize / 2 + Game1.tileSize / 4)), new Rectangle?(new Rectangle(this.professionImage % 6 * 16, 624 + this.professionImage / 6 * 16, 16, 16)), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } Game1.drawDialogueBox(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)this.height / 2f) - Game1.tileSize / 2, this.width - Game1.tileSize - IClickableMenu.spaceToClearSideBorder * 2, this.height / 4 + Game1.tileSize, false, true, null, false); base.drawBorderLabel(b, "Wallet", Game1.smallFont, this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 3 / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)this.height / 2f) - Game1.tileSize / 2); using (List <ClickableTextureComponent> .Enumerator enumerator = this.specialItems.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.draw(b); } } if (this.hoverText.Length > 0) { IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, (this.hoverTitle.Length > 0) ? this.hoverTitle : null, -1, null, null, 0, -1, -1, -1, -1, 1f, null); } }
public override void draw(SpriteBatch b) { this.performHoverAction(Game1.getMouseX(), Game1.getMouseY()); int num3 = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru ? this.xPositionOnScreen + this.width - Game1.tileSize * 7 - Game1.tileSize * 3 / 4 : this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - 8; int num4 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 2; int num5 = 0; //foreach skill rank... for (int index1 = 0; index1 < 10; ++index1) { //there's only one skill to draw here. int index2 = this.skillOrderIndex; bool flag1 = EquivalentExchange.instance.currentPlayerData.AlchemyLevel > index1; bool flag2 = EquivalentExchange.instance.showLevelUpMenusByRank.Count > 0; string text = (index1 == 0 ? "Alchemy" : ""); int number = EquivalentExchange.instance.currentPlayerData.AlchemyLevel; Rectangle rectangle = Rectangle.Empty; //alchemy skill text if (!text.Equals("")) { b.DrawString(Game1.smallFont, text, new Vector2((float)num3 - Game1.smallFont.MeasureString(text).X + (float)Game1.pixelZoom - (float)Game1.tileSize, (float)(num4 + Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Game1.textColor); //I think this is the drop shadow for the skill icon b.Draw(DrawingUtil.alchemySkillIcon, new Vector2((float)(num3 - Game1.pixelZoom * 14), (float)(num4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle(0, 0, 10, 10), Color.Black * 0.3f, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); //I think this is the actual skill icon. b.Draw(DrawingUtil.alchemySkillIcon, new Vector2((float)(num3 - Game1.pixelZoom * 13), (float)(num4 - Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle(0, 0, 10, 10), Color.White, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } //player has doesn't have the skill yet and the next square is a profession rank if (!flag1 && (index1 + 1) % 5 == 0) { //this is the drop shadow for profession rank 5/10 b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - Game1.pixelZoom + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); //this is the icon for profession rank 5/10 b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 - Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145 + (flag1 ? 14 : 0), 338, 14, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } //the next square NOT a profession rank else if ((index1 + 1) % 5 != 0) { //I think this is the drop shadow for the level markers b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 - Game1.pixelZoom + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); //I think this is the golden bit that covers the drop shadow. b.Draw(Game1.mouseCursors, new Vector2((float)(num5 + num3 + index1 * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num4 - Game1.pixelZoom + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129 + (flag1 ? 8 : 0), 338, 8, 9)), Color.White * (flag1 ? 1f : 0.65f), 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } //i == 9; (i + 1) == 10, not sure what this is doing. if (index1 == 9) { NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 3 + (number >= 10 ? Game1.pixelZoom * 3 : 0)), (float)(num4 + Game1.pixelZoom * 4 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(number, b, new Vector2((float)(num5 + num3 + (index1 + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 4 + (number >= 10 ? Game1.pixelZoom * 3 : 0)), (float)(num4 + Game1.pixelZoom * 3 + index2 * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), (flag2 ? Color.LightGreen : Color.SandyBrown) * (number == 0 ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } //makes the next square a fatty, I think. if ((index1 + 1) % 5 == 0) { num5 += Game1.pixelZoom * 6; } } foreach (ClickableTextureComponent skillBar in this.skillBars) { skillBar.draw(b); } foreach (ClickableTextureComponent skillBar in this.skillBars) { if ((double)skillBar.scale == 0.0) { IClickableMenu.drawTextureBox(b, skillBar.bounds.X - Game1.tileSize / 4 - Game1.pixelZoom * 2, skillBar.bounds.Y - Game1.tileSize / 4 - Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Color.White); //I think this is the hover over profession icon. b.Draw(professionImage, new Vector2((float)(skillBar.bounds.X - Game1.pixelZoom * 2), (float)(skillBar.bounds.Y - Game1.tileSize / 2 + Game1.tileSize / 4)), new Rectangle(0, 0, 16, 16), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } Game1.drawDialogueBox(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)this.height / 2.0) - Game1.tileSize / 2, this.width - Game1.tileSize - IClickableMenu.spaceToClearSideBorder * 2, this.height / 4 + Game1.tileSize, false, true, (string)null, false); this.drawBorderLabel(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11610"), Game1.smallFont, this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 3 / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)this.height / 2.0) - Game1.tileSize / 2); if (this.hoverText.Length <= 0) { return; } IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, this.hoverTitle.Length > 0 ? this.hoverTitle : (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null); }
public override void draw(SpriteBatch b) { this.UpdateInventory(); var currentPage = this.GetCurrentPage(); foreach (var c in currentPage.Keys) { if (c.hoverText.Equals(AVAILABLE)) { c.draw(b, Color.White, 0.89f); if (currentPage[c].numberProducedPerCraft > 1) { NumberSprite.draw(currentPage[c].numberProducedPerCraft, b, new Vector2((float)(c.bounds.X + 64 - 2), (float)(c.bounds.Y + 64 - 2)), Color.Red, (float)(0.5 * ((double)c.scale / 4.0)), 0.97f, 1f, 0, 0); } } else if (c.hoverText.Equals(UNKNOWN)) { c.draw(b, new Color(0f, 0f, 0f, 0.1f), 0.89f); } else { c.draw(b, Color.Gray * 0.4f, 0.89f); } } foreach (var c in this.categories.Keys) { var boxColor = Color.White; var textColor = Game1.textColor; if (c.name.Equals(UNAVAILABLE)) { boxColor = Color.Gray; } IClickableMenu.drawTextureBox(b, Game1.menuTexture, new Rectangle(0, 256, 60, 60), c.bounds.X, c.bounds.Y, c.bounds.Width, c.bounds.Height + Game1.tileSize / 16, boxColor); b.DrawString(Game1.smallFont, c.label, new Vector2(c.bounds.X + Game1.tileSize / 4, c.bounds.Y + Game1.tileSize / 4), textColor); } if (this.upButton != null) { this.upButton.draw(b); } if (this.downButton != null) { this.downButton.draw(b); } this.inventory.draw(b); this.oldButton.draw(b, this.readyToClose() ? Color.White : Color.Gray, 0.89f); this.trashCan.draw(b); b.Draw( Game1.mouseCursors, new Vector2(this.trashCan.bounds.X + 60, this.trashCan.bounds.Y + 40), new Rectangle(564 + Game1.player.trashCanLevel * 18, 129, 18, 10), Color.White, this.trashCanLidRotation, new Vector2(16f, 10f), 4f, SpriteEffects.None, 0.86f); if (this.hoverItem != null) { IClickableMenu.drawToolTip( b, this.hoverText, this.hoverTitle, this.hoverItem, this.heldItem != null); } else if (this.hoverText != null) { IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, (this.heldItem != null) ? Game1.tileSize : 0, (this.heldItem != null) ? Game1.tileSize : 0); } if (this.heldItem != null) { this.heldItem.drawInMenu(b, new Vector2( Game1.getOldMouseX() + Game1.tileSize / 4, Game1.getOldMouseY() + Game1.tileSize / 4), 1f); } if (this.hoverRecipe != null) { IEnumerable <Item> extraItems = this._materialContainers?.SelectMany(chest => chest.items); IClickableMenu.drawHoverText(b, " ", Game1.smallFont, Game1.tileSize * 3 / 4, Game1.tileSize * 3 / 4, -1, this.hoverRecipe.name, -1, null, null, 0, -1, -1, -1, -1, 1f, this.hoverRecipe, extraItems?.ToList()); } else if (this.categoryText != null) { IClickableMenu.drawHoverText(b, this.categoryText, Game1.smallFont); } }
public override void draw(SpriteBatch b) { if (cooking) { Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen, width, height, false, true, null, false, false); } drawHorizontalPartition(b, yPositionOnScreen + borderWidth + spaceToClearTopBorder + 256, false); inventory.draw(b); if (trashCan != null) { trashCan.draw(b); b.Draw(Game1.mouseCursors, new Vector2(trashCan.bounds.X + 60, trashCan.bounds.Y + 40), new Rectangle(686, 256, 18, 10), Color.White, trashCanLidRotation, new Vector2(16f, 10f), 4f, SpriteEffects.None, 0.86f); } b.End(); b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, null); foreach (ClickableTextureComponent key in pagesOfCraftingRecipes[currentCraftingPage].Keys) { if (key.hoverText.Equals("ghosted")) { key.draw(b, Color.Black * 0.35f, 0.89f); } else if (!pagesOfCraftingRecipes[currentCraftingPage][key].doesFarmerHaveIngredientsInInventory(cooking ? fridge() : null)) { key.draw(b, Color.LightGray * 0.4f, 0.89f); } else { key.draw(b); if (pagesOfCraftingRecipes[currentCraftingPage][key].numberProducedPerCraft > 1) { NumberSprite.draw(pagesOfCraftingRecipes[currentCraftingPage][key].numberProducedPerCraft, b, new Vector2(key.bounds.X + 64 - 2, key.bounds.Y + 64 - 2), Color.Red, 0.5f * (key.scale / 4f), 0.97f, 1f, 0, 0); } } } b.End(); b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, null); if (hoverItem != null) { drawToolTip(b, hoverText, hoverTitle, hoverItem, heldItem != null, -1, 0, -1, -1, null, -1); } else if (!string.IsNullOrEmpty(hoverText)) { drawHoverText(b, hoverText, Game1.smallFont, (heldItem != null) ? 64 : 0, (heldItem != null) ? 64 : 0, -1, null, -1, null, null, 0, -1, -1, -1, -1, 1f, null); } if (heldItem != null) { heldItem.drawInMenu(b, new Vector2(Game1.getOldMouseX() + 16, Game1.getOldMouseY() + 16), 1f); } base.draw(b); if (downButton != null && currentCraftingPage < pagesOfCraftingRecipes.Count - 1) { downButton.draw(b); } if (upButton != null && currentCraftingPage > 0) { upButton.draw(b); } if (cooking) { drawMouse(b); } if (hoverRecipe != null) { drawHoverText(b, " ", Game1.smallFont, (heldItem != null) ? 48 : 0, (heldItem != null) ? 48 : 0, -1, hoverRecipe.DisplayName, -1, (cooking && lastCookingHover != null && Game1.objectInformation[lastCookingHover.parentSheetIndex].Split('/').Length > 7) ? Game1.objectInformation[lastCookingHover.parentSheetIndex].Split('/')[7].Split(' ') : null, lastCookingHover, 0, -1, -1, -1, -1, 1f, hoverRecipe); } }
public override void draw(SpriteBatch b) { Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, null, false); int num = this.xPositionOnScreen + Game1.tileSize - Game1.pixelZoom * 3; int num2 = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder; b.Draw((Game1.timeOfDay >= 1900) ? Game1.nightbg : Game1.daybg, new Vector2((float)num, (float)num2), Color.White); Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(Game1.player.bathingClothes ? 108 : this.playerPanelFrames[this.playerPanelIndex], 0, false, false, null, false), Game1.player.bathingClothes ? 108 : this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, Game1.player.bathingClothes ? 576 : 0, 16, 32), new Vector2((float)(num + Game1.tileSize / 2), (float)(num2 + Game1.tileSize / 2)), Vector2.Zero, 0.8f, 2, Color.White, 0f, 1f, Game1.player); if (Game1.timeOfDay >= 1900) { Game1.player.FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(this.playerPanelFrames[this.playerPanelIndex], 0, false, false, null, false), this.playerPanelFrames[this.playerPanelIndex], new Rectangle(this.playerPanelFrames[this.playerPanelIndex] * 16, 0, 16, 32), new Vector2((float)(num + Game1.tileSize / 2), (float)(num2 + Game1.tileSize / 2)), Vector2.Zero, 0.8f, 2, Color.DarkBlue * 0.3f, 0f, 1f, Game1.player); } b.DrawString(Game1.smallFont, Game1.player.name, new Vector2((float)(num + Game1.tileSize) - Game1.smallFont.MeasureString(Game1.player.name).X / 2f, (float)(num2 + 3 * Game1.tileSize + 4)), Game1.textColor); b.DrawString(Game1.smallFont, Game1.player.getTitle(), new Vector2((float)(num + Game1.tileSize) - Game1.smallFont.MeasureString(Game1.player.getTitle()).X / 2f, (float)(num2 + 4 * Game1.tileSize - Game1.tileSize / 2)), Game1.textColor); num = ((LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru) ? (this.xPositionOnScreen + this.width - Game1.tileSize * 7 - Game1.tileSize * 3 / 4) : (this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - 8)); num2 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 2; int num3 = 0; for (int i = 0; i < 10; i++) { for (int j = 0; j < 5; j++) { bool flag = false; bool flag2 = false; string text = ""; int num4 = 0; Rectangle empty = Rectangle.Empty; switch (j) { case 0: flag = (Game1.player.FarmingLevel > i); if (i == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11604", new object[0]); } num4 = Game1.player.FarmingLevel; flag2 = (Game1.player.addedFarmingLevel > 0); empty = new Rectangle(10, 428, 10, 10); break; case 1: flag = (Game1.player.MiningLevel > i); if (i == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11605", new object[0]); } num4 = Game1.player.MiningLevel; flag2 = (Game1.player.addedMiningLevel > 0); empty = new Rectangle(30, 428, 10, 10); break; case 2: flag = (Game1.player.ForagingLevel > i); if (i == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11606", new object[0]); } num4 = Game1.player.ForagingLevel; flag2 = (Game1.player.addedForagingLevel > 0); empty = new Rectangle(60, 428, 10, 10); break; case 3: flag = (Game1.player.FishingLevel > i); if (i == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11607", new object[0]); } num4 = Game1.player.FishingLevel; flag2 = (Game1.player.addedFishingLevel > 0); empty = new Rectangle(20, 428, 10, 10); break; case 4: flag = (Game1.player.CombatLevel > i); if (i == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11608", new object[0]); } num4 = Game1.player.CombatLevel; flag2 = (Game1.player.addedCombatLevel > 0); empty = new Rectangle(120, 428, 10, 10); break; case 5: flag = (Game1.player.LuckLevel > i); if (i == 0) { text = Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11609", new object[0]); } num4 = Game1.player.LuckLevel; flag2 = (Game1.player.addedLuckLevel > 0); empty = new Rectangle(50, 428, 10, 10); break; } if (!text.Equals("")) { b.DrawString(Game1.smallFont, text, new Vector2((float)num - Game1.smallFont.MeasureString(text).X + (float)Game1.pixelZoom - (float)Game1.tileSize, (float)(num2 + Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Game1.textColor); b.Draw(Game1.mouseCursors, new Vector2((float)(num - Game1.pixelZoom * 14), (float)(num2 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(empty), Color.Black * 0.3f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num - Game1.pixelZoom * 13), (float)(num2 - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(empty), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (!flag && (i + 1) % 5 == 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145, 338, 14, 9)), Color.Black * 0.35f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(145 + (flag ? 14 : 0), 338, 14, 9)), Color.White * (flag ? 1f : 0.65f), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } else if ((i + 1) % 5 != 0) { b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num - Game1.pixelZoom + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129, 338, 8, 9)), Color.Black * 0.35f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.85f); b.Draw(Game1.mouseCursors, new Vector2((float)(num3 + num + i * (Game1.tileSize / 2 + Game1.pixelZoom)), (float)(num2 - Game1.pixelZoom + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), new Rectangle?(new Rectangle(129 + (flag ? 8 : 0), 338, 8, 9)), Color.White * (flag ? 1f : 0.65f), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.87f); } if (i == 9) { NumberSprite.draw(num4, b, new Vector2((float)(num3 + num + (i + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 3 + ((num4 >= 10) ? (Game1.pixelZoom * 3) : 0)), (float)(num2 + Game1.pixelZoom * 4 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), Color.Black * 0.35f, 1f, 0.85f, 1f, 0, 0); NumberSprite.draw(num4, b, new Vector2((float)(num3 + num + (i + 2) * (Game1.tileSize / 2 + Game1.pixelZoom) + Game1.pixelZoom * 4 + ((num4 >= 10) ? (Game1.pixelZoom * 3) : 0)), (float)(num2 + Game1.pixelZoom * 3 + j * (Game1.tileSize / 2 + Game1.pixelZoom * 6))), (flag2 ? Color.LightGreen : Color.SandyBrown) * ((num4 == 0) ? 0.75f : 1f), 1f, 0.87f, 1f, 0, 0); } } if ((i + 1) % 5 == 0) { num3 += Game1.pixelZoom * 6; } } using (List <ClickableTextureComponent> .Enumerator enumerator = this.skillBars.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.draw(b); } } foreach (ClickableTextureComponent current in this.skillBars) { if (current.scale == 0f) { IClickableMenu.drawTextureBox(b, current.bounds.X - Game1.tileSize / 4 - Game1.pixelZoom * 2, current.bounds.Y - Game1.tileSize / 4 - Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Game1.tileSize * 5 / 4 + Game1.pixelZoom * 4, Color.White); b.Draw(Game1.mouseCursors, new Vector2((float)(current.bounds.X - Game1.pixelZoom * 2), (float)(current.bounds.Y - Game1.tileSize / 2 + Game1.tileSize / 4)), new Rectangle?(new Rectangle(this.professionImage % 6 * 16, 624 + this.professionImage / 6 * 16, 16, 16)), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 1f); } } Game1.drawDialogueBox(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)this.height / 2f) - Game1.tileSize / 2, this.width - Game1.tileSize - IClickableMenu.spaceToClearSideBorder * 2, this.height / 4 + Game1.tileSize, false, true, null, false); base.drawBorderLabel(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:SkillsPage.cs.11610", new object[0]), Game1.smallFont, this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 3 / 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((float)this.height / 2f) - Game1.tileSize / 2); using (List <ClickableTextureComponent> .Enumerator enumerator = this.specialItems.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.draw(b); } } if (this.hoverText.Length > 0) { IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, (this.hoverTitle.Length > 0) ? this.hoverTitle : null, -1, null, null, 0, -1, -1, -1, -1, 1f, null); } }