mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Made background graphic for current chapter name
This commit is contained in:
parent
1d6854b98f
commit
4d1dffb714
3 changed files with 13 additions and 19 deletions
|
@ -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
|
* Draws the Title of the current chapter, current index entry or just "Actually Additions" if neither is present
|
||||||
*/
|
*/
|
||||||
public static void drawTitle(GuiBooklet booklet){
|
public static void drawTitle(GuiBooklet booklet){
|
||||||
if(booklet.currentIndexEntry != null){
|
booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize/2-142/2, booklet.guiTop-12, 0, 240, 142, 12);
|
||||||
if(booklet.currentChapter == null){
|
|
||||||
booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentIndexEntry.getLocalizedName(), booklet.guiLeft+booklet.xSize/2, booklet.guiTop-8, StringUtil.DECIMAL_COLOR_WHITE);
|
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);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -98,27 +98,28 @@ public class GuiBooklet extends GuiScreen{
|
||||||
//Draws Achievement Info
|
//Draws Achievement Info
|
||||||
BookletUtils.drawAchievementInfo(this, true, x, y);
|
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
|
//Draws the title
|
||||||
this.fontRendererObj.setUnicodeFlag(false);
|
this.fontRendererObj.setUnicodeFlag(false);
|
||||||
BookletUtils.drawTitle(this);
|
BookletUtils.drawTitle(this);
|
||||||
this.fontRendererObj.setUnicodeFlag(true);
|
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
|
//Does vanilla drawing stuff
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
this.searchField.drawTextBox();
|
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
|
//Draws hovering texts for buttons
|
||||||
this.fontRendererObj.setUnicodeFlag(false);
|
this.fontRendererObj.setUnicodeFlag(false);
|
||||||
BookletUtils.doHoverTexts(this, x, y);
|
BookletUtils.doHoverTexts(this, x, y);
|
||||||
BookletUtils.drawAchievementInfo(this, false, 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);
|
this.fontRendererObj.setUnicodeFlag(unicodeBefore);
|
||||||
|
|
||||||
//Resets mouse
|
//Resets mouse
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
Loading…
Reference in a new issue