Search in sources :

Example 1 with GuiStatedImageButton

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

Aggregations

GuiSlideControl (am2.guis.controls.GuiSlideControl)1 GuiStatedImageButton (am2.guis.controls.GuiStatedImageButton)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1