New Booklet Main Page Design

This commit is contained in:
Ellpeck 2015-12-17 21:58:59 +01:00
parent e0aaa93bb5
commit f26f9ddbb2
3 changed files with 41 additions and 7 deletions

View file

@ -19,6 +19,7 @@ import ellpeck.actuallyadditions.booklet.entry.BookletEntry;
import ellpeck.actuallyadditions.booklet.entry.BookletEntryAllSearch;
import ellpeck.actuallyadditions.booklet.page.BookletPage;
import ellpeck.actuallyadditions.util.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
@ -70,6 +71,30 @@ public class BookletUtils{
//Lower title
booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize/2-142/2, booklet.guiTop+booklet.ySize, 0, 243, 142, 13);
//Draw No Entry title
if(booklet.currentEntrySet.entry == null){
String strg = EnumChatFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.1");
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12, 0);
strg = EnumChatFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.2");
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12+booklet.getFontRenderer().FONT_HEIGHT, 0);
String version;
if(Minecraft.getMinecraft().thePlayer.getCommandSenderName().equals("dqmhose")){
version = "Pants Edition";
}
else if(Minecraft.getMinecraft().thePlayer.getCommandSenderName().equals("KittyVanCat")){
version = "Cat's Edition";
}
else if(Util.isDevVersion()){
version = "Dev's Edition";
}
else{
version = StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.edition")+" "+ModUtil.VERSION.substring(ModUtil.VERSION.indexOf("r")+1);
}
strg = EnumChatFormatting.GOLD+EnumChatFormatting.ITALIC.toString()+"-"+version+"-";
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+33, 0);
}
String strg = booklet.currentEntrySet.chapter == null ? (booklet.currentEntrySet.entry == null ? StringUtil.localize("itemGroup."+ModUtil.MOD_ID_LOWER) : booklet.currentEntrySet.entry.getLocalizedName()) : booklet.currentEntrySet.chapter.getLocalizedName();
booklet.drawCenteredString(booklet.getFontRenderer(), strg, booklet.guiLeft+booklet.xSize/2, booklet.guiTop-9, StringUtil.DECIMAL_COLOR_WHITE);
}
@ -215,11 +240,16 @@ public class BookletUtils{
for(int i = 0; i < booklet.chapterButtons.length; i++){
IndexButton button = (IndexButton)booklet.chapterButtons[i];
if(entry == null){
boolean entryExists = InitBooklet.entries.size() > i;
button.visible = entryExists;
if(entryExists){
button.displayString = InitBooklet.entries.get(i).getNameWithColor();
button.chap = null;
if(i >= GuiBooklet.INDEX_BUTTONS_OFFSET){
boolean entryExists = InitBooklet.entries.size() > i-GuiBooklet.INDEX_BUTTONS_OFFSET;
button.visible = entryExists;
if(entryExists){
button.displayString = InitBooklet.entries.get(i-GuiBooklet.INDEX_BUTTONS_OFFSET).getNameWithColor();
button.chap = null;
}
}
else{
button.visible = false;
}
}
else{
@ -249,8 +279,8 @@ public class BookletUtils{
}
}
else{
if(place < InitBooklet.entries.size()){
openIndexEntry(booklet, InitBooklet.entries.get(place), 1, true);
if(place-GuiBooklet.INDEX_BUTTONS_OFFSET < InitBooklet.entries.size()){
openIndexEntry(booklet, InitBooklet.entries.get(place-GuiBooklet.INDEX_BUTTONS_OFFSET), 1, true);
}
}
}

View file

@ -49,6 +49,7 @@ public class GuiBooklet extends GuiScreen{
public static final ResourceLocation resLocValentine = AssetUtil.getBookletGuiLocation("guiBookletValentinesDay");
public static final int CHAPTER_BUTTONS_AMOUNT = 13;
public static final int INDEX_BUTTONS_OFFSET = 3;
public int xSize;
public int ySize;

View file

@ -378,6 +378,9 @@ info.actuallyadditions.inputter.info.1=This is the first Slot in the connected I
info.actuallyadditions.inputter.info.2=This is the slot after the last Slot in the connected Inventory to <p> at. What that means: If you, for example, write 2 in the field to the left and 5 in this one, it will <p> at Slot 2, 3, and 4.
info.actuallyadditions.inputter.whitelistInfo=This applies for this part of the white-/blacklist. The other side applies as well, so you can have some Items whitelisted and some blacklisted. Note that, if you have an empty blacklist or an item whitelisted on at least one side, it will always go through.
info.actuallyadditions.noLens=No Lens
info.actuallyadditions.booklet.manualName.1=Actually Additions
info.actuallyadditions.booklet.manualName.2=Manual
info.actuallyadditions.booklet.edition=Edition
#Container Names
container.actuallyadditions.inputter.name=ESD