use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.
the class GuiSpellCustomization method initGui.
@Override
public void initGui() {
super.initGui();
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
if (AMCore.config.suggestSpellNames())
spellName = new GuiTextField(fontRendererObj, l + 8, i1 + 8, xSize - 36, 16);
else
spellName = new GuiTextField(fontRendererObj, l + 8, i1 + 8, xSize - 16, 16);
String suggestion = ((ContainerSpellCustomization) this.inventorySlots).getInitialSuggestedName();
spellName.setText(suggestion);
if (!suggestion.equals("")) {
curName = suggestion;
((ContainerSpellCustomization) this.inventorySlots).setNameAndIndex(curName, curIndex);
}
btnPrev = new GuiButtonVariableDims(0, l + 8, i1 + 26, StatCollector.translateToLocal("am2.gui.prev")).setDimensions(48, 20);
btnNext = new GuiButtonVariableDims(1, l + xSize - 56, i1 + 26, StatCollector.translateToLocal("am2.gui.next")).setDimensions(48, 20);
btnRandomName = new GuiButtonVariableDims(2, l + xSize - 24, i1 + 5, "???");
btnRandomName.setDimensions(20, 20);
this.buttonList.add(btnPrev);
this.buttonList.add(btnNext);
if (AMCore.config.suggestSpellNames())
this.buttonList.add(btnRandomName);
int IIcon_start_x = l + 12;
int IIcon_start_y = i1 + 50;
int btnX = IIcon_start_x;
int btnY = IIcon_start_y;
int id = 3;
int IIconCount = 0;
int curPage = 0;
for (IIcon icon : SpellTextureHelper.instance.getAllIcons()) {
GuiSpellImageButton spellButton = new GuiSpellImageButton(id++, btnX, btnY, icon, IIconCount++, curPage);
if (curPage != 0) {
spellButton.visible = false;
}
this.buttonList.add(spellButton);
btnX += 14;
if (btnX > (l + xSize) - 15) {
btnX = IIcon_start_x;
btnY += 14;
if (btnY > (i1 + ySize - 10)) {
btnY = IIcon_start_y;
curPage++;
}
}
}
this.numPages = curPage;
}
use of am2.guis.controls.GuiButtonVariableDims in project ArsMagica2 by Mithion.
the class GuiArcaneCompendium method initGui.
@Override
public void initGui() {
super.initGui();
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
prevPage = new GuiButtonCompendiumNext(0, l + 35, i1 + ySize - 25, false);
nextPage = new GuiButtonCompendiumNext(1, l + 315, i1 + ySize - 25, true);
backToIndex = new GuiButtonCompendiumTab(2, l - 10, i1 + 20, StatCollector.translateToLocal("am2.gui.back"), "back", null);
backToIndex.setActive(true);
prevLayer = new GuiButtonCompendiumNext(3, l + 180, i1 + 19, false);
nextLayer = new GuiButtonCompendiumNext(4, l + 305, i1 + 19, true);
pauseCycling = new GuiButtonVariableDims(5, l + 285, i1 + 190, AMGuiHelper.instance.runCompendiumTicker ? StatCollector.translateToLocal("am2.gui.pause") : StatCollector.translateToLocal("am2.gui.cycle")).setDimensions(40, 20);
if (entryMultiblock != null) {
prevLayer.visible = true;
nextLayer.visible = true;
pauseCycling.visible = true;
maxLayers = entryMultiblock.getHeight();
} else {
prevLayer.visible = false;
nextLayer.visible = false;
pauseCycling.visible = false;
}
this.buttonList.add(nextPage);
this.buttonList.add(prevPage);
this.buttonList.add(prevLayer);
this.buttonList.add(nextLayer);
this.buttonList.add(backToIndex);
this.buttonList.add(pauseCycling);
}
use of am2.guis.controls.GuiButtonVariableDims 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);
}
Aggregations