Made background graphic for current chapter name

This commit is contained in:
Ellpeck 2015-11-16 19:03:29 +01:00
parent 1d6854b98f
commit 4d1dffb714
3 changed files with 13 additions and 19 deletions

View file

@ -66,17 +66,10 @@ public class BookletUtils{
* Draws the Title of the current chapter, current index entry or just "Actually Additions" if neither is present
*/
public static void drawTitle(GuiBooklet booklet){
if(booklet.currentIndexEntry != null){
if(booklet.currentChapter == null){
booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentIndexEntry.getLocalizedName(), booklet.guiLeft+booklet.xSize/2, booklet.guiTop-8, StringUtil.DECIMAL_COLOR_WHITE);
}
else{
booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentChapter.getLocalizedName(), booklet.guiLeft+booklet.xSize/2, booklet.guiTop-8, StringUtil.DECIMAL_COLOR_WHITE);
}
}
else{
booklet.drawCenteredString(booklet.getFontRenderer(), StringUtil.localize("itemGroup."+ModUtil.MOD_ID_LOWER), booklet.guiLeft+booklet.xSize/2, booklet.guiTop-8, StringUtil.DECIMAL_COLOR_WHITE);
}
booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize/2-142/2, booklet.guiTop-12, 0, 240, 142, 12);
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);
}
/**

View file

@ -98,27 +98,28 @@ public class GuiBooklet extends GuiScreen{
//Draws Achievement Info
BookletUtils.drawAchievementInfo(this, true, x, y);
//Pre-Renders the current page's content etc.
BookletUtils.renderPre(this, x, y, this.ticksElapsed, this.mousePressed);
//Draws the title
this.fontRendererObj.setUnicodeFlag(false);
BookletUtils.drawTitle(this);
this.fontRendererObj.setUnicodeFlag(true);
//Pre-Renders the current page's content etc.
BookletUtils.renderPre(this, x, y, this.ticksElapsed, this.mousePressed);
//Does vanilla drawing stuff
super.drawScreen(x, y, f);
this.searchField.drawTextBox();
//Renders the current page's content
if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){
this.currentPage.render(this, x, y, this.ticksElapsed, this.mousePressed);
}
//Draws hovering texts for buttons
this.fontRendererObj.setUnicodeFlag(false);
BookletUtils.doHoverTexts(this, x, y);
BookletUtils.drawAchievementInfo(this, false, x, y);
this.fontRendererObj.setUnicodeFlag(true);
//Renders the current page's content
if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){
this.currentPage.render(this, x, y, this.ticksElapsed, this.mousePressed);
}
this.fontRendererObj.setUnicodeFlag(unicodeBefore);
//Resets mouse

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB