use of am2.guis.controls.GuiButtonCompendiumNext in project ArsMagica2 by Mithion.
the class GuiCompendiumIndex method initGui.
@Override
public void initGui() {
super.initGui();
int idCount = 0;
idCount = initTabs(idCount);
for (CompendiumEntryType category : categories) {
idCount = initButtonsForCategory(category.getCategoryName(), idCount, category.equals(activeCategory));
}
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
nextPage = new GuiButtonCompendiumNext(idCount++, l + 320, i1 + 13, true);
prevPage = new GuiButtonCompendiumNext(idCount++, l + 33, i1 + 13, false);
backToIndex = new GuiButtonCompendiumTab(idCount++, l - 10, i1 + 20, StatCollector.translateToLocal("am2.gui.back"), "back", null);
backToIndex.setActive(true);
backToIndex.visible = false;
updateButton = new GuiSpellImageButton(idCount++, l - 5, i1 + 10, ArcaneCompendium.instance.isModUpdateAvailable() ? AMGuiIcons.warning : AMGuiIcons.checkmark, 0, 0);
updateButton.setDimensions(10, 10);
updateButton.setPopupText(ArcaneCompendium.instance.isModUpdateAvailable() ? StatCollector.translateToLocal("am2.tooltip.updateAvailable") : StatCollector.translateToLocal("am2.tooltip.upToDate"));
this.buttonList.add(nextPage);
this.buttonList.add(prevPage);
this.buttonList.add(backToIndex);
if (AMCore.config.allowVersionChecks())
this.buttonList.add(updateButton);
switchCategoryAndPage();
if (this.currentParentEntry != null && this.currentParentEntry.hasSubItems()) {
for (Object btn : this.buttonList) {
if (btn instanceof GuiButtonCompendiumTab) {
((GuiButtonCompendiumTab) btn).visible = false;
}
}
backToIndex.visible = true;
}
if (page < getNumPages()) {
nextPage.visible = true;
} else {
nextPage.visible = false;
}
if (this.page > 0) {
prevPage.visible = true;
} else {
prevPage.visible = false;
}
}
use of am2.guis.controls.GuiButtonCompendiumNext 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);
}
Aggregations