Search in sources :

Example 1 with GuiCheckBox

use of net.minecraftforge.fml.client.config.GuiCheckBox in project Cavern2 by kegare.

the class GuiRegeneration method initGui.

@Override
public void initGui() {
    if (regenButton == null) {
        regenButton = new GuiButtonExt(0, 0, 0, I18n.format("cavern.regeneration.gui.regenerate"));
    }
    regenButton.x = width / 2 - 100;
    regenButton.y = height / 4 + regenButton.height + 65;
    if (cancelButton == null) {
        cancelButton = new GuiButtonExt(1, 0, 0, I18n.format("gui.cancel"));
    }
    cancelButton.x = regenButton.x;
    cancelButton.y = regenButton.y + regenButton.height + 5;
    if (backupCheckBox == null) {
        backupCheckBox = new GuiCheckBox(2, 10, 0, I18n.format("cavern.regeneration.gui.backup"), backup);
    }
    backupCheckBox.y = height - 20;
    if (cavernCheckBox == null) {
        cavernCheckBox = new GuiCheckBox(3, 10, 8, I18n.format("dimension.cavern.name"), dimensions.contains(CaveDimensions.CAVERN));
    }
    if (CaveDimensions.CAVERN == null) {
        cavernCheckBox.enabled = false;
        cavernCheckBox.setIsChecked(false);
    }
    GuiButton before = cavernCheckBox;
    if (hugeCavernCheckBox == null) {
        hugeCavernCheckBox = new GuiCheckBox(4, 10, before.y + before.height + 5, I18n.format("dimension.hugeCavern.name"), dimensions.contains(CaveDimensions.HUGE_CAVERN));
    }
    if (CaveDimensions.HUGE_CAVERN == null) {
        hugeCavernCheckBox.enabled = false;
        hugeCavernCheckBox.setIsChecked(false);
    }
    before = hugeCavernCheckBox;
    if (aquaCavernCheckBox == null) {
        aquaCavernCheckBox = new GuiCheckBox(5, 10, before.y + before.height + 5, I18n.format("dimension.aquaCavern.name"), dimensions.contains(CaveDimensions.AQUA_CAVERN));
    }
    if (CaveDimensions.AQUA_CAVERN == null) {
        aquaCavernCheckBox.enabled = false;
        aquaCavernCheckBox.setIsChecked(false);
    }
    before = aquaCavernCheckBox;
    String mirage = CaveItems.MIRAGE_BOOK.getUnlocalizedName();
    if (cavelandCheckBox == null) {
        cavelandCheckBox = new GuiCheckBox(6, 10, before.y + before.height + 5, I18n.format(mirage + ".caveland.name"), dimensions.contains(CaveDimensions.CAVELAND));
    }
    if (CaveDimensions.CAVELAND == null) {
        cavelandCheckBox.enabled = false;
        cavelandCheckBox.setIsChecked(false);
    }
    before = cavelandCheckBox;
    if (caveniaCheckBox == null) {
        caveniaCheckBox = new GuiCheckBox(7, 10, before.y + before.height + 5, I18n.format(mirage + ".cavenia.name"), dimensions.contains(CaveDimensions.CAVENIA));
    }
    if (CaveDimensions.CAVENIA == null) {
        caveniaCheckBox.enabled = false;
        caveniaCheckBox.setIsChecked(false);
    }
    before = caveniaCheckBox;
    if (frostMountainsCheckBox == null) {
        frostMountainsCheckBox = new GuiCheckBox(8, 10, before.y + before.height + 5, I18n.format(mirage + ".frostMountains.name"), dimensions.contains(CaveDimensions.FROST_MOUNTAINS));
    }
    if (CaveDimensions.FROST_MOUNTAINS == null) {
        frostMountainsCheckBox.enabled = false;
        frostMountainsCheckBox.setIsChecked(false);
    }
    before = frostMountainsCheckBox;
    if (wideDesertCheckBox == null) {
        wideDesertCheckBox = new GuiCheckBox(9, 10, before.y + before.height + 5, I18n.format(mirage + ".wideDesert.name"), dimensions.contains(CaveDimensions.WIDE_DESERT));
    }
    if (CaveDimensions.WIDE_DESERT == null) {
        wideDesertCheckBox.enabled = false;
        wideDesertCheckBox.setIsChecked(false);
    }
    before = wideDesertCheckBox;
    if (theVoidCheckBox == null) {
        theVoidCheckBox = new GuiCheckBox(10, 10, before.y + before.height + 5, I18n.format(mirage + ".theVoid.name"), dimensions.contains(CaveDimensions.THE_VOID));
    }
    if (CaveDimensions.THE_VOID == null) {
        theVoidCheckBox.enabled = false;
        theVoidCheckBox.setIsChecked(false);
    }
    before = theVoidCheckBox;
    if (darkForestCheckBox == null) {
        darkForestCheckBox = new GuiCheckBox(11, 10, before.y + before.height + 5, I18n.format(mirage + ".darkForest.name"), dimensions.contains(CaveDimensions.DARK_FOREST));
    }
    if (CaveDimensions.DARK_FOREST == null) {
        darkForestCheckBox.enabled = false;
        darkForestCheckBox.setIsChecked(false);
    }
    before = darkForestCheckBox;
    if (crownCliffsCheckBox == null) {
        crownCliffsCheckBox = new GuiCheckBox(12, 10, before.y + before.height + 5, I18n.format(mirage + ".crownCliffs.name"), dimensions.contains(CaveDimensions.CROWN_CLIFFS));
    }
    if (CaveDimensions.CROWN_CLIFFS == null) {
        crownCliffsCheckBox.enabled = false;
        crownCliffsCheckBox.setIsChecked(false);
    }
    before = crownCliffsCheckBox;
    buttonList.clear();
    buttonList.add(regenButton);
    buttonList.add(cancelButton);
    buttonList.add(backupCheckBox);
    buttonList.add(cavernCheckBox);
    buttonList.add(hugeCavernCheckBox);
    buttonList.add(aquaCavernCheckBox);
    buttonList.add(cavelandCheckBox);
    buttonList.add(caveniaCheckBox);
    buttonList.add(frostMountainsCheckBox);
    buttonList.add(wideDesertCheckBox);
    buttonList.add(theVoidCheckBox);
    buttonList.add(darkForestCheckBox);
    buttonList.add(crownCliffsCheckBox);
    if (backupHoverChecker == null) {
        backupHoverChecker = new HoverChecker(backupCheckBox, 800);
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(net.minecraftforge.fml.client.config.GuiCheckBox) HoverChecker(net.minecraftforge.fml.client.config.HoverChecker)

Example 2 with GuiCheckBox

use of net.minecraftforge.fml.client.config.GuiCheckBox in project Cavern2 by kegare.

the class GuiMiningRecords method initGui.

@Override
public void initGui() {
    if (recordList == null) {
        recordList = new RecordList();
    }
    recordList.setDimensions(width, height, 32, height - 28);
    if (doneButton == null) {
        doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done"));
    }
    doneButton.x = width / 2 + 10;
    doneButton.y = height - doneButton.height - 4;
    if (detailInfo == null) {
        detailInfo = new GuiCheckBox(1, 0, 12, I18n.format(Config.LANG_KEY + "detail"), true);
    }
    detailInfo.setIsChecked(CaveConfigGui.detailInfo);
    detailInfo.x = width / 2 + 95;
    buttonList.clear();
    buttonList.add(doneButton);
    buttonList.add(detailInfo);
    detailHoverChecker = new HoverChecker(detailInfo, 800);
    selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(net.minecraftforge.fml.client.config.GuiCheckBox) HoverChecker(net.minecraftforge.fml.client.config.HoverChecker)

Example 3 with GuiCheckBox

use of net.minecraftforge.fml.client.config.GuiCheckBox in project Cavern2 by kegare.

the class GuiSelectBiome method initGui.

@Override
public void initGui() {
    if (biomeList == null) {
        biomeList = new BiomeList();
    }
    biomeList.setDimensions(width, height, 32, height - 28);
    if (doneButton == null) {
        doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done"));
    }
    doneButton.x = width / 2 + 10;
    doneButton.y = height - doneButton.height - 4;
    if (detailInfo == null) {
        detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
    }
    detailInfo.setIsChecked(CaveConfigGui.detailInfo);
    detailInfo.x = width / 2 + 95;
    if (instantFilter == null) {
        instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
    }
    instantFilter.setIsChecked(CaveConfigGui.instantFilter);
    instantFilter.x = detailInfo.x;
    buttonList.clear();
    buttonList.add(doneButton);
    buttonList.add(detailInfo);
    buttonList.add(instantFilter);
    if (filterTextField == null) {
        filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
        filterTextField.setMaxStringLength(100);
    }
    filterTextField.x = width / 2 - filterTextField.width - 5;
    filterTextField.y = height - filterTextField.height - 6;
    selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
    detailHoverChecker = new HoverChecker(detailInfo, 800);
    instantHoverChecker = new HoverChecker(instantFilter, 800);
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(net.minecraftforge.fml.client.config.GuiCheckBox) GuiTextField(net.minecraft.client.gui.GuiTextField) HoverChecker(net.minecraftforge.fml.client.config.HoverChecker)

Example 4 with GuiCheckBox

use of net.minecraftforge.fml.client.config.GuiCheckBox in project Cavern2 by kegare.

the class GuiSelectBlock method initGui.

@Override
public void initGui() {
    if (blockList == null) {
        blockList = new BlockList();
    }
    blockList.setDimensions(width, height, 32, height - 28);
    boolean hasSwitch = switchEntry != null;
    int buttonWidth = hasSwitch ? 70 : 145;
    if (doneButton == null) {
        doneButton = new GuiButtonExt(0, 0, 0, buttonWidth, 20, I18n.format("gui.done"));
    }
    doneButton.x = width / 2 + 10;
    doneButton.y = height - doneButton.height - 4;
    if (switchButton == null) {
        switchButton = new GuiButtonExt(3, 0, 0, buttonWidth, 20, hasSwitch ? switchEntry.getTranslatedName() : "");
        switchButton.visible = hasSwitch;
    }
    switchButton.x = doneButton.x;
    switchButton.y = doneButton.y;
    if (hasSwitch) {
        doneButton.x += buttonWidth + 3;
    }
    if (detailInfo == null) {
        detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
    }
    detailInfo.setIsChecked(CaveConfigGui.detailInfo);
    detailInfo.x = width / 2 + 95;
    if (instantFilter == null) {
        instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
    }
    instantFilter.setIsChecked(CaveConfigGui.instantFilter);
    instantFilter.x = detailInfo.x;
    buttonList.clear();
    buttonList.add(doneButton);
    buttonList.add(switchButton);
    buttonList.add(detailInfo);
    buttonList.add(instantFilter);
    if (filterTextField == null) {
        filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
        filterTextField.setMaxStringLength(100);
    }
    filterTextField.x = width / 2 - filterTextField.width - 5;
    filterTextField.y = height - filterTextField.height - 6;
    selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
    detailHoverChecker = new HoverChecker(detailInfo, 800);
    instantHoverChecker = new HoverChecker(instantFilter, 800);
    if (switchEntry != null && mc.currentScreen == this) {
        switchEntry.getGuiScreen().setWorldAndResolution(mc, width, height);
    }
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(net.minecraftforge.fml.client.config.GuiCheckBox) GuiTextField(net.minecraft.client.gui.GuiTextField) HoverChecker(net.minecraftforge.fml.client.config.HoverChecker)

Example 5 with GuiCheckBox

use of net.minecraftforge.fml.client.config.GuiCheckBox in project Cavern2 by kegare.

the class GuiSelectMob method initGui.

@Override
public void initGui() {
    if (mobList == null) {
        mobList = new MobList();
    }
    mobList.setDimensions(width, height, 32, height - 28);
    if (doneButton == null) {
        doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done"));
    }
    doneButton.x = width / 2 + 10;
    doneButton.y = height - doneButton.height - 4;
    if (detailInfo == null) {
        detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
    }
    detailInfo.setIsChecked(CaveConfigGui.detailInfo);
    detailInfo.x = width / 2 + 95;
    if (instantFilter == null) {
        instantFilter = new GuiCheckBox(2, 0, detailInfo.y + detailInfo.height + 2, I18n.format(Config.LANG_KEY + "instant"), true);
    }
    instantFilter.setIsChecked(CaveConfigGui.instantFilter);
    instantFilter.x = detailInfo.x;
    buttonList.clear();
    buttonList.add(doneButton);
    buttonList.add(detailInfo);
    buttonList.add(instantFilter);
    if (filterTextField == null) {
        filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 150, 16);
        filterTextField.setMaxStringLength(100);
    }
    filterTextField.x = width / 2 - filterTextField.width - 5;
    filterTextField.y = height - filterTextField.height - 6;
    detailHoverChecker = new HoverChecker(detailInfo, 800);
    instantHoverChecker = new HoverChecker(instantFilter, 800);
    selectedHoverChecker = new HoverChecker(0, 20, 0, 100, 800);
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) GuiCheckBox(net.minecraftforge.fml.client.config.GuiCheckBox) GuiTextField(net.minecraft.client.gui.GuiTextField) HoverChecker(net.minecraftforge.fml.client.config.HoverChecker)

Aggregations

GuiCheckBox (net.minecraftforge.fml.client.config.GuiCheckBox)11 GuiButtonExt (net.minecraftforge.fml.client.config.GuiButtonExt)10 HoverChecker (net.minecraftforge.fml.client.config.HoverChecker)10 GuiTextField (net.minecraft.client.gui.GuiTextField)9 GuiButton (net.minecraft.client.gui.GuiButton)2