Search in sources :

Example 1 with GuiButtonVariableDims

use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.

the class GuiMagiciansWorkbench method initGui.

@Override
public void initGui() {
    super.initGui();
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    clearGridOne = new GuiButtonVariableDims(0, l + 40, i1 + 15, "X");
    clearGridTwo = new GuiButtonVariableDims(0, l + 114, i1 + 15, "X");
    int s = 10;
    clearGridOne.setDimensions(s, s);
    clearGridTwo.setDimensions(s, s);
    this.buttonList.add(clearGridOne);
    this.buttonList.add(clearGridTwo);
}
Also used : GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Example 2 with GuiButtonVariableDims

use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.

the class GuiInscriptionTable method initGui.

@Override
public void initGui() {
    super.initGui();
    searchFieldPosition = new AMVector2(39, 59);
    searchFieldDimensions = new AMVector2(141, 12);
    searchBar = new GuiTextField(Minecraft.getMinecraft().fontRenderer, searchFieldPosition.iX, searchFieldPosition.iY, searchFieldDimensions.iX, searchFieldDimensions.iY);
    nameFieldPosition = new AMVector2(39, 93);
    nameFieldDimensions = new AMVector2(141, 12);
    nameBar = new GuiTextField(Minecraft.getMinecraft().fontRenderer, nameFieldPosition.iX, nameFieldPosition.iY, nameFieldDimensions.iX, nameFieldDimensions.iY);
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    createSpellButton = new GuiButtonVariableDims(0, l - 65, i1, StatCollector.translateToLocal("am2.gui.makeSpell"));
    createSpellButton.setDimensions(60, 20);
    resetSpellButton = new GuiButtonVariableDims(1, l + 120, i1 + 72, StatCollector.translateToLocal("am2.gui.resetSpell"));
    resetSpellButton.setDimensions(60, 20);
    resetSpellButton.visible = false;
    if (usingPlayer.capabilities.isCreativeMode) {
        this.buttonList.add(createSpellButton);
    }
    this.buttonList.add(resetSpellButton);
    nameBar.setText(((ContainerInscriptionTable) this.inventorySlots).getSpellName());
    if (nameBar.getText().equals("")) {
        nameBar.setText(defaultNameLabel);
    }
    searchBar.setText(defaultSearchLabel);
    result = ((ContainerInscriptionTable) this.inventorySlots).validateCurrentDefinition();
}
Also used : AMVector2(am2.api.math.AMVector2) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Example 3 with GuiButtonVariableDims

use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.

the class GuiHudCustomization method initGui.

