Added Preview Pictures to the booklet (Thanks to Kitty for help!)

This commit is contained in:
Ellpeck 2015-10-30 20:07:36 +01:00
parent 80f9820f0d
commit 7b9573ca8e
15 changed files with 63 additions and 14 deletions

View file

@ -37,10 +37,10 @@ import java.util.List;
@SideOnly(Side.CLIENT)
public class GuiBooklet extends GuiScreen{
public static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBooklet");
public static final ResourceLocation resLocHalloween = AssetUtil.getGuiLocation("guiBookletHalloween");
public static final ResourceLocation resLocChristmas = AssetUtil.getGuiLocation("guiBookletChristmas");
public static final ResourceLocation resLocValentine = AssetUtil.getGuiLocation("guiBookletValentinesDay");
public static final ResourceLocation resLoc = AssetUtil.getBookletGuiLocation("guiBooklet");
public static final ResourceLocation resLocHalloween = AssetUtil.getBookletGuiLocation("guiBookletHalloween");
public static final ResourceLocation resLocChristmas = AssetUtil.getBookletGuiLocation("guiBookletChristmas");
public static final ResourceLocation resLocValentine = AssetUtil.getBookletGuiLocation("guiBookletValentinesDay");
public static final int CHAPTER_BUTTONS_AMOUNT = 13;
public static final int TOOLTIP_SPLIT_LENGTH = 200;
public int xSize;

View file

@ -59,8 +59,8 @@ public class InitBooklet{
}
new BookletChapter("lamps", entryMisc, new ItemStack(InitBlocks.blockColoredLampOn, 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()]));
new BookletChapter("treasureChest", entryMisc, new ItemStack(InitBlocks.blockTreasureChest), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockTreasureChest))).setSpecial();
new BookletChapter("hairBalls", entryMisc, new ItemStack(InitItems.itemHairyBall), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemHairyBall))).setSpecial();
new BookletChapter("treasureChest", entryMisc, new ItemStack(InitBlocks.blockTreasureChest), new PagePicture(1, "pageTreasureChest", 150).setStack(new ItemStack(InitBlocks.blockTreasureChest)), new PageTextOnly(2)).setSpecial();
new BookletChapter("hairBalls", entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "pageFurBalls", 110).setStack(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial();
//No RF Using Blocks
new BookletChapter("breaker", entryFunctionalNonRF, new ItemStack(InitBlocks.blockBreaker), new PageCrafting(1, BlockCrafting.recipeBreaker), new PageCrafting(2, BlockCrafting.recipePlacer), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer), new PageCrafting(4, BlockCrafting.recipeLiquidCollector));
@ -77,12 +77,12 @@ public class InitBooklet{
new BookletChapter("rangedCollector", entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("<range>", ConfigIntValues.RANGED_COLLECTOR_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText());
//RF Using Blocks
new BookletChapter("laserRelays", entryFunctionalRF, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1).addTextReplacement("<range>", ConfigIntValues.LASER_RELAY_MAX_DISTANCE.getValue()).addTextReplacement("<loss>", ConfigIntValues.LASER_RELAY_LOSS.getValue()), new PageCrafting(2, BlockCrafting.recipeLaserRelay).setNoText(), new PageCrafting(3, ItemCrafting.recipeLaserWrench).setNoText()).setImportant();
new BookletChapterCoffee("coffeeMachine", entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("<rf>", ConfigIntValues.COFFEE_MACHINE_ENERGY_USED.getValue()).addTextReplacement("<coffee>", ConfigIntValues.COFFEE_CACHE_USED_PER_ITEM.getValue()).addTextReplacement("<water>", ConfigIntValues.COFFEE_MACHINE_WATER_USED.getValue()), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemCoffee)), new PageCrafting(3, BlockCrafting.recipeCoffeeMachine).setNoText(), new PageCrafting(4, ItemCrafting.recipeCup).setNoText()).setImportant();
new BookletChapter("laserRelays", entryFunctionalRF, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1).addTextReplacement("<range>", ConfigIntValues.LASER_RELAY_MAX_DISTANCE.getValue()).addTextReplacement("<loss>", ConfigIntValues.LASER_RELAY_LOSS.getValue()), new PagePicture(2, "pageLaserRelay", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLaserRelay).setNoText(), new PageCrafting(4, ItemCrafting.recipeLaserWrench).setNoText()).setImportant();
new BookletChapterCoffee("coffeeMachine", entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("<rf>", ConfigIntValues.COFFEE_MACHINE_ENERGY_USED.getValue()).addTextReplacement("<coffee>", ConfigIntValues.COFFEE_CACHE_USED_PER_ITEM.getValue()).addTextReplacement("<water>", ConfigIntValues.COFFEE_MACHINE_WATER_USED.getValue()), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "pageCoffeeMachine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
new BookletChapter("crusher", entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("<rf1>", ConfigIntValues.GRINDER_ENERGY_USED.getValue()).addTextReplacement("<rf2>", ConfigIntValues.GRINDER_DOUBLE_ENERGY_USED.getValue()), new PageCrafting(2, BlockCrafting.recipeCrusher).setNoText(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setNoText(), new PageCrusherRecipe(4, CrusherCrafting.recipeSugar).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(7, CrusherCrafting.recipeDiamondHorseArmor).setNoText());
new BookletChapter("furnaceDouble", entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).addTextReplacement("<rf>", ConfigIntValues.FURNACE_ENERGY_USED.getValue()));
new BookletChapter("miner", entryFunctionalRF, new ItemStack(InitBlocks.blockOreMagnet), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.ORE_MAGNET_ENERGY_USE.getValue()).addTextReplacement("<oil>", ConfigIntValues.ORE_MAGNET_OIL_USE.getValue()).addTextReplacement("<range>", ConfigIntValues.ORE_MAGNET_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeMiner).setNoText(), new PageCrafting(3, BlockCrafting.recipeCasing).setNoText());
new BookletChapter("lavaFactory", entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue()), new PageCrafting(2, BlockCrafting.recipeLavaFactory).setNoText());
new BookletChapter("lavaFactory", entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue()), new PagePicture(2, "pageLavaFactory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText());
new BookletChapter("energizer", entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator));
new BookletChapter("repairer", entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("<rf>", ConfigIntValues.REPAIRER_ENERGY_USED.getValue()));
new BookletChapter("longRangeBreaker", entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.DIRECTIONAL_BREAKER_RF_PER_BLOCK.getValue()).addTextReplacement("<range>", ConfigIntValues.DIRECTIONAL_BREAKER_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker));

