using GraphicsManager.Enums;
using GraphicsManager.Objects;
using OpenTK.Mathematics;

namespace Luski.GUI.MainScreen.UI.LuskiControls;

public class VersionDropButton : DropDownOption
{
    public Label l;

    public VersionDropButton(Vector2i size, string v)
    :base(Globals.ms.TextureManager.GetTextureResource("RoundedRectangle.png"))
    {
        base.Size = size;
        TextureDisplay = TextureDisplay.HorizontalCenter;
        Shader = Rectangle.DefaultAlphaShader[Globals.ms.Context];
        l = new Label(Globals.DefaultFont)
        {
            Text = v,
            Color = Color4.DarkGray,
            IgnoreHover = true
        };
        l.Location = new((base.Size.X / 2) - (l.Size.X / 2),
            ((base.Size.Y - l.Size.Y) / 2)
            , 0);
        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;
        };
    }
}