@Override
public void initGui() {
    super.initGui();
    doShowBuffs = AMCore.config.getShowBuffs();
    doShowNumerics = AMCore.config.getShowNumerics();
    doShowHudMinimally = AMCore.config.showHudMinimally();
    doShowArmor = AMCore.config.showArmorUI();
    doShowXPAlways = AMCore.config.showXPAlways();
    doShowBars = AMCore.config.showHudBars();
    int barWidth = (width / 8) + 16;
    manaButton = new GuiButtonVariableDims(0, 0, 0, "").setDimensions(barWidth, 14).setBorderOnly(true);
    burnoutButton = new GuiButtonVariableDims(1, 0, 0, "").setDimensions(barWidth, 14).setBorderOnly(true);
    levelButton = new GuiButtonVariableDims(2, 0, 0, "").setDimensions(10, 10).setBorderOnly(true);
    affinityButton = new GuiButtonVariableDims(3, 0, 0, "").setDimensions(10, 20).setBorderOnly(true).setPopupText(StatCollector.translateToLocal("am2.gui.affinity"));
    positiveBuffs = new GuiButtonVariableDims(4, 0, 0, "").setPopupText(StatCollector.translateToLocal("am2.gui.positiveBuffs")).setDimensions(10, 10).setBorderOnly(true);
    negativeBuffs = new GuiButtonVariableDims(5, 0, 0, "").setPopupText(StatCollector.translateToLocal("am2.gui.negativeBuffs")).setDimensions(10, 10).setBorderOnly(true);
    armorHead = new GuiButtonVariableDims(6, 0, 0, "").setDimensions(10, 10).setPopupText(StatCollector.translateToLocal("am2.gui.headwear")).setBorderOnly(true);
    armorChest = new GuiButtonVariableDims(7, 0, 0, "").setDimensions(10, 10).setPopupText(StatCollector.translateToLocal("am2.gui.chestplate")).setBorderOnly(true);
    armorLegs = new GuiButtonVariableDims(8, 0, 0, "").setDimensions(10, 10).setPopupText(StatCollector.translateToLocal("am2.gui.leggings")).setBorderOnly(true);
    armorBoots = new GuiButtonVariableDims(9, 0, 0, "").setDimensions(10, 10).setPopupText(StatCollector.translateToLocal("am2.gui.boots")).setBorderOnly(true);
    xpBar = new GuiButtonVariableDims(10, 0, 0, "").setDimensions(182, 5).setPopupText(StatCollector.translateToLocal("am2.gui.xpBar")).setBorderOnly(true);
    contingency = new GuiButtonVariableDims(10, 0, 0, "").setDimensions(16, 16).setPopupText(StatCollector.translateToLocal("am2.gui.contingency")).setBorderOnly(true);
    showBuffs = new GuiButtonVariableDims(11, width / 2 - 90, height - 88, StatCollector.translateToLocal("am2.gui.buffTimers")).setDimensions(180, 20);
    showNumerics = new GuiButtonVariableDims(12, width / 2 - 90, height - 66, StatCollector.translateToLocal("am2.gui.numericValues")).setDimensions(180, 20);
    options = new GuiButtonVariableDims(13, width / 2 - 90, height - 22, StatCollector.translateToLocal("am2.gui.options")).setDimensions(180, 20);
    showHudMinimally = new GuiButtonVariableDims(14, width / 2 - 90, height - 110, StatCollector.translateToLocal("am2.gui.minimalHud")).setDimensions(180, 20).setPopupText(StatCollector.translateToLocal("am2.gui.minimalHudDesc"));
    showArmorUI = new GuiButtonVariableDims(15, width / 2 - 90, height - 132, StatCollector.translateToLocal("am2.gui.armorUI")).setDimensions(180, 20);
    showXPAlways = new GuiButtonVariableDims(16, width / 2 - 90, height - 154, StatCollector.translateToLocal("am2.gui.xpAlways")).setDimensions(180, 20);
    showHudBars = new GuiButtonVariableDims(17, width / 2 - 90, height - 176, StatCollector.translateToLocal("am2.gui.hudBars")).setDimensions(180, 20);
    manaNumeric = new GuiButtonVariableDims(18, 0, 0, "").setDimensions(25, 10).setPopupText(StatCollector.translateToLocal("am2.gui.manaNumeric")).setBorderOnly(true);
    burnoutNumeric = new GuiButtonVariableDims(19, 0, 0, "").setDimensions(25, 10).setPopupText(StatCollector.translateToLocal("am2.gui.burnoutNumeric")).setBorderOnly(true);
    XPNumeric = new GuiButtonVariableDims(20, 0, 0, "").setDimensions(25, 10).setPopupText(StatCollector.translateToLocal("am2.gui.XPNumeric")).setBorderOnly(true);
    spellBook = new GuiButtonVariableDims(21, 0, 0, StatCollector.translateToLocal("item.arsmagica2:spellBook.name")).setBorderOnly(true).setDimensions(106, 15);
    showBuffs.displayString = StatCollector.translateToLocal("am2.gui.buffTimers") + ": " + ((doShowBuffs) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
    showNumerics.displayString = StatCollector.translateToLocal("am2.gui.numericValues") + ": " + ((doShowNumerics) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
    showHudMinimally.displayString = StatCollector.translateToLocal("am2.gui.minimalHud") + ": " + ((doShowHudMinimally) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
    showArmorUI.displayString = StatCollector.translateToLocal("am2.gui.armorUI") + ": " + ((doShowArmor) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
    showXPAlways.displayString = StatCollector.translateToLocal("am2.gui.xpAlways") + ": " + ((doShowXPAlways) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
    showHudBars.displayString = StatCollector.translateToLocal("am2.gui.hudBars") + ": " + ((doShowBars) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
    positiveBuffs.enabled = doShowBuffs;
    negativeBuffs.enabled = doShowBuffs;
    manaNumeric.enabled = doShowNumerics;
    burnoutNumeric.enabled = doShowNumerics;
    XPNumeric.enabled = doShowNumerics;
    manaButton.enabled = doShowBars;
    burnoutButton.enabled = doShowBars;
    armorHead.enabled = doShowArmor;
    armorChest.enabled = doShowArmor;
    armorLegs.enabled = doShowArmor;
    armorBoots.enabled = doShowArmor;
    initButtonAndSnapData(manaButton, AMCore.config.getManaHudPosition());
    //new AMVector2(0.5, 0.5)
    initButtonAndSnapData(burnoutButton, AMCore.config.getBurnoutHudPosition());
    initButtonAndSnapData(levelButton, AMCore.config.getLevelPosition());
    initButtonAndSnapData(affinityButton, AMCore.config.getAffinityPosition());
    initButtonAndSnapData(positiveBuffs, AMCore.config.getPositiveBuffsPosition());
    initButtonAndSnapData(negativeBuffs, AMCore.config.getNegativeBuffsPosition());
    initButtonAndSnapData(armorHead, AMCore.config.getArmorPositionHead());
    initButtonAndSnapData(armorChest, AMCore.config.getArmorPositionChest());
    initButtonAndSnapData(armorLegs, AMCore.config.getArmorPositionLegs());
    initButtonAndSnapData(armorBoots, AMCore.config.getArmorPositionBoots());
    initButtonAndSnapData(xpBar, AMCore.config.getXPBarPosition());
    initButtonAndSnapData(contingency, AMCore.config.getContingencyPosition());
    initButtonAndSnapData(manaNumeric, AMCore.config.getManaNumericPosition());
    initButtonAndSnapData(burnoutNumeric, AMCore.config.getBurnoutNumericPosition());
    initButtonAndSnapData(XPNumeric, AMCore.config.getXPNumericPosition());
    initButtonAndSnapData(spellBook, AMCore.config.getSpellBookPosition());
    setOptionsVisibility(false);
    this.buttonList.add(showBuffs);
    this.buttonList.add(showNumerics);
    this.buttonList.add(options);
    this.buttonList.add(showHudMinimally);
    this.buttonList.add(showArmorUI);
    this.buttonList.add(showXPAlways);
    this.buttonList.add(showHudBars);
}
Also used : GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Example 4 with GuiButtonVariableDims

use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.

the class GuiHudCustomization method mouseClicked.

@Override
protected void mouseClicked(int par1, int par2, int par3) {
    super.mouseClicked(par1, par2, par3);
    for (Object button : this.buttonList) {
        if (button instanceof GuiButtonVariableDims) {
            if (((GuiButtonVariableDims) button).mousePressed(mc, par1, par2)) {
                if (button == showBuffs) {
                    doShowBuffs = !doShowBuffs;
                    showBuffs.displayString = StatCollector.translateToLocal("am2.gui.buffTimers") + ": " + ((doShowBuffs) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
                    positiveBuffs.enabled = doShowBuffs;
                    negativeBuffs.enabled = doShowBuffs;
                    storeGuiPositions();
                } else if (button == showNumerics) {
                    doShowNumerics = !doShowNumerics;
                    showNumerics.displayString = StatCollector.translateToLocal("am2.gui.numericValues") + ": " + ((doShowNumerics) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
                    manaNumeric.enabled = doShowNumerics;
                    burnoutNumeric.enabled = doShowNumerics;
                    XPNumeric.enabled = doShowNumerics;
                    storeGuiPositions();
                } else if (button == showHudMinimally) {
                    doShowHudMinimally = !doShowHudMinimally;
                    showHudMinimally.displayString = StatCollector.translateToLocal("am2.gui.minimalHud") + ": " + ((doShowHudMinimally) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
                    storeGuiPositions();
                } else if (button == options) {
                    showOptions = !showOptions;
                    setOptionsVisibility(showOptions);
                } else if (button == showXPAlways) {
                    doShowXPAlways = !doShowXPAlways;
                    showXPAlways.displayString = StatCollector.translateToLocal("am2.gui.xpAlways") + ": " + ((doShowXPAlways) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
                    storeGuiPositions();
                } else if (button == showHudBars) {
                    doShowBars = !doShowBars;
                    showHudBars.displayString = StatCollector.translateToLocal("am2.gui.hudBars") + ": " + ((doShowBars) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
                    manaButton.enabled = doShowBars;
                    burnoutButton.enabled = doShowBars;
                    storeGuiPositions();
                } else if (button == showArmorUI) {
                    doShowArmor = !doShowArmor;
                    showArmorUI.displayString = StatCollector.translateToLocal("am2.gui.armorUI") + ": " + ((doShowHudMinimally) ? StatCollector.translateToLocal("am2.gui.yes") : StatCollector.translateToLocal("am2.gui.no"));
                    armorHead.enabled = doShowArmor;
                    armorChest.enabled = doShowArmor;
                    armorLegs.enabled = doShowArmor;
                    armorBoots.enabled = doShowArmor;
                    storeGuiPositions();
                } else if (!showOptions) {
                    dragTarget = (GuiButtonVariableDims) button;
                    AMVector2 buttonPos = ((GuiButtonVariableDims) button).getPosition();
                    AMVector2 mousePos = new AMVector2(par1, par2);
                    dragOffset = mousePos.subtract(buttonPos);
                }
            }
        }
    }
}
Also used : AMVector2(am2.api.math.AMVector2) GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Example 5 with GuiButtonVariableDims

use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.

the class GuiParticleEmitter method initGui.

@Override
public void initGui() {
    btnParticleType = new GuiButtonVariableDims(10, 50, 40, AMParticle.particleTypes[tile.getParticleType()]);
    btnParticleBehaviour = new GuiButtonVariableDims(11, 50, 60, ParticleController.AuraControllerOptions[tile.getParticleBehaviour()]);
    btnParticleColorMode = new GuiButtonVariableDims(12, 50, 80, tile.getColorDefault() ? StatCollector.translateToLocal("am2.gui.default") : tile.getColorRandom() ? StatCollector.translateToLocal("am2.gui.random") : StatCollector.translateToLocal("am2.gui.custom"));
    hideBlock = new GuiButtonVariableDims(19, 50, 100, tile.getShow() ? StatCollector.translateToLocal("am2.gui.visible") : StatCollector.translateToLocal("am2.gui.hidden"));
    btnParticleType.setDimensions(80, 20);
    btnParticleBehaviour.setDimensions(80, 20);
    btnParticleColorMode.setDimensions(80, 20);
    hideBlock.setDimensions(80, 20);
    sliParticleScale = new GuiSlideControl(14, width - 110, 40, 100, StatCollector.translateToLocal("am2.gui.scale"), tile.getScale() * 100, 1f, 200f);
    sliParticleAlpha = new GuiSlideControl(15, width - 110, 60, 100, StatCollector.translateToLocal("am2.gui.alpha"), tile.getAlpha() * 100, 1f, 100f);
    sliParticleRed = new GuiSlideControl(16, width - 110, 80, 100, StatCollector.translateToLocal("am2.gui.red"), (tile.getColor() >> 16) & 0xFF, 0f, 255f);
    sliParticleRed.setInteger(true);
    sliParticleGreen = new GuiSlideControl(17, width - 110, 100, 100, StatCollector.translateToLocal("am2.gui.green"), (tile.getColor() >> 8) & 0xFF, 0f, 255f);
    sliParticleGreen.setInteger(true);
    sliParticleBlue = new GuiSlideControl(18, width - 110, 120, 100, StatCollector.translateToLocal("am2.gui.blue"), tile.getColor() & 0xFF, 0f, 255f);
    sliParticleBlue.setInteger(true);
    sliParticleQuantity = new GuiSlideControl(20, width - 110, 140, 100, StatCollector.translateToLocal("am2.gui.qty"), tile.getQuantity(), 1, 5);
    sliParticleQuantity.setInteger(true);
    sliParticleDelay = new GuiSlideControl(21, width - 110, 160, 100, StatCollector.translateToLocal("am2.gui.delay"), tile.getDelay(), 1, 100);
    sliParticleDelay.setInteger(true);
    sliParticleSpeed = new GuiSlideControl(22, width - 110, 180, 100, StatCollector.translateToLocal("am2.gui.speed"), 1.0f, 0.25f, 10.0f);
    if (tile.getColorDefault() || tile.getColorRandom()) {
        sliParticleRed.enabled = false;
        sliParticleBlue.enabled = false;
        sliParticleGreen.enabled = false;
    } else {
        sliParticleRed.enabled = true;
        sliParticleBlue.enabled = true;
        sliParticleGreen.enabled = true;
    }
    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, StatCollector.translateToLocal("am2.gui.done")));
    this.buttonList.add(btnParticleType);
    this.buttonList.add(btnParticleBehaviour);
    this.buttonList.add(btnParticleColorMode);
    this.buttonList.add(sliParticleScale);
    this.buttonList.add(sliParticleAlpha);
    this.buttonList.add(sliParticleRed);
    this.buttonList.add(sliParticleGreen);
    this.buttonList.add(sliParticleBlue);
    this.buttonList.add(hideBlock);
    this.buttonList.add(sliParticleDelay);
    this.buttonList.add(sliParticleQuantity);
    this.buttonList.add(sliParticleSpeed);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiSlideControl(am2.guis.controls.GuiSlideControl) GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Aggregations

GuiButtonVariableDims (am2.guis.controls.GuiButtonVariableDims)8 AMVector2 (am2.api.math.AMVector2)2 GuiSlideControl (am2.guis.controls.GuiSlideControl)2 GuiButton (net.minecraft.client.gui.GuiButton)2 GuiTextField (net.minecraft.client.gui.GuiTextField)2 ContainerSpellCustomization (am2.containers.ContainerSpellCustomization)1 GuiButtonCompendiumNext (am2.guis.controls.GuiButtonCompendiumNext)1 GuiButtonCompendiumTab (am2.guis.controls.GuiButtonCompendiumTab)1 GuiSpellImageButton (am2.guis.controls.GuiSpellImageButton)1 IIcon (net.minecraft.util.IIcon)1