private void Display_RenderedActiveMenu(object sender, StardewModdingAPI.Events.RenderedActiveMenuEventArgs e) { if (!Config.ShowNumbers || Game1.activeClickableMenu == null || !(Game1.activeClickableMenu is DialogueBox) || !Helper.Reflection.GetField <bool>(Game1.activeClickableMenu, "isQuestion").GetValue()) { return; } DialogueBox db = Game1.activeClickableMenu as DialogueBox; if (Helper.Reflection.GetField <int>(db, "characterIndexInDialogue").GetValue() < db.getCurrentString().Length - 1 || Helper.Reflection.GetField <bool>(db, "transitioning").GetValue()) { return; } int x = Helper.Reflection.GetField <int>(Game1.activeClickableMenu, "x").GetValue(); int y = Helper.Reflection.GetField <int>(Game1.activeClickableMenu, "y").GetValue(); int heightForQuestions = Helper.Reflection.GetField <int>(Game1.activeClickableMenu, "heightForQuestions").GetValue(); List <Response> responses = Helper.Reflection.GetField <List <Response> >(Game1.activeClickableMenu, "responses").GetValue(); int count = responses.Count; int responseY = y - (heightForQuestions - Game1.activeClickableMenu.height) + SpriteText.getHeightOfString((Game1.activeClickableMenu as DialogueBox).getCurrentString(), Game1.activeClickableMenu.width - 16) + 44; for (int i = 0; i < count; i++) { e.SpriteBatch.DrawString(Game1.dialogueFont, $"{i + 1}", new Vector2(x, responseY), Config.NumberColor, 0, Vector2.Zero, 0.4f, SpriteEffects.None, 0.86f); responseY += SpriteText.getHeightOfString(responses[i].responseText, Game1.activeClickableMenu.width) + 16; } }
private void Display_RenderedActiveMenu(object sender, StardewModdingAPI.Events.RenderedActiveMenuEventArgs e) { foreach (var text in sparklingTexts) { text.Item1.draw(e.SpriteBatch, text.Item2); } }
/// <summary> /// Event handler to render the hover tooltip to the screen after the rest of the SpriteBatch is drawn. /// </summary> /// <param name="sender">The object from which the event originated.</param> /// <param name="e">These are the arguments sent along with the event from SMAPI, used to access the SpriteBatch.</param> private void Display_RenderedActiveMenu(object sender, StardewModdingAPI.Events.RenderedActiveMenuEventArgs e) { GameMenu menu = Game1.activeClickableMenu as GameMenu; if (menu != null && menu.currentTab == 0) { if (hoverText != "") { IClickableMenu.drawToolTip(e.SpriteBatch, this.hoverText, "", null); } } }
private static void Display_RenderedActiveMenu(object sender, StardewModdingAPI.Events.RenderedActiveMenuEventArgs e) { comp.Draw(e.SpriteBatch); }