Fixed festival names not showing up on Billboard. Also player can now have b-day on festival days and have it display properly.

This commit is contained in:
Joshua Navarro 2018-12-06 00:54:12 -08:00
parent fa04c757ed
commit a6ad717d5e
1 changed files with 20 additions and 7 deletions

View File

@ -122,22 +122,35 @@ namespace Omegasis.HappyBirthday
//Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 1f, 4f, 2, Game1.player); //Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 1f, 4f, 2, Game1.player);
string hoverText = ""; string hoverText = "";
List<string> texts = new List<string>();
foreach (var clicky in (Game1.activeClickableMenu as Billboard).calendarDays) foreach (var clicky in (Game1.activeClickableMenu as Billboard).calendarDays)
{ {
if (clicky.containsPoint(Game1.getMouseX(), Game1.getMouseY())) if (clicky.containsPoint(Game1.getMouseX(), Game1.getMouseY()))
{ {
if (String.IsNullOrEmpty(clicky.hoverText)) continue; if (!String.IsNullOrEmpty(clicky.hoverText))
hoverText += clicky.hoverText + Environment.NewLine; {
} texts.Add(clicky.hoverText); //catches npc birhday names.
else }
{ else if (!String.IsNullOrEmpty(clicky.name))
//hoverText = ""; {
texts.Add(clicky.name); //catches festival dates.
}
} }
} }
for(int i = 0; i< texts.Count; i++)
{
hoverText += texts[i]; //Append text.
if (i == texts.Count - 1) continue;
else
{
hoverText += Environment.NewLine; //Append new line.
}
}
if (!String.IsNullOrEmpty(hoverText)) if (!String.IsNullOrEmpty(hoverText))
{ {
hoverText=hoverText.Remove(hoverText.Length - 2, 1);
var oldText = Helper.Reflection.GetField<string>(Game1.activeClickableMenu, "hoverText", true); var oldText = Helper.Reflection.GetField<string>(Game1.activeClickableMenu, "hoverText", true);
oldText.SetValue(hoverText); oldText.SetValue(hoverText);
} }