public void OnDrawTick(ITranslationHelper i18n) { if (this.ShouldFreezeTime(Game1.currentLocation, out bool isCave)) { CJB.DrawTextBox(5, isCave ? 100 : 5, Game1.smallFont, i18n.Get("messages.time-frozen")); } }
public void OnDrawTick(ITranslationHelper i18n) { GameLocation location = Game1.currentLocation; bool inCave = location is MineShaft || location is FarmCave; bool frozen = (this.Config.FreezeTimeInside && !location.IsOutdoors && !inCave) || (this.Config.FreezeTimeCaves && inCave); frozen = frozen || this.Config.FreezeTime; if (frozen) { CJB.DrawTextBox(5, inCave ? 100 : 5, Game1.smallFont, i18n.Get("messages.time-frozen")); } }
public override void draw(SpriteBatch spriteBatch) { if (!Game1.options.showMenuBackground) { spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f); } Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true); CJB.DrawTextBox(this.Title.bounds.X, this.Title.bounds.Y, Game1.dialogueFont, this.Title.name, 1); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null); for (int index = 0; index < this.OptionSlots.Count; ++index) { if (this.CurrentItemIndex >= 0 && this.CurrentItemIndex + index < this.Options.Count) { this.Options[this.CurrentItemIndex + index].draw(spriteBatch, this.OptionSlots[index].bounds.X, this.OptionSlots[index].bounds.Y + 5); } } spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); if (!GameMenu.forcePreventClose) { foreach (ClickableComponent tab in this.Tabs) { MenuTab tabID = this.GetTabID(tab); CJB.DrawTextBox(tab.bounds.X + tab.bounds.Width, tab.bounds.Y, Game1.smallFont, tab.label, 2, this.CurrentTab == tabID ? 1F : 0.7F); } this.UpArrow.draw(spriteBatch); this.DownArrow.draw(spriteBatch); if (this.Options.Count > CheatsMenu.ItemsPerPage) { IClickableMenu.drawTextureBox(spriteBatch, Game1.mouseCursors, new Rectangle(403, 383, 6, 6), this.ScrollbarRunner.X, this.ScrollbarRunner.Y, this.ScrollbarRunner.Width, this.ScrollbarRunner.Height, Color.White, Game1.pixelZoom, false); this.Scrollbar.draw(spriteBatch); } } if (this.HoverText != "") { IClickableMenu.drawHoverText(spriteBatch, this.HoverText, Game1.smallFont); } if (!Game1.options.hardwareCursor) { spriteBatch.Draw(Game1.mouseCursors, new Vector2(Game1.getOldMouseX(), Game1.getOldMouseY()), Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, Game1.options.gamepadControls ? 44 : 0, 16, 16), Color.White, 0f, Vector2.Zero, Game1.pixelZoom + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f); } }