From 3222dc2d95d70b0a7175fae022e3f0cb0b3b1f4a Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 29 Aug 2015 14:31:02 +0200 Subject: [PATCH] Changed some Booklet stuff --- .../actuallyadditions/inventory/GuiHandler.java | 2 ++ .../inventory/gui/booklet/BookletChapter.java | 1 + .../inventory/gui/booklet/GuiBooklet.java | 2 +- .../inventory/gui/booklet/InitBooklet.java | 7 ++++--- .../inventory/gui/booklet/PageCrafting.java | 4 +++- .../inventory/gui/booklet/PageFurnace.java | 4 +++- .../assets/actuallyadditions/lang/en_US.lang | 15 +++++++++------ 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java index f8a36c86f..3f80f76d2 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java @@ -14,6 +14,8 @@ public class GuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){ + if(id == GuiTypes.BOOK.ordinal()) return null; + TileEntityBase tile = null; if(id != GuiTypes.CRAFTER.ordinal() && id != GuiTypes.DRILL.ordinal()){ tile = (TileEntityBase)world.getTileEntity(x, y, z); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/BookletChapter.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/BookletChapter.java index 96b3ee71a..55a198fde 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/BookletChapter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/BookletChapter.java @@ -14,6 +14,7 @@ public class BookletChapter{ this.unlocalizedName = unlocalizedName; entry.addChapter(this); + InitBooklet.allAndSearch.addChapter(this); this.entry = entry; for(IBookletPage page : this.pages){ diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/GuiBooklet.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/GuiBooklet.java index 5ebff24ce..c3a1e00bf 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/GuiBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/GuiBooklet.java @@ -178,7 +178,7 @@ public class GuiBooklet extends GuiScreen{ } else if(button.id == BUTTON_RETURN_ID){ if(this.currentChapter != null){ - this.openIndexEntry(this.currentChapter.entry, this.pageOpenInIndex); + this.openIndexEntry(this.currentIndexEntry, this.pageOpenInIndex); } else{ this.openIndexEntry(null, 1); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/InitBooklet.java index 28bbfe609..9f54bf06a 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/InitBooklet.java @@ -14,13 +14,14 @@ public class InitBooklet{ public static BookletIndexEntry entryFunctionalNonRF = new BookletIndexEntry("functionalNoRF"); public static BookletIndexEntry entryMisc = new BookletIndexEntry("misc"); + public static BookletIndexEntry allAndSearch = new BookletIndexEntry("allAndSearch"); static{ - new BookletChapter("cloud", entryMisc, new PageText(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud)); - new BookletChapter("foods", entryMisc, new PageCrafting(1, FoodCrafting.recipePizza), new PageFurnace(2, new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal())), new PageCrafting(3, FoodCrafting.recipeHamburger), new PageCrafting(4, FoodCrafting.recipeBigCookie), new PageCrafting(5, FoodCrafting.recipeSubSandwich), new PageCrafting(6, FoodCrafting.recipeFrenchFry), new PageCrafting(7, FoodCrafting.recipeFrenchFries), new PageCrafting(8, FoodCrafting.recipeFishNChips), new PageCrafting(9, FoodCrafting.recipeCheese), new PageCrafting(10, FoodCrafting.recipePumpkinStew), new PageCrafting(11, FoodCrafting.recipeCarrotJuice), new PageCrafting(12, FoodCrafting.recipeSpaghetti), new PageCrafting(13, FoodCrafting.recipeNoodle), new PageCrafting(14, FoodCrafting.recipeChocolate), new PageCrafting(15, FoodCrafting.recipeChocolateCake), new PageCrafting(16, FoodCrafting.recipeToast), new PageFurnace(17, new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()))); - new BookletChapter("breaker", entryFunctionalNonRF, new PageCrafting(1, BlockCrafting.recipeBreaker), new PageCrafting(2, BlockCrafting.recipePlacer), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer), new PageCrafting(4, BlockCrafting.recipeLiquidCollector)); new BookletChapter("phantomfaces", entryFunctionalNonRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipePhantomface), new PageCrafting(3, BlockCrafting.recipeLiquiface), new PageCrafting(4, BlockCrafting.recipeEnergyface)); new BookletChapter("phantomBreaker", entryFunctionalNonRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipePhantomPlacer), new PageCrafting(3, BlockCrafting.recipePhantomBreaker)); + + new BookletChapter("cloud", entryMisc, new PageText(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud)); + new BookletChapter("foods", entryMisc, new PageCrafting(1, FoodCrafting.recipePizza), new PageFurnace(2, new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal())), new PageCrafting(3, FoodCrafting.recipeHamburger), new PageCrafting(4, FoodCrafting.recipeBigCookie), new PageCrafting(5, FoodCrafting.recipeSubSandwich), new PageCrafting(6, FoodCrafting.recipeFrenchFry), new PageCrafting(7, FoodCrafting.recipeFrenchFries), new PageCrafting(8, FoodCrafting.recipeFishNChips), new PageCrafting(9, FoodCrafting.recipeCheese), new PageCrafting(10, FoodCrafting.recipePumpkinStew), new PageCrafting(11, FoodCrafting.recipeCarrotJuice), new PageCrafting(12, FoodCrafting.recipeSpaghetti), new PageCrafting(13, FoodCrafting.recipeNoodle), new PageCrafting(14, FoodCrafting.recipeChocolate), new PageCrafting(15, FoodCrafting.recipeChocolateCake), new PageCrafting(16, FoodCrafting.recipeToast), new PageFurnace(17, new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()))); } } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageCrafting.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageCrafting.java index f73315715..636694836 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageCrafting.java @@ -1,6 +1,8 @@ package ellpeck.actuallyadditions.inventory.gui.booklet; import cpw.mods.fml.relauncher.ReflectionHelper; +import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import ellpeck.actuallyadditions.util.Util; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; @@ -34,7 +36,7 @@ public class PageCrafting extends PageText{ @Override public void render(GuiBooklet gui, int mouseX, int mouseY){ if(this.recipe == null){ - gui.unicodeRenderer.drawSplitString("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!", gui.guiLeft+14, gui.guiTop+15, 115, 0); + gui.unicodeRenderer.drawSplitString(StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0); } gui.unicodeRenderer.drawSplitString(gui.currentPage.getText(), gui.guiLeft+14, gui.guiTop+112, 115, 0); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageFurnace.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageFurnace.java index a51ed1190..5fe0df79e 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageFurnace.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/PageFurnace.java @@ -1,5 +1,7 @@ package ellpeck.actuallyadditions.inventory.gui.booklet; +import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; @@ -29,7 +31,7 @@ public class PageFurnace extends PageText{ public void render(GuiBooklet gui, int mouseX, int mouseY){ ItemStack input = this.getInputForOutput(this.result); if(input == null){ - gui.unicodeRenderer.drawSplitString("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!", gui.guiLeft+14, gui.guiTop+15, 115, 0); + gui.unicodeRenderer.drawSplitString(StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0); } gui.unicodeRenderer.drawSplitString(gui.currentPage.getText(), gui.guiLeft+14, gui.guiTop+112, 115, 0); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 47a011237..eedc693b5 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -364,21 +364,24 @@ achievement.actuallyadditions.openTreasureChest.desc=Open a Treasure Chest under booklet.actuallyadditions.indexEntry.misc.name=Miscellaneous booklet.actuallyadditions.indexEntry.functionalNoRF.name=Functional Blocks (No RF use) +booklet.actuallyadditions.indexEntry.allAndSearch.name=All Items (Search not implemented) + +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.chapter.foods.name=Food booklet.actuallyadditions.chapter.foods.text.1=A Pizza is round, delicious and tastes of tomatoes, cheese and deliciousness. Yum! booklet.actuallyadditions.chapter.foods.text.2=Rice Bread is made in a furnace from rice dough, which can be made from rice. It tastes of a combination of rice and bread. Because that's what it is, I guess. -booklet.actuallyadditions.chapter.foods.text.3=It's hammy, and it's burgr'y, and it makes you want to sing, it's a Haaaaaaamuuuuurgeeeeeer *cough* It's from a german city: Hamburg! ...You learn something new every day. -booklet.actuallyadditions.chapter.foods.text.4=Reminds me of something. Hmmm... Subway? -booklet.actuallyadditions.chapter.foods.text.5=Reminds me of something. Hmmm... Wubsay? -booklet.actuallyadditions.chapter.foods.text.6=A pity it isn't waving a white flaaaaaaaaa.. flake. Of corn. A white cornflake. +booklet.actuallyadditions.chapter.foods.text.3=It's two slices of bread with a piece of meat, cheese and some salad between it. Could have originated in Hamburg, Germany. +booklet.actuallyadditions.chapter.foods.text.4=It's like a normal cookie, but more chocolate-y and bigger. +booklet.actuallyadditions.chapter.foods.text.5=It's a baguette cut open, containing cheese, salad, fish and some other goodies, wrapped in paper. +booklet.actuallyadditions.chapter.foods.text.6=Some people call it "French Stick". We just call it "Baguette". booklet.actuallyadditions.chapter.foods.text.7=Or chips, if you're not american! booklet.actuallyadditions.chapter.foods.text.8=It's a paper container filled with fries and fish. What more could you want? -booklet.actuallyadditions.chapter.foods.text.9=Someone might reeeeally like this. +booklet.actuallyadditions.chapter.foods.text.9=Someone might really like this. booklet.actuallyadditions.chapter.foods.text.10=I somehow have a weird song stuck in my head where someone just repeatedly goes "Pumpkin pumpkin pumpkin blur, pumpkin blur, pumpkin blur"... booklet.actuallyadditions.chapter.foods.text.11=It's like Tomato Juice, only that you don't always get it on a plane. booklet.actuallyadditions.chapter.foods.text.12=It's a bowl with 3 noodles in it. It must be a really big bowl, I guess. -booklet.actuallyadditions.chapter.foods.text.13=THERE are those noodles! I've been searching for them for ages! +booklet.actuallyadditions.chapter.foods.text.13=It's just a paper container filled with noodles. Like you get in your local supermarket. If you have one local. booklet.actuallyadditions.chapter.foods.text.14=Lari likes. booklet.actuallyadditions.chapter.foods.text.15=It's chocolate cake. Who wouldn't like it!? booklet.actuallyadditions.chapter.foods.text.16=It's Toast. What more could I say?