View file

@ -0,0 +1,38 @@
/*
* This file ("PagePicture.java") is part of the Actually Additions Mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015 Ellpeck
*/
package ellpeck.actuallyadditions.booklet.page;
import ellpeck.actuallyadditions.booklet.GuiBooklet;
import ellpeck.actuallyadditions.util.AssetUtil;
import net.minecraft.util.ResourceLocation;
public class PagePicture extends PageTextOnly{
private ResourceLocation resLoc;
private int textStartY;
public PagePicture(int id, String resLocName, int textStartY){
super(id);
this.textStartY = textStartY;
this.resLoc = AssetUtil.getBookletGuiLocation(resLocName);
}
@Override
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
gui.mc.getTextureManager().bindTexture(this.resLoc);
gui.drawTexturedModalRect(gui.guiLeft, gui.guiTop, 0, 0, gui.xSize, gui.ySize);
String text = gui.currentPage.getText();
if(text != null && !text.isEmpty()){
gui.mc.fontRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+textStartY, 115, 0);
}
}
}

View file

@ -14,8 +14,10 @@ import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.RecipeInfo;
import codechicken.nei.recipe.TemplateRecipeHandler;
import ellpeck.actuallyadditions.booklet.BookletChapter;
import ellpeck.actuallyadditions.booklet.InitBooklet;
import ellpeck.actuallyadditions.booklet.page.BookletPage;
import ellpeck.actuallyadditions.booklet.page.PagePicture;
import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil;
@ -106,11 +108,13 @@ public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements I
if(ItemUtil.contains(page.getItemStacksForPage(), stack.theStack, true)){
int maxLines = 6;
String aText = page.getChapter().pages[0].getText();
BookletChapter chapter = page.getChapter();
String aText = (chapter.pages[0] instanceof PagePicture && chapter.pages.length > 1 ? chapter.pages[1] : chapter.pages[0]).getText();
List text = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(aText != null ? aText : EnumChatFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.noText"), 165);
for(int i = 0; i < Math.min(maxLines, text.size()); i++){
GuiDraw.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? EnumChatFormatting.RESET+""+EnumChatFormatting.BLACK+"..." : ""), 0, 18+25+i*(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT+1), 0, false);
}
break;
}
}
}

