Search in sources :

Example 1 with GuiSlideControl

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

the class GuiKeystone method initGui.

@Override
public void initGui() {
    super.initGui();
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    combinationName = new GuiTextField(fontRendererObj, 44, 86, 88, 16);
    int sliderMax = Math.max(0, ItemsCommonProxy.keystone.numCombinations(((ContainerKeystone) this.inventorySlots).getKeystoneStack()) - 9);
    scrollBar = new GuiSlideControl(4, l + xSize + 58, i1 + 14, 159, "", 0, 0, Math.max(sliderMax, 1));
    scrollBar.setVertical();
    scrollBar.setButtonOnly();
    scrollBar.setOverrideTexture(background);
    scrollBar.setButtonProperties(184, 193, 190, 193, 6, 15);
    scrollBar.setScale(1.0f);
    scrollBar.setNoDynamicDisplay(true);
    if (sliderMax == 0)
        scrollBar.enabled = false;
    prevCombination = new GuiStatedImageButton(3, l + 8, i1 + 86, background, 208, 192);
    nextCombination = new GuiStatedImageButton(2, l + 152, i1 + 86, background, 208, 208);
    addCombination = new GuiStatedImageButton(0, l + 26, i1 + 86, background, 208, 224);
    forgetCombination = new GuiStatedImageButton(1, l + 134, i1 + 86, background, 208, 240);
    prevCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 192);
    nextCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 208);
    addCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 224);
    forgetCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 240);
    prevCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 192);
    nextCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 208);
    addCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 224);
    forgetCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 240);
    prevCombination.setDimensions(16, 16);
    nextCombination.setDimensions(16, 16);
    addCombination.setDimensions(16, 16);
    forgetCombination.setDimensions(16, 16);
    this.buttonList.add(addCombination);
    this.buttonList.add(forgetCombination);
    this.buttonList.add(nextCombination);
    this.buttonList.add(prevCombination);
    this.buttonList.add(scrollBar);
}
Also used : GuiStatedImageButton(am2.guis.controls.GuiStatedImageButton) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiSlideControl(am2.guis.controls.GuiSlideControl)

Example 2 with GuiSlideControl

use of am2.guis.controls.GuiSlideControl 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)

Example 3 with GuiSlideControl

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

the class AuraCustomizationMenu method initGui.

@Override
public void initGui() {
    btnParticleType = new GuiButtonVariableDims(10, 50, 40, AMParticle.particleTypes[AMCore.config.getAuraIndex()]);
    btnParticleBehaviour = new GuiButtonVariableDims(11, 50, 60, ParticleController.AuraControllerOptions[AMCore.config.getAuraBehaviour()]);
    btnParticleColorMode = new GuiButtonVariableDims(12, 50, 80, AMCore.config.getAuraColorDefault() ? StatCollector.translateToLocal("am2.gui.default") : AMCore.config.getAuraColorRandom() ? StatCollector.translateToLocal("am2.gui.random") : StatCollector.translateToLocal("am2.gui.custom"));
    btnParticleType.setDimensions(80, 20);
    btnParticleBehaviour.setDimensions(80, 20);
    btnParticleColorMode.setDimensions(80, 20);
    sliParticleScale = new GuiSlideControl(14, width - 110, 40, 100, StatCollector.translateToLocal("am2.gui.scale"), AMCore.config.getAuraScale() * 10, 1f, 200f);
    sliParticleAlpha = new GuiSlideControl(15, width - 110, 60, 100, StatCollector.translateToLocal("am2.gui.alpha"), AMCore.config.getAuraAlpha() * 100, 1f, 100f);
    sliParticleRed = new GuiSlideControl(16, width - 110, 80, 100, StatCollector.translateToLocal("am2.gui.red"), (AMCore.config.getAuraColor() >> 16) & 0xFF, 0f, 255f);
    sliParticleRed.setInteger(true);
    sliParticleGreen = new GuiSlideControl(17, width - 110, 100, 100, StatCollector.translateToLocal("am2.gui.green"), (AMCore.config.getAuraColor() >> 8) & 0xFF, 0f, 255f);
    sliParticleGreen.setInteger(true);
    sliParticleBlue = new GuiSlideControl(18, width - 110, 120, 100, StatCollector.translateToLocal("am2.gui.blue"), AMCore.config.getAuraColor() & 0xFF, 0f, 255f);
    sliParticleBlue.setInteger(true);
    sliParticleQuantity = new GuiSlideControl(20, width - 110, 140, 100, StatCollector.translateToLocal("am2.gui.qty"), AMCore.config.getAuraQuantity(), 1, 5);
    sliParticleQuantity.setInteger(true);
    sliParticleDelay = new GuiSlideControl(21, width - 110, 160, 100, StatCollector.translateToLocal("am2.gui.delay"), AMCore.config.getAuraDelay(), 1, 100);
    sliParticleDelay.setInteger(true);
    sliParticleSpeed = new GuiSlideControl(22, width - 110, 180, 100, StatCollector.translateToLocal("am2.gui.speed"), AMCore.config.getAuraSpeed(), 0.05f, 10.0f);
    if (AMCore.config.getAuraColorDefault() || AMCore.config.getAuraColorRandom()) {
        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(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

GuiSlideControl (am2.guis.controls.GuiSlideControl)3 GuiButtonVariableDims (am2.guis.controls.GuiButtonVariableDims)2 GuiButton (net.minecraft.client.gui.GuiButton)2 GuiStatedImageButton (am2.guis.controls.GuiStatedImageButton)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1