use of com.mart.solar.client.gui.button.BookButton in project Solar by Martacus.
the class GuiCategory method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
if (button instanceof BookButton) {
BookButton bookButton = (BookButton) button;
bookButton.openPage();
}
}
use of com.mart.solar.client.gui.button.BookButton in project Solar by Martacus.
the class GuiCategory method initGui.
@Override
public void initGui() {
super.initGui();
int xOffset = 20;
int yOffset = 25;
int x = (this.width - WIDTH) / 2;
int y = (this.height - HEIGHT) / 2;
EntityPlayerSP player = this.mc.player;
PlayerData.PlayerSave save = PlayerData.getDataFromPlayer(player);
int buttonAmount = 0;
for (GuiPage guiPage : this.pages) {
if (save.acquiredPages.contains(guiPage.getPageID())) {
BookButton button = new BookButton(guiPage, x + xOffset, y + yOffset + (buttonAmount * 10), buttonAmount);
this.addButton(button);
buttonAmount++;
}
}
}
Aggregations