Ejemplo n.º 1
0
        /// <summary>When a menu is open (<see cref="Game1.activeClickableMenu"/> isn't null), raised after that menu is drawn to the sprite batch but before it's rendered to the screen.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnRenderedActiveMenu(object sender, RenderedActiveMenuEventArgs e)
        {
            bool outro = false;

            //revised this so it properly draws over the canon moon. :v
            if (Game1.activeClickableMenu is ShippingMenu ourMenu)
            {
                outro = Helper.Reflection.GetField <bool>(ourMenu, "outro").GetValue();
            }

            if (Game1.showingEndOfNightStuff && !Game1.wasRainingYesterday && !outro && Game1.activeClickableMenu is ShippingMenu currMenu &&
                ModConfig.ShowMoonInEndOfNight && currMenu.currentPage == -1)
            {
                float scale = Game1.pixelZoom * 1.25f;

                if (Game1.viewport.Width < 1024)
                {
                    scale = Game1.pixelZoom * .8f;
                }
                if (Game1.viewport.Width < 810)
                {
                    scale = Game1.pixelZoom * .6f;
                }
                if (Game1.viewport.Width < 700)
                {
                    scale = Game1.pixelZoom * .35f;
                }

                Game1.spriteBatch.Draw(OurIcons.MoonSource, new Vector2(Game1.viewport.Width - 65 * Game1.pixelZoom, Game1.pixelZoom), OurIcons.GetNightMoonSprite(SDVMoon.GetLunarPhaseForDay(SDate.Now().AddDays(-1))), Color.LightBlue, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 1f);
            }
        }
Ejemplo n.º 2
0
 private void DrawOverMenus(object sender, EventArgs e)
 {
     //revised this so it properly draws over the canon moon. :v
     if (Game1.showingEndOfNightStuff && Game1.activeClickableMenu is ShippingMenu menu && !Game1.wasRainingYesterday)
     {
         Game1.spriteBatch.Draw(OurIcons.MoonSource, new Vector2((float)(Game1.viewport.Width - 80 * Game1.pixelZoom), (float)Game1.pixelZoom), OurIcons.GetNightMoonSprite(SDVMoon.GetLunarPhaseForDay(SDate.Now().AddDays(-1))), Color.LightBlue, 0.0f, Vector2.Zero, (float)Game1.pixelZoom * 1.5f, SpriteEffects.None, 1f);
     }
 }