From 1beff3ece97e11cff6f5c118a3158903db310854 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 5 Sep 2015 00:15:11 +0200 Subject: [PATCH] Made the booklet open the right index entry when looking at a crafting recipe, added another entry --- .../actuallyadditions/booklet/GuiBooklet.java | 4 ++-- .../booklet/page/BookletPage.java | 1 + .../assets/actuallyadditions/lang/en_US.lang | 14 +++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java index ba53c096d..8cae2710f 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java @@ -56,7 +56,7 @@ public class GuiBooklet extends GuiScreen{ private static final int BUTTON_BACK_ID = 1; private static final int BUTTON_RETURN_ID = 2; private static final int CHAPTER_BUTTONS_START = 3; - private static final int BUTTONS_PER_PAGE = 13; + public static final int BUTTONS_PER_PAGE = 13; private static final int BUTTON_UPDATE_ID = CHAPTER_BUTTONS_START+BUTTONS_PER_PAGE; private static final int BUTTON_TWITTER_ID = BUTTON_UPDATE_ID+1; @@ -423,7 +423,7 @@ public class GuiBooklet extends GuiScreen{ this.currentIndexEntry = entry; this.indexPageAmount = entry == null ? 1 : entry.chapters.size()/BUTTONS_PER_PAGE+1; - this.pageOpenInIndex = entry == null ? 1 : (this.indexPageAmount <= page ? this.indexPageAmount : page); + this.pageOpenInIndex = entry == null ? 1 : (this.indexPageAmount <= page || page <= 0 ? this.indexPageAmount : page); this.getButton(BUTTON_RETURN_ID).visible = entry != null; this.getButton(BUTTON_FORWARD_ID).visible = this.pageOpenInIndex < this.indexPageAmount; diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java index 8c03d7139..7204c3fff 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java @@ -90,6 +90,7 @@ public class BookletPage implements IBookletPage{ list.add(EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe")); if(mouseClick){ + gui.openIndexEntry(page.getChapter().entry, InitBooklet.entries.indexOf(page.getChapter().entry)/GuiBooklet.BUTTONS_PER_PAGE+1, true); gui.openChapter(page.getChapter(), page); Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index a19eaf473..36c430d7f 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -370,10 +370,10 @@ booklet.actuallyadditions.shapelessOreRecipe=Shapeless OreDictionary Recipe booklet.actuallyadditions.shapedOreRecipe=Shaped OreDictionary Recipe booklet.actuallyadditions.indexEntry.misc.name=Miscellaneous -booklet.actuallyadditions.indexEntry.functionalNoRF.name=Functional Blocks (No RF use) +booklet.actuallyadditions.indexEntry.functionalNoRF.name=Blocks that don't use RF booklet.actuallyadditions.indexEntry.allAndSearch.name=All Items and Search -booklet.actuallyadditions.indexEntry.functionalRF.name=Functional Blocks (Use RF) -booklet.actuallyadditions.indexEntry.generatingRF.name=Generating Blocks (Make RF) +booklet.actuallyadditions.indexEntry.functionalRF.name=Blocks that use RF +booklet.actuallyadditions.indexEntry.generatingRF.name=Blocks that generate RF booklet.actuallyadditions.recipeDisabled=The crafting recipe for this item is disabled in the Config File! If you're on a server, ask the server author to enable it in the config. If you're on a client, press the 'Open Config'-Button on the top right and enable the recipe! booklet.actuallyadditions.clickToSeeRecipe=Click to see more Information @@ -453,7 +453,7 @@ booklet.actuallyadditions.chapter.intro.text.1=This book, written years ago, booklet.actuallyadditions.chapter.intro.text.2=This book, written by Ellpeck, the author of everything Actually Additions contains, often called Ellopecko, Peck or Ellpack, is easy to navigate. It has an index page at the front from which you can choose criteria pages. These criteria pages contain a list of every item which is part of the criteria, and clicking on that will show precise information and the crafting recipe of the item. The page you were on previously will stay open between sessions, too! Go check it out! booklet.actuallyadditions.chapter.intro.text.3=If you, for some reason, want to craft this book again, just take a piece of paper and a canola seed which you can find randomly generated and craft them together! -booklet.actuallyadditions.chapter.quartz.name=Black Quartz! +booklet.actuallyadditions.chapter.quartz.name=Black Quartz booklet.actuallyadditions.chapter.quartz.text.1=Black Quartz is a semi-common ore that can be found underground. It can be used to make decor blocks, but it is also necessary to make important crafting ingredients (found in the Crafting Ingredients page!). booklet.actuallyadditions.chapter.quartz.text.2=Black Quartz as an item is used to make lots of important crafting materials in the mod. It can also be, if you can't find the ore, made with one Nether Quartz and one Coal. This recipe isn't that cheap though, so you're better off just going caving. @@ -473,4 +473,8 @@ booklet.actuallyadditions.chapter.solarPanel.name=Solar Panel booklet.actuallyadditions.chapter.solarPanel.text.1=The Solar Panel is a block that is used to generate RF through the power of the sun! Just plop it down under a free sky and watch it generate RF slowly just by sitting there. It will obviously not work at night. Obviously. booklet.actuallyadditions.chapter.heatCollector.name=Heat Collector -booklet.actuallyadditions.chapter.heatCollector.text.1=The Heat Collector is one of the more complicated methods of generating RF in Actually Additions. It needs to have a couple of lava blocks around it to generate RF in the first place, but it will sometimes absorb some of the lava, having to have it replaced before it can continue working again. This could be a good combination with the Lava Factory. Maybe. \ No newline at end of file +booklet.actuallyadditions.chapter.heatCollector.text.1=The Heat Collector is one of the more complicated methods of generating RF in Actually Additions. It needs to have a couple of lava blocks around it to generate RF in the first place, but it will sometimes absorb some of the lava, having to have it replaced before it can continue working again. This could be a good combination with the Lava Factory. Maybe. + +booklet.actuallyadditions.chapter.coalStuff.name=Stuff made with coal +booklet.actuallyadditions.chapter.coalStuff.text.1=You can convert a single piece of coal into 8 tiny coal so that you can smelt one item at a time in a furnace without wasting fuel. +booklet.actuallyadditions.chapter.coalStuff.text.2=You can convert a single piece of charcoal into 8 tiny charcoal so that you can smelt one item at a time in a furnace without wasting fuel. \ No newline at end of file