Search in sources :

Example 31 with GuiButtonExt

use of net.minecraftforge.fml.client.config.GuiButtonExt in project MC-Prefab by Brian-Wuest.

the class GuiWareHouse method Initialize.

@Override
public void Initialize() {
    this.configuration = ClientEventHandler.playerConfig.getClientConfig(this.clientGUIIdentifier, WareHouseConfiguration.class);
    this.configuration.pos = this.pos;
    this.configuration.houseFacing = EnumFacing.NORTH;
    // Get the upper left hand corner of the GUI box.
    int grayBoxX = this.getCenteredXAxis() - 180;
    int grayBoxY = this.getCenteredYAxis() - 83;
    // Create the buttons.
    this.btnGlassColor = new GuiButtonExt(10, grayBoxX + 10, grayBoxY + 20, 90, 20, GuiLangKeys.translateDye(this.configuration.dyeColor));
    this.buttonList.add(this.btnGlassColor);
    this.btnVisualize = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 90, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW));
    this.buttonList.add(this.btnVisualize);
    // Create the done and cancel buttons.
    this.btnBuild = new GuiButtonExt(1, grayBoxX + 10, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_BUILD));
    this.buttonList.add(this.btnBuild);
    this.btnCancel = new GuiButtonExt(2, grayBoxX + 147, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_CANCEL));
    this.buttonList.add(this.btnCancel);
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt) WareHouseConfiguration(com.wuest.prefab.Config.Structures.WareHouseConfiguration)

Example 32 with GuiButtonExt

use of net.minecraftforge.fml.client.config.GuiButtonExt in project MC-Prefab by Brian-Wuest.

the class GuiHorseStable method Initialize.

@Override
protected void Initialize() {
    this.configuration = ClientEventHandler.playerConfig.getClientConfig("Horse Stable", HorseStableConfiguration.class);
    this.configuration.pos = this.pos;
    // Get the upper left hand corner of the GUI box.
    int grayBoxX = (this.width / 2) - 213;
    int grayBoxY = (this.height / 2) - 83;
    // Create the buttons.
    this.btnVisualize = new GuiButtonExt(4, grayBoxX + 10, grayBoxY + 20, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW));
    this.buttonList.add(this.btnVisualize);
    // Create the done and cancel buttons.
    this.btnBuild = new GuiButtonExt(1, grayBoxX + 10, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_BUILD));
    this.buttonList.add(this.btnBuild);
    this.btnCancel = new GuiButtonExt(2, grayBoxX + 147, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_CANCEL));
    this.buttonList.add(this.btnCancel);
}
Also used : HorseStableConfiguration(com.wuest.prefab.Config.Structures.HorseStableConfiguration) GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt)

Example 33 with GuiButtonExt

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

the class GuiBiomesEditor method initGui.

