using Godot;

namespace ReactorMaintenance.Godot.Screens;

public partial class OptionsScreen : ScreenBase
{
    public void Configure(AppController app)
    {
        var body = CreatePage("Options");
        body.Alignment = BoxContainer.AlignmentMode.Center;

        body.AddChild(CreateSlider("Master Volume"));
        body.AddChild(CreateSlider("Music Volume"));
        body.AddChild(new CheckBox { Text = "Fullscreen" });
        body.AddChild(new OptionButton { Text = "UI Scale" });
        body.AddChild(CreateButton("Back", app.ShowMainMenu));
    }

    private static HBoxContainer CreateSlider(string label)
    {
        var row = new HBoxContainer { CustomMinimumSize = new(360, 40), SizeFlagsHorizontal = SizeFlags.ShrinkCenter };
        row.AddChild(new Label { Text = label, CustomMinimumSize = new(140, 0) });
        row.AddChild(new HSlider { MinValue = 0, MaxValue = 100, Value = 75, SizeFlagsHorizontal = SizeFlags.ExpandFill });
        return row;
    }
}