using GraphicsManager.Enums;
using GraphicsManager.Interfaces;
using GraphicsManager.Objects;
using GraphicsManager.Objects.Core;
using Luski.Classes;
using Luski.GUI.MainScreen.UI.LuskiControls;
using OpenTK.Mathematics;

namespace Luski.GUI.MainScreen.UI.SettingsPanel;

public class ExperimentDropButton : DropDownOption
{
    private Label l, d;
    public ExperimentSelectorInfo ESI;

    public ExperimentDropButton(ExperimentSelectorInfo esi)
    :base(CategoryButton.seltec!)
    {
        ESI = esi;
        base.Size = new(297.ScaleInt(), 40.ScaleInt());
        TextureDisplay = TextureDisplay.HorizontalCenter;
        Shader = Rectangle.DefaultAlphaShader[Globals.ms.Context];
        l = new Label(Globals.DefaultFont)
        {
            Text = esi.Name,
            Color = Color4.DarkGray,
            IgnoreHover = true
        };
        l.Location = new(10.ScaleInt(),
            ((base.Size.Y - l.Size.Y) / 2)
            , 0);
        d = new(Globals.MessageFont)
        {
            Text = esi.Description,
            Color = Color4.Gray,
            IgnoreHover = true
        };
        d.Location = new(l.Location.X + l.Size.X + l.Location.X,
            l.Location.Y + (int)l.Font.PixelHeight - (int)d.Font.PixelHeight
            , 0);
        Controls.Add(d);
        Controls.Add(l);
        BackgroundColor = new(0, 0, 0, 0);
        MouseEnter += o =>
        {
            BackgroundColor = new(141, 151, 165, 30);
            return Task.CompletedTask;
        };
        MouseLeave += o =>
        {
            BackgroundColor = new(0,0,0,0);
            return Task.CompletedTask;
        };
    }
}