diff --git a/src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java index 5b843896e..432576a17 100644 --- a/src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java @@ -49,5 +49,10 @@ public class BLexiconEntry extends LexiconEntry { public String getWebLink() { return "http://botaniamod.net/lexicon.php#" + unlocalizedName; } + + @Override + public int compareTo(LexiconEntry o) { + return o instanceof WLexiconEntry ? 1 : super.compareTo(o); + } } diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 6df567cac..77c8fd466 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -54,6 +54,7 @@ import vazkii.botania.common.lib.LibLexicon; public final class LexiconData { + public static LexiconEntry welcome; public static LexiconEntry tutorial; public static LexiconEntry introVideo; @@ -276,10 +277,11 @@ public final class LexiconData { LexiconCategory categoryMisc = BotaniaAPI.categoryMisc; // BASICS ENTRIES + welcome = new WLexiconEntry(); tutorial = new TLexiconEntry(); introVideo = new BLexiconEntry(LibLexicon.BASICS_INTRO_VIDEO, categoryBasics); - introVideo.setPriority().setLexiconPages(new PageGuide("0")); + introVideo.setPriority().setLexiconPages(new PageGuide("0")).setIcon(new ItemStack(Items.book)); flowers = new BLexiconEntry(LibLexicon.BASICS_FLOWERS, categoryBasics); flowers.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_FLOWERS), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipesPetals), new PageCraftingRecipe("4", ModCraftingRecipes.recipePestleAndMortar), new PageCraftingRecipe("5", ModCraftingRecipes.recipesDyes), diff --git a/src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java index f19609f0f..d03e649f5 100644 --- a/src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java @@ -10,6 +10,8 @@ */ package vazkii.botania.common.lexicon; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.lexicon.page.PageTutorial; import vazkii.botania.common.lib.LibLexicon; @@ -19,6 +21,7 @@ public class TLexiconEntry extends BLexiconEntry { public TLexiconEntry() { super(LibLexicon.BASICS_TUTORIAL, BotaniaAPI.categoryBasics); setPriority(); + setIcon(new ItemStack(Items.book)); setLexiconPages(new PageTutorial("0")); } diff --git a/src/main/java/vazkii/botania/common/lexicon/WLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/WLexiconEntry.java new file mode 100644 index 000000000..e6fc5df8f --- /dev/null +++ b/src/main/java/vazkii/botania/common/lexicon/WLexiconEntry.java @@ -0,0 +1,41 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [May 30, 2015, 10:54:30 PM (GMT)] + */ +package vazkii.botania.common.lexicon; + +import net.minecraft.item.ItemStack; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.lexicon.LexiconPage; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lexicon.page.PageText; +import vazkii.botania.common.lib.LibLexicon; + +public class WLexiconEntry extends BLexiconEntry { + + private static final int PAGES = 9; + + public WLexiconEntry() { + super(LibLexicon.BASICS_WELCOME, BotaniaAPI.categoryBasics); + setPriority(); + setIcon(new ItemStack(ModItems.cosmetic, 1, 31)); + + LexiconPage[] pages = new LexiconPage[PAGES]; + for(int i = 0; i < PAGES; i++) + pages[i] = new PageText("" + i); + setLexiconPages(pages); + } + + @Override + public int compareTo(LexiconEntry o) { + return -1; + } + +} diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageText.java b/src/main/java/vazkii/botania/common/lexicon/page/PageText.java index 4eb8841d2..c20a0547c 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageText.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageText.java @@ -64,13 +64,15 @@ public class PageText extends LexiconPage { String prev = lineStr; String spaced = token + " "; lineStr += spaced; + + controlCodes = toControlCodes(getControlCodes(prev)); if(font.getStringWidth(lineStr) > width) { lines.add(words); - lineStr = spaced; + lineStr = controlCodes + spaced; words = new ArrayList(); } - controlCodes = getControlCodes(prev); - words.add(toControlCodes(controlCodes) + token); + + words.add(controlCodes + token); } if(!lineStr.isEmpty()) diff --git a/src/main/java/vazkii/botania/common/lib/LibLexicon.java b/src/main/java/vazkii/botania/common/lib/LibLexicon.java index ae62bb69a..d96e95cd0 100644 --- a/src/main/java/vazkii/botania/common/lib/LibLexicon.java +++ b/src/main/java/vazkii/botania/common/lib/LibLexicon.java @@ -25,6 +25,7 @@ public final class LibLexicon { public static final String CATEGORY_ALFHOMANCY = "alfhomancy"; public static final String CATEGORY_MISC = "misc"; + public static final String BASICS_WELCOME = "welcome"; public static final String BASICS_TUTORIAL = "tutorial"; public static final String BASICS_INTRO_VIDEO = "introVideo"; diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 56269db1a..3a5ccdd4a 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1386,6 +1386,18 @@ botania.category.misc=Miscellaneous # LEXICON ENTRIES # - BASIC +# -- WELCOME TO BOTANIA +botania.entry.welcome=Welcome To Botania +botania.page.welcome0=&oWhat is peace? Is it truly just a lack of combat? Is it years of sitting quietly in a garden, surrounded by flowers? Is it watching over a kingdom that you are able to call your own? Is it the completion of almost every task known to man? Is it the ability to watch numbers of resources steadily rise as you watch your collection grow? +botania.page.welcome1=&oIs peace something that can be obtained easily, without work - or is it something difficult to obtain?
Let's say for a moment - not even a second - that peace is truly just a lack of work; peaceful days surrounded by flowers. +botania.page.welcome2=&oYears spent watching time tick by while you watch your flora perform every single task imaginable, without outside help from polluting machines or computers tangled in cables and pipes.
Now imagine that everything we just talked about was possible. +botania.page.welcome3=&oImagine that through your hard labor - your cultivation of flowers, your manipulation of mana, your knowledge of the mechanisms of the world and redstone - you could obtain that dreamlike state. Imagine that you could have everything you could ever desire automated with flora. Flora, some magic, and your own ingenuity. +botania.page.welcome4=&oWith the help of this book, your dreams will become a reality.
The name of this book is deceptive. Despite being called the Lexica Botania, this tome focuses on far more than just flowers. It focuses on a variety of devices, both magical and bordering on technological. +botania.page.welcome5=&oIt holds the secrets of the elves, who have long ago fled from this world, as well as possible clues to the origins of the very world itself. For anyone with a basic knowledge of redstone and the creativity to put it to use, this book offers answers to nearly every problem known to man, without the need to use foreign schools of magic or machinery. +botania.page.welcome6=&oThis book contains instructions on how to perform nearly every task that one could ever need, with only the use of what's in it, and available in the world of Minecraft, assuming you're up to the task of putting them together in ingenious ways.
Try it out, you'll be amazed at what you can do without outside interference. +botania.page.welcome7=&oThe school of botany does not solely apply to those with a knack for complex thought processes.
Introduction to the art is simple, and the rewards are vast. A wide range of magical accessories and instruments allow for empowering of one who decides to study the various options therein. +botania.page.welcome8=&oDear reader, I welcome you to the realm of Botania.&r
- Written by &nGideon Seymour&r, guest writer. (Adapted for use) + # -- TUTORIAL OF THE BASICS botania.entry.tutorial=A Tutorial of the Basics botania.page.tutorial0=While one could just go through the various entries in the book at their issue, there's also a "guided tour" of sorts available. Clicking the button below will guide you through the pages useful to getting the gist of the basic concepts of Botania.