コード例 #1
0
        public static void Display_RenderedHud(object sender, RenderedHudEventArgs e)
        {
            if (Game1.player.currentLocation.Name == "ScubaAbigailCave")
            {
                if (abigailTicks > 0 && abigailTicks < 80000 / 16)
                {
                    SwimUtils.MakeOxygenBar((80000 / 16) - abigailTicks, 80000 / 16);
                }
                e.SpriteBatch.Draw(ModEntry.OxygenBarTexture, new Vector2((int)Math.Round(Game1.viewport.Width * 0.13f), 100), Color.White);
                return;
            }
            int maxOx = SwimUtils.MaxOxygen();

            if (ModEntry.oxygen < maxOx)
            {
                SwimUtils.MakeOxygenBar(ModEntry.oxygen, maxOx);
                e.SpriteBatch.Draw(ModEntry.OxygenBarTexture, new Vector2((int)Math.Round(Game1.viewport.Width * 0.13f), 100), Color.White);
            }
        }
コード例 #2
0
        public static void Display_RenderedHud(object sender, RenderedHudEventArgs e)
        {
            if (Game1.player.currentLocation.Name == "ScubaAbigailCave")
            {
                if (abigailTicks > 0 && abigailTicks < 30 * 5)
                {
                    e.SpriteBatch.Draw(Game1.mouseCursors, new Vector2(Game1.viewport.Width, Game1.viewport.Height) / 2 - new Vector2(78, 31) / 2, new Rectangle?(new Rectangle(353, 1649, 78, 31)), new Color(255, 255, 255, abigailTicks > 30 * 3 ? (int)Math.Round(255 * (abigailTicks - 90) / 60f) : 255), 0f, Vector2.Zero, 3f, SpriteEffects.None, 0.99f);
                }
                if (abigailTicks > 0 && abigailTicks < 80000 / 16)
                {
                    SwimUtils.MakeOxygenBar((80000 / 16) - abigailTicks, 80000 / 16);
                }
                e.SpriteBatch.Draw(ModEntry.OxygenBarTexture, new Vector2((int)Math.Round(Game1.viewport.Width * 0.13f), 100), Color.White);
                return;
            }
            int maxOx = SwimUtils.MaxOxygen();

            if (ModEntry.oxygen < maxOx)
            {
                SwimUtils.MakeOxygenBar(ModEntry.oxygen, maxOx);
                e.SpriteBatch.Draw(ModEntry.OxygenBarTexture, new Vector2((int)Math.Round(Game1.viewport.Width * 0.13f), 100), Color.White);
            }
        }