mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
Added the new "Welcome to Botania" page.
This commit is contained in:
1 parent
1860539aee
commit
82711c44ef
7 files changed
+70
-4
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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),
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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())
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in new issue
Block a user