View file

@ -40,6 +40,10 @@ public class AssetUtil{
return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/"+file+".png");
}
public static ResourceLocation getBookletGuiLocation(String file){
return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/booklet/"+file+".png");
}
public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, String machineName){
String localMachineName = StringUtil.localize(machineName+".name");
font.drawString(localMachineName, xSize/2-font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE);

View file

@ -448,7 +448,8 @@ booklet.actuallyadditions.chapter.lamps.name=Lamps
booklet.actuallyadditions.chapter.lamps.text.1=<item>Lamps<r> are a block providing lots of light, similar to the mystic Glowstone or Torches, but they can be <imp>dyed with all of the 16 different colors<r> either by <imp>crafting them<r> or by placing them on the ground and <imp>right-clicking them with a piece of dye<r>. <n>When <imp>right-clicking<r> them with an empty hand, they will <imp>turn on and off<r>. If you want them, however, to be toggled using <item>Redstone<r> Power, just place a <item>Lamp Controller<r> next to one.
booklet.actuallyadditions.chapter.treasureChest.name=Treasure Chests
booklet.actuallyadditions.chapter.treasureChest.text.1=<item>Treasure Chests<r> are a semi-uncommon occurence <imp>in Ocean Biomes<r>. They appear on the bottom of the sea, probably left there by bypassing Ships who threw off or lost some load. These Chests however, <imp>hold some valuable items<r>, if you're lucky. Breaking them won't yield you anything, though, you just have to <imp>right-click them<r> to receive some amazing goodies.
booklet.actuallyadditions.chapter.treasureChest.text.1=A <item>Treasure Chest<r> found underwater.
booklet.actuallyadditions.chapter.treasureChest.text.2=<item>Treasure Chests<r> are a semi-uncommon occurence <imp>in Ocean Biomes<r>. They appear on the bottom of the sea, probably left there by bypassing Ships who threw off or lost some load. These Chests however, <imp>hold some valuable items<r>, if you're lucky. Breaking them won't yield you anything, though, you just have to <imp>right-click them<r> to receive some amazing goodies.
booklet.actuallyadditions.chapter.breaker.name=Breakers and Placers
booklet.actuallyadditions.chapter.breaker.text.1=The <item>Breaker<r>... well.. it breaks blocks in front of it. That's about it. It can be oriented in every direction like a Piston. It can be turned off with Redstone.
@ -493,8 +494,9 @@ booklet.actuallyadditions.chapter.crate.text.2=The <item>Chest To Storage Crate
booklet.actuallyadditions.chapter.coffeeMachine.name=Coffee Machine
booklet.actuallyadditions.chapter.coffeeMachine.text.1=The <item>Coffee Machine<r> is a block used to make <item>Coffee<r>, a <imp>potion-like<r> item that gives the user several buffs. <n>To use the coffee machine, you need a <item>Empty Cup<r>, <coffee> <item>Coffee Beans<r>, which can be found in the wild, harvested and <imp>planted on farmland<r> again, <rf> RF/t and <water>mB of Water per cup brewed. <n>On the coffee machine recipe pages at the back, to see what the item does, just hover over the Cup of Coffee.
booklet.actuallyadditions.chapter.coffeeMachine.text.2=To actually give your coffee some buffs, <imp>put some of the items shown on the later pages into the slots on the right<r>. <n>The more slots are filled up with one item, the higher the <imp>Amplifier<r> of the effect will be. The <imp>Maximum Amplifier<r> is the max amount of items to be put into one coffee. <n>Order matters: When using, for example, <item>Milk<r> (to see what it does exactly, go to a later page), you are going to have to plan the items out inside the <imp>numbered slots<r> in such a way that it brews the coffee you want.
booklet.actuallyadditions.chapter.coffeeMachine.text.5=<item>Milk<r> is an important item when brewing coffee: It <imp>adds 2 minutes<r> to the effect while <imp>removing 1 amplifier<r>. When the amplifier of an effect is 1, however, it will remove the effect.
booklet.actuallyadditions.chapter.coffeeMachine.text.6=<i>The fact that you're reading this means that you either have <imp>HarvestCraft<r><i> installed, or that you're looking at the lang file. <rs><n>This does the same thing as <item>Milk<r>, but for veggie guys.
booklet.actuallyadditions.chapter.coffeeMachine.text.3=This is an example of a recipe making a coffee containing <imp>Fire Resistance 1 for 0:20<r> and <imp>Speed 1 for 2:30<r>.
booklet.actuallyadditions.chapter.coffeeMachine.text.6=<item>Milk<r> is an important item when brewing coffee: It <imp>adds 2 minutes<r> to all effects of items in slots with lower numbers while <imp>removing 1 amplifier<r>. When the amplifier of an effect is 1, however, it will remove the effect.
booklet.actuallyadditions.chapter.coffeeMachine.text.7=<i>The fact that you're reading this means that you either have <imp>HarvestCraft<r><i> installed, or that you're looking at the lang file. <rs><n>This does the same thing as <item>Milk<r>, but for veggie guys.
booklet.actuallyadditions.chapter.crusher.name=Crusher and Double Crusher
booklet.actuallyadditions.chapter.crusher.text.1=The <item>Crusher<r> turns every ore, ingot and gem into its corresponding <imp>dust<r> using <rf1> RF/t. <n>When you put in <imp>Ores<r> however, they will yield <imp>2 pieces of dust<r>. <n>The <item>Double Crusher<r> basically does the same, however it can crush two ores at a time and uses <rf2> RF/t. <n>On the following pages, you can see some additional useful recipes for inside the crusher. <n><n><i>He's my crush
@ -578,7 +580,8 @@ booklet.actuallyadditions.chapter.rangedCollector.name=Ranged Collector
booklet.actuallyadditions.chapter.rangedCollector.text.1=The <item>Ranged Collector<r> works much like a hopper, in that it <imp>collects items around it<r>, having the power, however, to pick up items that are in an area of <imp><range> blocks<r> around it. <n>It has a <imp>filter<r> that can be set to <imp>white- or blacklist<r>. <n>This comes with a disadvantage, however: It doesn't auto-output its items.
booklet.actuallyadditions.chapter.hairBalls.name=Ball of Fur-s
booklet.actuallyadditions.chapter.hairBalls.text.1=<item>Balls of Fur<r> are an item rarely dropped by <imp>cats<r> which have been <imp>tamed<r> by the player. <n>Cats are very mysterious creatures as they <imp>appear to get everything stuck in their fur<r>. <item>Balls of Fur<r> may seem disgusting at first, but when removing all of the hair by <imp>right-clicking<r>, they will reveal some <imp>valuable items<r>. <n>Or just some String. <n><n><n><i>FUURRRRRR!!
booklet.actuallyadditions.chapter.hairBalls.text.1=<item>Balls of Fur<r> dropped by <imp>live<r> cats. <n>More information on the next page.
booklet.actuallyadditions.chapter.hairBalls.text.2=<item>Balls of Fur<r> are an item rarely dropped by <imp>cats<r> which have been <imp>tamed<r> by the player. <n>Cats are very mysterious creatures as they <imp>appear to get everything stuck in their fur<r>. <item>Balls of Fur<r> may seem disgusting at first, but when removing all of the hair by <imp>right-clicking<r>, they will reveal some <imp>valuable items<r>. <n>Or just some String. <n><n><n><i>FUURRRRRR!!
booklet.actuallyadditions.chapter.laserRelays.name=Laser Relays
booklet.actuallyadditions.chapter.laserRelays.text.1=The <item>Laser Relay<r> is a block that can <imp>wirelessly transfer RF<r> just by being connected with a <item>Laser Wrench<r>, generating a network. <n>When placing a Power Generator or Receiver next to the relay, it can receive Power <imp>from any other relay<r> in the network. <n>Two relays can be at most <range> blocks apart. <n>During an energy transfer, they have an <imp>Energy Loss<r> of <loss>%.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB