Tutorial entry merger

This commit is contained in:
Vasco Lavos committed 2015-10-23 14:58:50 +01:00
1 parent c4d8e9bf74
commit 0c6e895944
3 files changed
+23 -10

No files matched your search

@@ -59,7 +59,6 @@ public final class LexiconData {
public static LexiconEntry welcome;
public static LexiconEntry tutorial;
public static LexiconEntry introVideo;
public static LexiconEntry flowers;
public static LexiconEntry apothecary;
@@ -316,9 +315,6 @@ public final class LexiconData {
welcome = new WLexiconEntry();
tutorial = new TLexiconEntry();
introVideo = new BLexiconEntry(LibLexicon.BASICS_INTRO_VIDEO, categoryBasics);
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),
new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeFertilizerPowder), new PageCraftingRecipe("8", ModCraftingRecipes.recipeFerilizerDye), new PageText("10"), new PageCraftingRecipe("11", ModCraftingRecipes.recipesPetalsDouble), new PageCraftingRecipe("9", ModCraftingRecipes.recipesPetalBlocks)).setIcon(new ItemStack(ModBlocks.flower, 1, 6));
@@ -10,6 +10,11 @@
*/
package vazkii.botania.common.lexicon.page;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ChatComponentTranslation;
@@ -23,7 +28,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PageTutorial extends PageText {
GuiButton button;
GuiButton buttonText, buttonVideo;
public PageTutorial(String unlocalizedName) {
super(unlocalizedName);
@@ -31,22 +36,32 @@ public class PageTutorial extends PageText {
@Override
public void onOpened(IGuiLexiconEntry gui) {
button = new GuiButton(101, gui.getLeft() + 30, gui.getTop() + gui.getHeight() - 50, gui.getWidth() - 60, 20, StatCollector.translateToLocal("botaniamisc.startTutorial"));
gui.getButtonList().add(button);
buttonText = new GuiButton(101, gui.getLeft() + 20, gui.getTop() + gui.getHeight() - 40, 50, 20, StatCollector.translateToLocal("botaniamisc.tutorialText"));
buttonVideo = new GuiButton(101, gui.getLeft() + 75, gui.getTop() + gui.getHeight() - 40, 50, 20, StatCollector.translateToLocal("botaniamisc.tutorialVideo"));
gui.getButtonList().add(buttonText);
gui.getButtonList().add(buttonVideo);
}
@Override
public void onClosed(IGuiLexiconEntry gui) {
gui.getButtonList().remove(button);
gui.getButtonList().remove(buttonText);
gui.getButtonList().remove(buttonVideo);
}
@Override
@SideOnly(Side.CLIENT)
public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) {
if(button == this.button) {
if(button == buttonText) {
GuiLexicon.startTutorial();
Minecraft.getMinecraft().displayGuiScreen(new GuiLexicon());
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.tutorialStarted").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
} else if(button == buttonVideo && Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=rx0xyejC6fI"));
} catch(Exception e) {
e.printStackTrace();
}
}
}
@@ -143,6 +143,8 @@ botaniamisc.changes3=&oEveryone is afraid of change, yet change is the force tha
botaniamisc.changes4=&fShift-Left Click&7 to read the changes since then
botaniamisc.changes5=&fLeft Click&7 to dismiss this
botaniamisc.badArena=As hard as you try, the Beacon will not accept your sacrifice. You believe the ritual grounds might be improper. It might be a good idea to check for obstructions on the nearby area or large gaps on the floor.
botaniamisc.tutorialText=Ingame
botaniamisc.tutorialVideo=Video
# NEI INTEGRATION
botania.nei.brewery=Botanical Brewery
@@ -1916,7 +1918,7 @@ botania.page.welcome8=&oDear reader, I welcome you to the realm of Botania.&r<br
# -- 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.
botania.page.tutorial0=While one could just go through the various entries in the book at their leisure, there's also a tutorial of sorts available. Clicking the buttons below will guide you through the basic concepts of Botania.<br>You can pick between an ingame guided tour of this book, or a short(-ish) video.
# -- AN INTRODUCTORY CLIP
botania.entry.introVideo=An Introductory Clip