package dev.dfonline.codeclient.config;

import com.google.gson.JsonObject;
import dev.dfonline.codeclient.CodeClient;
import dev.dfonline.codeclient.FileManager;
import dev.isxander.yacl3.api.ConfigCategory;
import dev.isxander.yacl3.api.Option;
import dev.isxander.yacl3.api.OptionDescription;
import dev.isxander.yacl3.api.OptionFlag;
import dev.isxander.yacl3.api.OptionGroup;
import dev.isxander.yacl3.api.YetAnotherConfigLib;
import dev.isxander.yacl3.api.controller.ColorControllerBuilder;
import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder;
import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder;
import dev.isxander.yacl3.api.controller.IntegerSliderControllerBuilder;
import dev.isxander.yacl3.api.controller.TickBoxControllerBuilder;
import dev.isxander.yacl3.gui.controllers.cycling.EnumController;
import dev.isxander.yacl3.impl.controller.IntegerFieldControllerBuilderImpl;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

import java.awt.Color;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

public class Config {
    private static Config instance;
    public boolean NoClipEnabled = false;
    public boolean PlaceOnAir = false;
    public int AirSpeed = 10;
    public boolean CCDBUG = true;
    public boolean CustomBlockInteractions = true;
    public boolean AutoJoin = false;
    public Node AutoNode = Node.None;
    public boolean AutoJoinPlot = false;
    public int AutoJoinPlotId = 0;
    public boolean AutoFly = false;
    public LayerInteractionMode CodeLayerInteractionMode = LayerInteractionMode.AUTO;
    public boolean RecentChestInsert = true;
    public int ChestHighlightColor = 0x51FFFF;
    public boolean HighlightChestsWithAir = false;
    public int HighlightChestDuration = 10;
    public boolean CustomBlockBreaking = false;
    public boolean ReportBrokenBlock = true;
    public float UpAngle = 50;
    public float DownAngle = 50;
    public boolean TeleportUp = false;
    public boolean TeleportDown = false;
    public int Line1Color = 0xAAAAAA;
    public int Line2Color = 0xC5C5C5;
    public int Line3Color = 0xAAFFAA;
    public int Line4Color = 0xFF8800;
    public DestroyItemReset DestroyItemResetMode = DestroyItemReset.OFF;
    public boolean DevNodes = false;
    public boolean GiveUuidNameStrings = true;
    public boolean CPUDisplay = true;
    public CPUDisplayCornerOption CPUDisplayCorner = CPUDisplayCornerOption.TOP_LEFT;
    public boolean HideScopeChangeMessages = true;
    public boolean StateSwitcher = true;
    public boolean SpeedSwitcher = true;

    public Config() {
    }

    public static Config getConfig() {
        if (instance == null) {
            try {
                instance = CodeClient.gson.fromJson(FileManager.readConfig(), Config.class);
            } catch (Exception exception) {
                CodeClient.LOGGER.info("Config didn't load: " + exception);
                CodeClient.LOGGER.info("Making a new one.");
                instance = new Config();
                instance.save();
            }
        }
        return instance;
    }

    public static void clear() {
        instance = null;
    }

    public void save() {
        try {
            JsonObject object = new JsonObject();
            object.addProperty("NoClipEnabled", NoClipEnabled);
            object.addProperty("AirSpeed", AirSpeed);
            object.addProperty("PlaceOnAir", PlaceOnAir);
            object.addProperty("CCDBUG", CCDBUG);
            object.addProperty("CustomBlockInteractions", CustomBlockInteractions);
            object.addProperty("AutoJoin", AutoJoin);
            object.addProperty("AutoNode", AutoNode.name());
            object.addProperty("AutoJoinPlot", AutoJoinPlot);
            object.addProperty("AutoJoinPlotId", AutoJoinPlotId);
            object.addProperty("AutoFly", AutoFly);
            object.addProperty("CodeLayerInteractionMode", CodeLayerInteractionMode.name());
            object.addProperty("RecentChestInsert", RecentChestInsert);
            object.addProperty("HighlightChestsWithAir", HighlightChestsWithAir);
            object.addProperty("HighlightChestDuration", HighlightChestDuration);
            object.addProperty("ChestHighlightColor", ChestHighlightColor);
            object.addProperty("CustomBlockBreaking", CustomBlockBreaking);
            object.addProperty("ReportBrokenBlock", ReportBrokenBlock);
            object.addProperty("UpAngle", UpAngle);
            object.addProperty("DownAngle", DownAngle);
            object.addProperty("TeleportUp", TeleportUp);
            object.addProperty("TeleportDown", TeleportDown);
            object.addProperty("Line1Color", Line1Color);
            object.addProperty("Line2Color", Line2Color);
            object.addProperty("Line3Color", Line3Color);
            object.addProperty("Line4Color", Line4Color);
            object.addProperty("DestroyItemResetMode", DestroyItemResetMode.name());
            object.addProperty("DevNodes", DevNodes);
            object.addProperty("GiveUuidNameStrings", GiveUuidNameStrings);
            object.addProperty("CPUDisplay", CPUDisplay);
            object.addProperty("CPUDisplayCorner", CPUDisplayCorner.name());
            object.addProperty("HideScopeChangeMessages", HideScopeChangeMessages);
            object.addProperty("StateSwitcher", StateSwitcher);
            object.addProperty("SpeedSwitcher", SpeedSwitcher);

            FileManager.writeConfig(object.toString());
        } catch (Exception e) {
            CodeClient.LOGGER.info("Couldn't save config: " + e);
        }
    }

