private void drawBirthdayIcon(object sender, EventArgs e)
        {
            if (Game1.eventUp)
            {
                return;
            }

            // Calculate and draw birthday icon
            foreach (GameLocation location in Game1.locations)
            {
                foreach (NPC npc in location.characters)
                {
                    if (npc.isBirthday(Game1.currentSeason, Game1.dayOfMonth))
                    {
                        // draw headshot of npc whos birthday it is
                        Rectangle rect = LocationOfTownsfolk.getHeadShot(npc);

                        int iconPositionX = IconHandler.getIconXPosition();
                        int iconPositionY = 256;

                        float scale = 2.9f;

                        Game1.spriteBatch.Draw(Game1.mouseCursors, new Vector2(iconPositionX, iconPositionY), new Rectangle(913 / 4, 1638 / 4, 16, 16), Color.White, 0, Vector2.Zero, scale, SpriteEffects.None, 1);
                        var npcMugShot = new ClickableTextureComponent(npc.name, new Rectangle(iconPositionX - 7, iconPositionY - 2, (int)(16 * scale), (int)(16 * scale)), null, npc.name, npc.sprite.Texture, rect, 2f, false);
                        npcMugShot.draw(Game1.spriteBatch);

                        if (npcMugShot.containsPoint(Game1.getMouseX(), Game1.getMouseY()))
                        {
                            string tooltip = $"{npc.name}'s Birthday";
                            IClickableMenu.drawHoverText(Game1.spriteBatch, tooltip, Game1.dialogueFont);
                        }
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Draws the dice icon
        /// </summary>
        internal void drawDiceIcon(object sender, EventArgs e)
        {
            if (Game1.eventUp)
            {
                return;
            }

            //TODO refactor this into new day
            var color = new Color(Color.White.ToVector4());

            if (Game1.dailyLuck > 0.04d)
            {
                hoverText = "You're feelin' lucky!!";
                color.B   = 155;
                color.R   = 155;
            }
            else if (Game1.dailyLuck < -0.04d)
            {
                hoverText = "Maybe you should stay home today...";
                color.B   = 155;
                color.G   = 155;
            }
            else if (-0.04d <= Game1.dailyLuck && Game1.dailyLuck < 0)
            {
                hoverText = "You're not feeling lucky at all today...";
                color.B   = 165;
                color.G   = 165;
                color.R   = 165;
                color    *= 0.8f;
            }
            else
            {
                hoverText = "Feelin' lucky... but not too lucky";
            }

            // Set icon position
            icon.bounds.X = IconHandler.getIconXPosition();

            icon.draw(Game1.spriteBatch, color, 1);
        }
        /// <summary>
        /// Draw it!
        /// </summary>
        private void drawTravelingMerchant(object sender, EventArgs e)
        {
            if (daysMerchantVisits.Contains(Game1.dayOfMonth) && Game1.eventUp == false)
            {
                var clickableTextureComponent = new ClickableTextureComponent(new Rectangle(IconHandler.getIconXPosition(), 260, 40, 40), Game1.content.Load <Texture2D>("LooseSprites\\Cursors"), new Rectangle(192, 1411, 20, 20), 2);
                clickableTextureComponent.draw(Game1.spriteBatch);

                if (clickableTextureComponent.containsPoint(Game1.getMouseX(), Game1.getMouseY()))
                {
                    string tooltip = $"Traveling merchant is in town!";
                    IClickableMenu.drawHoverText(Game1.spriteBatch, tooltip, Game1.dialogueFont);
                }
            }
        }