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

namespace Luski.GUI.MainScreen.UI.LuskiSettings.Pages.AdvancedSettings;

public class ExperimentSettings : PageFlow
{
    public ExperimentSettings()
    {
        base.Size = new(500.ScaleInt());
        PageName = "Experiments";
        ExperimentGUI? g = null;
        foreach (ExperimentInfo exp in Globals.Experiments)
        {
            g = new(exp);
            Controls.Add(g);
            Controls.Add(new Rectangle()
            {
                Size = new(base.Size.X - 2, 1.ScaleInt()),
                BackgroundColor = Color4.Gray,
                Location = new(1, base.Size.Y - 1.ScaleInt()),
                Anchor = ObjectAnchor.Left | ObjectAnchor.Right | ObjectAnchor.Bottom
            });
        }

        if (g is not null)
        {
            g.dd.WindowLoaded += _ =>
            {
                ParentResize();
                return Task.CompletedTask;
            };
        }
    }
}