    public YetAnotherConfigLib getLibConfig() {
        return YetAnotherConfigLib.createBuilder()
                .title(Text.translatable("codeclient.config"))
                //<editor-fold desc="General">
                .category(ConfigCategory.createBuilder()
                        .name(Text.translatable("codeclient.config.tab.general"))
                        .tooltip(Text.translatable("codeclient.config.tab.general.tooltip"))
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.ccdbug"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.ccdbug.description"))
                                        .build())
                                .binding(
                                        true,
                                        () -> CCDBUG,
                                        opt -> CCDBUG = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        //<editor-fold desc="AutoJoin">
                        .group(OptionGroup.createBuilder()
                                .name(Text.translatable("codeclient.config.autojoin"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.autojoin.description")))
                                .collapsed(false)
                                .option(Option.createBuilder(boolean.class)
                                        .name(Text.translatable("codeclient.config.autojoin.enabled"))
                                        .description(OptionDescription.createBuilder()
                                                .text(Text.translatable("codeclient.config.autojoin.enabled.description"))
                                                .build())
                                        .binding(
                                                false,
                                                () -> AutoJoin,
                                                opt -> AutoJoin = opt
                                        )
                                        .controller(TickBoxControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(Node.class)
                                        .name(Text.translatable("codeclient.config.autojoin.node"))
                                        .description(OptionDescription.createBuilder()
                                                .text(Text.translatable("codeclient.config.autojoin.node.description"))
                                                .build())
                                        .binding(
                                                Node.None,
                                                () -> AutoNode,
                                                opt -> AutoNode = opt
                                        )
                                        .controller(nodeOption -> () -> new EnumController<>(nodeOption, Node.class))
//                                .available(AutoJoin)
                                        .build())
                                .option(Option.createBuilder(boolean.class)
                                        .name(Text.translatable("codeclient.config.autojoin.plot"))
                                        .description(OptionDescription.createBuilder()
                                                .text(Text.translatable("codeclient.config.autojoin.plot.description1"))
                                                .text(Text.translatable("codeclient.config.autojoin.plot.description2"))
                                                .build())
                                        .binding(
                                                false,
                                                () -> AutoJoinPlot,
                                                opt -> AutoJoinPlot = opt
                                        )
                                        .controller(TickBoxControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(int.class)
                                        .name(Text.translatable("codeclient.config.autojoin.plotid"))
                                        .description(OptionDescription.createBuilder()
                                                .text(Text.translatable("codeclient.config.autojoin.plotid.description"))
                                                .build())
                                        .binding(
                                                0,
                                                () -> AutoJoinPlotId,
                                                opt -> AutoJoinPlotId = opt
                                        )
                                        .controller(IntegerFieldControllerBuilder::create)
                                        .build())
                                .build())
                        //</editor-fold>
                        .build())
                //</editor-fold>
                //<editor-fold desc="Navigation">
                .category(ConfigCategory.createBuilder()
                        .name(Text.translatable("codeclient.config.tab.navigation"))
                        .tooltip(Text.translatable("codeclient.config.tab.navigation.description"))
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.noclip"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.noclip.description"))
                                        .build())
                                .binding(
                                        false,
                                        () -> NoClipEnabled,
                                        opt -> NoClipEnabled = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(int.class)
                                .name(Text.translatable("codeclient.config.airstrafe_modifier"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.airstrafe_modifier.description1"))
                                        .text(Text.translatable("codeclient.config.airstrafe_modifier.description2"))
                                        .build())
                                .binding(
                                        10,
                                        () -> AirSpeed,
                                        opt -> AirSpeed = opt
                                )
                                .controller(opt -> IntegerSliderControllerBuilder.create(opt)
                                        .range(0, 30)
                                        .step(1))
                                .build())
                        .option(Option.createBuilder(float.class)
                                .name(Text.translatable("codeclient.config.angle_up"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.angle_up.description"), Text.translatable("codeclient.config.requires_noclip")))
                                .binding(
                                        50F,
                                        () -> UpAngle,
                                        opt -> UpAngle = opt
                                )
                                .controller(opt -> FloatSliderControllerBuilder.create(opt).range(0F, 180F).step(1F))
                                .build())
                        .option(Option.createBuilder(float.class)
                                .name(Text.translatable("codeclient.config.angle_down"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.angle_down.description"), Text.translatable("codeclient.config.requires_noclip")))
                                .binding(50F,
                                        () -> DownAngle,
                                        opt -> DownAngle = opt
                                )
                                .controller(opt -> FloatSliderControllerBuilder.create(opt).range(0F, 180F).step(1F))
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.tp_up"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.tp_up.description"), Text.translatable("codeclient.config.requires_noclip")))
                                .binding(
                                        false,
                                        () -> TeleportUp,
                                        opt -> TeleportUp = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.tp_down"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.tp_down.description"), Text.translatable("codeclient.config.requires_noclip")))
                                .binding(
                                        false,
                                        () -> TeleportDown,
                                        opt -> TeleportDown = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .build())
                //</editor-fold>
                //<editor-fold desc="Interaction">
                .category(ConfigCategory.createBuilder()
                        .name(Text.translatable("codeclient.config.tab.interaction"))
                        .tooltip(Text.translatable("codeclient.config.tab.interaction.description"))
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.custom_block_interaction"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.custom_block_interaction.description1"))
                                        .text(Text.translatable("codeclient.config.custom_block_interaction.description2"))
                                        .build())
                                .binding(
                                        true,
                                        () -> CustomBlockInteractions,
                                        opt -> CustomBlockInteractions = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.custom_block_breaking"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.custom_block_breaking.description1"), Text.translatable("codeclient.config.custom_block_breaking.description2"), Text.translatable("codeclient.config.custom_block_breaking.description3")))
                                .binding(
                                        false,
                                        () -> CustomBlockBreaking,
                                        opt -> CustomBlockBreaking = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.place_on_air"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.place_on_air.description1"))
                                        .text(Text.translatable("codeclient.config.place_on_air.description2").formatted(Formatting.YELLOW, Formatting.BOLD))
                                        .build())
                                .binding(
                                        false,
                                        () -> PlaceOnAir,
                                        opt -> PlaceOnAir = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
//                                .option(Option.createBuilder(float.class)
//                                        .name(Text.literal("Reach Distance"))
//                                        .description(OptionDescription.createBuilder()
//                                                .text(Text.literal("Extend your reach distance, moving you forward if you can't reach."))
//                                                .build())
//                                        .binding(
//                                                5f,
//                                                () -> ReachDistance,
//                                                opt -> ReachDistance = opt
//                                        )
//                                        .controller(opt -> FloatSliderControllerBuilder.create(opt)
//                                                .range(5f, 10f)
//                                                .step(0.1f))
//                                        .available(false)
//                                        .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.report_broken_blocks"))
                                .description(
                                        OptionDescription.of(Text.translatable("codeclient.config.report_broken_blocks.description1"), Text.translatable("codeclient.config.report_broken_blocks.description2")))
                                .binding(
                                        true,
                                        () -> ReportBrokenBlock,
                                        opt -> ReportBrokenBlock = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(LayerInteractionMode.class)
                                .name(Text.translatable("codeclient.config.layer_interaction"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.layer_interaction.description"))
                                        .text(Text.of(CodeLayerInteractionMode.description))
                                        .build())
                                .binding(
                                        LayerInteractionMode.AUTO,
                                        () -> CodeLayerInteractionMode,
                                        opt -> CodeLayerInteractionMode = opt
                                )
                                .controller(nodeOption -> () -> new EnumController<>(nodeOption, LayerInteractionMode.class))
                                .build())
                        .option(Option.createBuilder(DestroyItemReset.class)
                                .name(Text.translatable("codeclient.config.destroy_item_reset.name"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.destroy_item_reset.description")))
                                .binding(
                                        DestroyItemReset.OFF,
                                        () -> DestroyItemResetMode,
                                        opt -> DestroyItemResetMode = opt
                                )
                                .controller(nodeOption -> () -> new EnumController<>(nodeOption, DestroyItemReset.class))
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.givestrings"))
                                .description(OptionDescription.createBuilder()
                                        .text(Text.translatable("codeclient.config.givestrings.description"))
                                        .build())
                                .binding(
                                        true,
                                        () -> GiveUuidNameStrings,
                                        opt -> GiveUuidNameStrings = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.state_switcher"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.state_switcher.description")))
                                .binding(
                                        true,
                                        () -> StateSwitcher,
                                        opt -> StateSwitcher = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(boolean.class)
                                .name(Text.translatable("codeclient.config.speed_switcher"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.speed_switcher.description")))
                                .binding(
                                        true,
                                        () -> SpeedSwitcher,
                                        opt -> SpeedSwitcher = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .build())
                //</editor-fold>
                //<editor-fold desc="Visual">
                .category(ConfigCategory.createBuilder()
                        .name(Text.translatable("codeclient.config.tab.visual"))
                        .tooltip(Text.translatable("codeclient.config.tab.visual.description"))
                        //<editor-fold desc="Ungrouped">
                        .option(Option.createBuilder(Boolean.class)
                                .name(Text.translatable("codeclient.config.cpu_display"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.cpu_display.description")))
                                .binding(
                                        true,
                                        () -> CPUDisplay,
                                        opt -> CPUDisplay = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        .option(Option.createBuilder(CPUDisplayCornerOption.class)
                                .name(Text.translatable("codeclient.config.cpu_display_corner.name"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.cpu_display_corner.description")))
                                .binding(
                                        CPUDisplayCornerOption.TOP_LEFT,
                                        () -> CPUDisplayCorner,
                                        opt -> CPUDisplayCorner = opt
                                )
                                .controller(nodeOption -> () -> new EnumController<>(nodeOption, CPUDisplayCornerOption.class))
                                .build())
                        .option(Option.createBuilder(Boolean.class)
                                .name(Text.translatable("codeclient.config.hide_scope_change_messages"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.hide_scope_change_messages.description")))
                                .binding(
                                        true,
                                        () -> HideScopeChangeMessages,
                                        opt -> HideScopeChangeMessages = opt
                                )
                                .controller(TickBoxControllerBuilder::create)
                                .build())
                        //</editor-fold>
                        //<editor-fold desc="Chest Highlight">
                        .group(OptionGroup.createBuilder()
                                .name(Text.translatable("codeclient.config.chest_highlight"))
                                .description(OptionDescription.of(
                                        Text.translatable("codeclient.config.chest_highlight.description1"),
                                        Text.translatable("codeclient.config.chest_highlight.description2")))
                                .option(Option.createBuilder(Boolean.class)
                                        .name(Text.translatable("codeclient.config.chest_highlight.enable"))
                                        .description(OptionDescription.createBuilder()
                                                .text(Text.translatable("codeclient.config.chest_highlight.enable.description"))
                                                .build())
                                        .binding(
                                                true,
                                                () -> RecentChestInsert,
                                                opt -> RecentChestInsert = opt
                                        )
                                        .controller(TickBoxControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(Boolean.class)
                                        .name(Text.translatable("codeclient.config.chest_highlight.with_empty_hand"))
                                        .description(OptionDescription.of(Text.translatable("codeclient.config.chest_highlight.with_empty_hand.description")))
                                        .binding(
                                                false,
                                                () -> HighlightChestsWithAir,
                                                opt -> HighlightChestsWithAir = opt
                                        )
                                        .controller(TickBoxControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(int.class)
                                        .name(Text.translatable("codeclient.config.chest_highlight.duration"))
                                        .description(OptionDescription.of(Text.translatable("codeclient.config.chest_highlight.duration.description1"), Text.translatable("codeclient.config.chest_highlight.duration.description2")))
                                        .binding(
                                                10,
                                                () -> HighlightChestDuration,
                                                opt -> HighlightChestDuration = opt
                                        )
                                        .controller(integerOption -> new IntegerFieldControllerBuilderImpl(integerOption).min(1))
                                        .build())
                                .option(Option.createBuilder(Color.class)
                                        .name(Text.translatable("codeclient.config.chest_highlight.color"))
                                        .description(OptionDescription.createBuilder()
                                                .text(Text.translatable("codeclient.config.chest_highlight.color.description"))
                                                .build())
                                        .binding(
                                                new Color(0.2F, 1.0F, 1.0F),
                                                () -> new Color(ChestHighlightColor),
                                                opt -> ChestHighlightColor = opt.getRGB()
                                        )
                                        .controller(ColorControllerBuilder::create)
                                        .build())
                                .build())
                        //</editor-fold>
                        //<editor-fold desc="Sign Colors">
                        .group(OptionGroup.createBuilder()
                                .name(Text.translatable("codeclient.config.sign_color"))
                                .description(OptionDescription.of(Text.translatable("codeclient.config.sign_color.description1"), Text.translatable("codeclient.config.sign_color.description2")))
                                .option(Option.createBuilder(Color.class)
                                        .name(Text.translatable("codeclient.config.sign_color.line1"))
                                        .description(OptionDescription.of(Text.translatable("codeclient.config.sign_color.line1.description1"), Text.translatable("codeclient.config.sign_color.line1.description2")))
                                        .binding(
                                                new Color(0xAAAAAA),
                                                () -> new Color(Line1Color),
                                                opt -> Line1Color = opt.getRGB()
                                        )
                                        .controller(ColorControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(Color.class)
                                        .name(Text.translatable("codeclient.config.sign_color.line2"))
                                        .description(OptionDescription.of(Text.translatable("codeclient.config.sign_color.line2.description1"), Text.translatable("codeclient.config.sign_color.line2.description2")))
                                        .binding(
                                                new Color(0xC5C5C5),
                                                () -> new Color(Line2Color),
                                                opt -> Line2Color = opt.getRGB()
                                        )
                                        .controller(ColorControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(Color.class)
                                        .name(Text.translatable("codeclient.config.sign_color.line3"))
                                        .description(OptionDescription.of(Text.translatable("codeclient.config.sign_color.line3.description1"), Text.translatable("codeclient.config.sign_color.line3.description2")))
                                        .binding(
                                                new Color(0xAAFFAA),
                                                () -> new Color(Line3Color),
                                                opt -> Line3Color = opt.getRGB()
                                        )
                                        .controller(ColorControllerBuilder::create)
                                        .build())
                                .option(Option.createBuilder(Color.class)
                                        .name(Text.translatable("codeclient.config.sign_color.line4"))
                                        .description(OptionDescription.of(Text.translatable("codeclient.config.sign_color.line4.description1"), Text.translatable("codeclient.config.sign_color.line4.description2")))
                                        .binding(
                                                new Color(0xFF8800),
                                                () -> new Color(Line4Color),
                                                opt -> Line4Color = opt.getRGB()
                                        )
                                        .controller(ColorControllerBuilder::create)
                                        .build())
                                .build())
                        //</editor-fold>
                        .build())
                //</editor-fold>
                .save(this::save)
                .build();
    }

    public enum Node {
        None(""),
        Node1("node1."),
        Node2("node2."),
        Node3("node3."),
        Node4("node4."),
        Node5("node5."),
        Node6("node6."),
        Node7("node7."),
        Beta("beta.");

        public final String prepend;

        Node(String prepend) {
            this.prepend = prepend;
        }
    }

    public enum CharSetOption {
        ISO_8859_1(StandardCharsets.ISO_8859_1),
        UTF_8(StandardCharsets.UTF_8);

        public final Charset charSet;

        CharSetOption(Charset charSet) {
            this.charSet = charSet;
        }
    }

    public enum LayerInteractionMode {
        OFF("No changes."),
        AUTO("Code layers are custom when you are above them."),
        ON("Code layers are always custom.");

        public final String description;

        LayerInteractionMode(String description) {
            this.description = description;
        }
    }

    public enum ActionViewerAlignment {
        CENTER,
        TOP
    }

    public enum DestroyItemReset {
        OFF(null),
        STANDARD("rs"),
        COMPACT("rc");

        public String command;

        DestroyItemReset(String command) {
            this.command = command;
        }
    }

    public enum CPUDisplayCornerOption {
        TOP_LEFT,
        TOP_RIGHT,
        BOTTOM_LEFT,
        BOTTOM_RIGHT
    }

    public enum AutoUpdate {
        OFF,
        NOTIFY,
        UPDATE,
    }
}
