/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.minecraft.class_437
 */
package meteordevelopment.meteorclient.gui.tabs.builtin;

import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.GuiThemes;
import meteordevelopment.meteorclient.gui.tabs.Tab;
import meteordevelopment.meteorclient.gui.tabs.TabScreen;
import meteordevelopment.meteorclient.gui.tabs.WindowTabScreen;
import meteordevelopment.meteorclient.gui.themes.meteor.MeteorGuiTheme;
import meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList;
import meteordevelopment.meteorclient.gui.widgets.pressable.WButton;
import net.minecraft.class_437;

public class CustomizeTab
extends Tab {
    public CustomizeTab() {
        super("Customize");
    }

    @Override
    public TabScreen createScreen(GuiTheme theme) {
        return new CustomizeScreen(theme, this);
    }

    @Override
    public boolean isScreen(class_437 screen) {
        return screen instanceof CustomizeScreen;
    }

    private static class CustomizeScreen
    extends WindowTabScreen {
        public CustomizeScreen(GuiTheme theme, Tab tab) {
            super(theme, tab);
            theme.settings.onActivated();
        }

        @Override
        public void initWidgets() {
            WHorizontalList opts = this.add(this.theme.horizontalList()).expandX().widget();
            opts.add(this.theme.label("Theme Settings"));
            WButton reset = opts.add(this.theme.button("Reset Everything")).right().widget();
            reset.action = () -> {
                this.theme.settings.reset();
                MeteorClient.mc.method_1507(null);
                this.tab.openScreen(GuiThemes.get());
            };
            this.add(this.theme.horizontalSeparator()).expandX();
            this.add(this.theme.settings(this.theme.settings)).expandX();
            if (this.theme instanceof MeteorGuiTheme) {
                this.add(this.theme.horizontalSeparator("Meteor Animations")).expandX();
                this.add(this.theme.label("The animations and blur can be tweaked above."));
            }
        }
    }
}

