using Microsoft.Xna.Framework;
using Monocle;
using Celeste;
using Celeste.Mod.Entities;

namespace Celeste.Mod.membrane;

[CustomEntity("membrane/ColorgradeTrigger")]
public class ColorgradeTrigger : Trigger
{
    private readonly string colorgrade;

    public ColorgradeTrigger(EntityData data, Vector2 offset)
        : base(data, offset)
    {
        colorgrade = data.Attr("colorgrade", "none");
    }

    public override void OnEnter(Player player)
    {
        base.OnEnter(player);

        Level level = SceneAs<Level>();

        level.Session.ColorGrade = colorgrade;
    }
}