/** * Draws the Title of the current chapter, current index entry or just "Actually Additions" if * neither is present */ public static void drawTitle(GuiBooklet booklet) { // Upper title booklet.drawTexturedModalRect( booklet.guiLeft + booklet.xSize / 2 - 142 / 2, booklet.guiTop - 12, 0, 240, 142, 12); // Lower title booklet.drawTexturedModalRect( booklet.guiLeft + booklet.xSize / 2 - 142 / 2, booklet.guiTop + booklet.ySize, 0, 243, 142, 13); String strg = booklet.currentChapter == null ? (booklet.currentIndexEntry == null ? StringUtil.localize("itemGroup." + ModUtil.MOD_ID_LOWER) : booklet.currentIndexEntry.getLocalizedName()) : booklet.currentChapter.getLocalizedName(); booklet.drawCenteredString( booklet.getFontRenderer(), strg, booklet.guiLeft + booklet.xSize / 2, booklet.guiTop - 9, StringUtil.DECIMAL_COLOR_WHITE); }
/** * Draws an Achievement Info if the page has items that trigger achievements * * @param pre If the hover info texts or the icon should be drawn */ public static void drawAchievementInfo(GuiBooklet booklet, boolean pre, int mouseX, int mouseY) { if (booklet.currentChapter == null) { return; } ArrayList<String> infoList = null; for (BookletPage page : booklet.currentChapter.pages) { if (page != null && page.getItemStacksForPage() != null) { for (ItemStack stack : page.getItemStacksForPage()) { for (Achievement achievement : InitAchievements.achievementList) { if (stack != null && achievement.theItemStack != null && achievement.theItemStack.isItemEqual(stack)) { if (pre) { booklet.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); booklet.drawTexturedModalRect( booklet.guiLeft + booklet.xSize + 1, booklet.guiTop - 18, 166, 154, 22, 21); return; } else { if (mouseX >= booklet.guiLeft + booklet.xSize + 1 && mouseX < booklet.guiLeft + booklet.xSize + 1 + 22 && mouseY >= booklet.guiTop - 18 && mouseY < booklet.guiTop - 18 + 21) { if (infoList == null) { infoList = new ArrayList<String>(); infoList.add(EnumChatFormatting.GOLD + "Achievements related to this chapter:"); } infoList.add("-" + StringUtil.localize(achievement.statId)); infoList.add(EnumChatFormatting.GRAY + "(" + achievement.getDescription() + ")"); } } } } } } } if (infoList != null) { booklet.drawHoveringText(infoList, mouseX, mouseY); } }