@Override
public void initGui() {
    if (biomeList == null) {
        biomeList = new BiomeList();
        refreshBiomes(manager.getCaveBiomes().values());
    }
    biomeList.setDimensions(width, height, 32, height - (editMode ? 95 : 28));
    if (doneButton == null) {
        doneButton = new GuiButtonExt(0, 0, 0, 65, 20, I18n.format("gui.done"));
    }
    doneButton.x = width / 2 + 135;
    doneButton.y = height - doneButton.height - 4;
    if (editButton == null) {
        editButton = new GuiButtonExt(1, 0, 0, doneButton.width, doneButton.height, I18n.format("gui.edit"));
        editButton.enabled = false;
    }
    editButton.x = doneButton.x - doneButton.width - 3;
    editButton.y = doneButton.y;
    editButton.enabled = biomeList.selected != null;
    editButton.visible = !editMode;
    if (cancelButton == null) {
        cancelButton = new GuiButtonExt(2, 0, 0, editButton.width, editButton.height, I18n.format("gui.cancel"));
    }
    cancelButton.x = editButton.x;
    cancelButton.y = editButton.y;
    cancelButton.visible = editMode;
    if (removeButton == null) {
        removeButton = new GuiButtonExt(4, 0, 0, doneButton.width, doneButton.height, I18n.format("gui.remove"));
    }
    removeButton.x = editButton.x - editButton.width - 3;
    removeButton.y = doneButton.y;
    removeButton.visible = !editMode;
    if (addButton == null) {
        addButton = new GuiButtonExt(3, 0, 0, doneButton.width, doneButton.height, I18n.format("gui.add"));
    }
    addButton.x = removeButton.x - removeButton.width - 3;
    addButton.y = doneButton.y;
    addButton.visible = !editMode;
    if (clearButton == null) {
        clearButton = new GuiButtonExt(5, 0, 0, removeButton.width, removeButton.height, I18n.format("gui.clear"));
    }
    clearButton.x = removeButton.x;
    clearButton.y = removeButton.y;
    clearButton.visible = false;
    if (detailInfo == null) {
        detailInfo = new GuiCheckBox(6, 0, 5, I18n.format(Config.LANG_KEY + "detail"), true);
    }
    detailInfo.setIsChecked(CaveConfigGui.detailInfo);
    detailInfo.x = width / 2 + 95;
    if (instantFilter == null) {
        instantFilter = new GuiCheckBox(7, 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);
    if (editMode) {
        buttonList.add(cancelButton);
    } else {
        buttonList.add(editButton);
        buttonList.add(addButton);
        buttonList.add(removeButton);
        buttonList.add(clearButton);
    }
    buttonList.add(detailInfo);
    buttonList.add(instantFilter);
    if (filterTextField == null) {
        filterTextField = new GuiTextField(0, fontRenderer, 0, 0, 122, 16);
        filterTextField.setMaxStringLength(500);
    }
    filterTextField.x = width / 2 - 200;
    filterTextField.y = height - filterTextField.height - 6;
    detailHoverChecker = new HoverChecker(detailInfo, 800);
    instantHoverChecker = new HoverChecker(instantFilter, 800);
    editLabelList.clear();
    editLabelList.add(I18n.format(Config.LANG_KEY + "biomes.weight"));
    editLabelList.add(I18n.format(Config.LANG_KEY + "biomes.terrainBlock"));
    editLabelList.add("");
    editLabelList.add(I18n.format(Config.LANG_KEY + "biomes.topBlock"));
    editLabelList.add("");
    for (String key : editLabelList) {
        maxLabelWidth = Math.max(maxLabelWidth, fontRenderer.getStringWidth(key));
    }
    if (weightField == null) {
        weightField = new GuiTextField(1, fontRenderer, 0, 0, 0, 15);
        weightField.setMaxStringLength(3);
    }
    int i = maxLabelWidth + 8 + width / 2;
    weightField.x = width / 2 - i / 2 + maxLabelWidth + 10;
    weightField.y = biomeList.bottom + 7;
    weightField.width = width / 2 + i / 2 - 45 - weightField.x + 40;
    if (terrainBlockField == null) {
        terrainBlockField = new GuiTextField(2, fontRenderer, 0, 0, 0, weightField.height);
        terrainBlockField.setMaxStringLength(100);
    }
    terrainBlockField.x = weightField.x;
    terrainBlockField.y = weightField.y + weightField.height + 5;
    terrainBlockField.width = weightField.width / 4 + weightField.width / 2 - 1;
    if (terrainBlockMetaField == null) {
        terrainBlockMetaField = new GuiTextField(3, fontRenderer, 0, 0, 0, terrainBlockField.height);
        terrainBlockMetaField.setMaxStringLength(100);
    }
    terrainBlockMetaField.x = terrainBlockField.x + terrainBlockField.width + 3;
    terrainBlockMetaField.y = terrainBlockField.y;
    terrainBlockMetaField.width = weightField.width / 4 - 1;
    if (topBlockField == null) {
        topBlockField = new GuiTextField(4, fontRenderer, 0, 0, 0, terrainBlockField.height);
        topBlockField.setMaxStringLength(100);
    }
    topBlockField.x = terrainBlockField.x;
    topBlockField.y = terrainBlockMetaField.y + terrainBlockMetaField.height + 5;
    topBlockField.width = terrainBlockField.width;
    if (topBlockMetaField == null) {
        topBlockMetaField = new GuiTextField(5, fontRenderer, 0, 0, 0, topBlockField.height);
        topBlockMetaField.setMaxStringLength(100);
    }
    topBlockMetaField.x = terrainBlockMetaField.x;
    topBlockMetaField.y = topBlockField.y;
    topBlockMetaField.width = terrainBlockMetaField.width;
    editFieldList.clear();
    if (editMode) {
        editFieldList.add(weightField);
        editFieldList.add(terrainBlockField);
        editFieldList.add(terrainBlockMetaField);
        editFieldList.add(topBlockField);
        editFieldList.add(topBlockMetaField);
    }
    weightHoverChecker = new HoverChecker(weightField.y - 1, weightField.y + weightField.height, weightField.x - maxLabelWidth - 12, weightField.x - 10, 800);
    terrainBlockHoverChecker = new HoverChecker(terrainBlockField.y - 1, terrainBlockField.y + terrainBlockField.height, terrainBlockField.x - maxLabelWidth - 12, terrainBlockField.x - 10, 800);
    topBlockHoverChecker = new HoverChecker(topBlockField.y - 1, topBlockField.y + topBlockField.height, topBlockField.x - maxLabelWidth - 12, topBlockField.x - 10, 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 34 with GuiButtonExt

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

the class GuiSelectItem method initGui.

@Override
public void initGui() {
    if (itemList == null) {
        itemList = new ItemList();
    }
    itemList.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 35 with GuiButtonExt

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

the class GuiSelectMirageWorlds method initGui.

@Override
public void initGui() {
    if (worldList == null) {
        worldList = new WorldList();
    }
    worldList.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 - doneButton.width / 2;
    doneButton.y = height - doneButton.height - 4;
    buttonList.clear();
    buttonList.add(doneButton);
}
Also used : GuiButtonExt(net.minecraftforge.fml.client.config.GuiButtonExt)

Aggregations

GuiButtonExt (net.minecraftforge.fml.client.config.GuiButtonExt)46 HoverChecker (net.minecraftforge.fml.client.config.HoverChecker)11 GuiCheckBox (net.minecraftforge.fml.client.config.GuiCheckBox)10 GuiTextField (net.minecraft.client.gui.GuiTextField)9 GuiButton (net.minecraft.client.gui.GuiButton)4 GuiTooltip (org.blockartistry.lib.gui.GuiTooltip)4 GuiCheckBox (com.wuest.prefab.Gui.Controls.GuiCheckBox)3 GuiTab (com.wuest.prefab.Gui.Controls.GuiTab)2 GuiLabel (net.minecraft.client.gui.GuiLabel)2 GuiSlider (net.minecraftforge.fml.client.config.GuiSlider)2 IStructureConfigurationCapability (com.wuest.prefab.Capabilities.IStructureConfigurationCapability)1 BasicStructureConfiguration (com.wuest.prefab.Config.Structures.BasicStructureConfiguration)1 BulldozerConfiguration (com.wuest.prefab.Config.Structures.BulldozerConfiguration)1 ChickenCoopConfiguration (com.wuest.prefab.Config.Structures.ChickenCoopConfiguration)1 FishPondConfiguration (com.wuest.prefab.Config.Structures.FishPondConfiguration)1 HorseStableConfiguration (com.wuest.prefab.Config.Structures.HorseStableConfiguration)1 InstantBridgeConfiguration (com.wuest.prefab.Config.Structures.InstantBridgeConfiguration)1 ModerateHouseConfiguration (com.wuest.prefab.Config.Structures.ModerateHouseConfiguration)1 ModularHouseConfiguration (com.wuest.prefab.Config.Structures.ModularHouseConfiguration)1 MonsterMasherConfiguration (com.wuest.prefab.Config.Structures.MonsterMasherConfiguration)1