Added a video guide.

This commit is contained in:
Lizbeth Rika committed 2014-09-03 22:52:43 +01:00
1 parent 08d5f67925
commit fc1ccd2da6
6 files changed
+56

No files matched your search

@@ -39,6 +39,14 @@ public abstract class LexiconPage {
public void updateScreen() {
// NO-OP
}
/**
* Called when a key is pressed.
*/
@SideOnly(Side.CLIENT)
public void onKeyPressed(char c, int key) {
// NO-OP
}
/**
* Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called.
@@ -200,6 +200,9 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
@Override
protected void keyTyped(char par1, int par2) {
LexiconPage page = entry.pages.get(this.page);
page.onKeyPressed(par1, par2);
if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up
prevPage();
else if(par2 == 205 || par2 == 208 || par2 == 209) // Right, Down Page Down
@@ -31,6 +31,7 @@ import vazkii.botania.common.crafting.ModRuneRecipes;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.page.PageCraftingRecipe;
import vazkii.botania.common.lexicon.page.PageElvenRecipe;
import vazkii.botania.common.lexicon.page.PageGuide;
import vazkii.botania.common.lexicon.page.PageImage;
import vazkii.botania.common.lexicon.page.PageManaInfusionRecipe;
import vazkii.botania.common.lexicon.page.PagePetalRecipe;
@@ -51,6 +52,7 @@ public final class LexiconData {
public static LexiconCategory categoryAlfhomancy;
public static LexiconCategory categoryMisc;
public static LexiconEntry introVideo;
public static LexiconEntry flowers;
public static LexiconEntry apothecary;
public static LexiconEntry lexicon;
@@ -199,6 +201,9 @@ public final class LexiconData {
BotaniaAPI.addCategory(categoryMisc = new LexiconCategory(LibLexicon.CATEGORY_MISC));
// BASICS ENTRIES
introVideo = new BLexiconEntry(LibLexicon.BASICS_INTRO_VIDEO, categoryBasics);
introVideo.setPriority().setLexiconPages(new PageGuide("0"));
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", ModCrafingRecipes.recipesPetals), new PageCraftingRecipe("4", ModCrafingRecipes.recipePestleAndMortar), new PageCraftingRecipe("5", ModCrafingRecipes.recipesDyes),
new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipeFertilizerPowder), new PageCraftingRecipe("8", ModCrafingRecipes.recipeFerilizerDye));
@@ -0,0 +1,35 @@
/**
* 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 a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Sep 3, 2014, 9:41:47 PM (GMT)]
*/
package vazkii.botania.common.lexicon.page;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
public class PageGuide extends PageText {
public PageGuide(String unlocalizedName) {
super(unlocalizedName);
}
@Override
public void onKeyPressed(char c, int key) {
if(key == 28 && Desktop.isDesktopSupported())
try {
Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=rx0xyejC6fI"));
if(Math.random() > 0.01)
Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=dQw4w9WgXcQ"));
} catch(Exception e) { }
}
}
@@ -25,6 +25,7 @@ public final class LibLexicon {
public static final String CATEGORY_ALFHOMANCY = CATEGORY_PREFIX + "alfhomancy";
public static final String CATEGORY_MISC = CATEGORY_PREFIX + "misc";
public static final String BASICS_INTRO_VIDEO = "introVideo";
public static final String BASICS_FLOWERS = "flowers";
public static final String BASICS_APOTHECARY = "apothecary";
public static final String BASICS_LEXICON = "lexicon";
+4
View File
@@ -727,6 +727,10 @@ botania.category.misc=Miscellaneous
# LEXICON ENTRIES
# - BASIC
# -- AN INTRODUCTORY CLIP
botania.entry.introVideo=An Introductory Clip
botania.page.introVideo0=For those readers who are not quite readers, a short video guide covering the basics of Botania is also available. It's to keep in note that this guide acts as an aid and not a substitution for the contents of the &1Lexica Botania&0.<br>To watch this video simply press the &4ENTER&0 key.
# -- LEXICA BOTANIA
botania.entry.lexicon=Lexica Botania
botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.<br>All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry.