using Decimation.Lib.Items;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Decimation.Content.Debug
{
    public class DebugHitboxItem : DecimationItem
    {
        public override string Texture => "Terraria/Item_" + ItemID.Acorn;
        protected override string ItemName => "Debug Hitbox";

        protected override void Init()
        {
        }

        public override bool UseItem(Player player)
        {
            DebugHitbox.debugging = !DebugHitbox.debugging;

            return true;
        }
    }

    internal class DebugHitbox : GlobalNPC
    {
        public static bool debugging;

        public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor)
        {
            if (debugging) npc.DrawDebugHitbox(spriteBatch);

            return base.PreDraw(npc, spriteBatch, drawColor);
        }
    }
}