mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Finished up the new booklet.
Woo-hoo!
This commit is contained in:
parent
19cfcfa1c1
commit
c983836f8d
10 changed files with 198 additions and 39 deletions
|
@ -48,7 +48,6 @@ import java.util.List;
|
||||||
|
|
||||||
public final class InitBooklet{
|
public final class InitBooklet{
|
||||||
|
|
||||||
public static BookletChapter chapterIntro;
|
|
||||||
public static BookletChapter[] chaptersIntroduction = new BookletChapter[8];
|
public static BookletChapter[] chaptersIntroduction = new BookletChapter[8];
|
||||||
|
|
||||||
public static void preInit(){
|
public static void preInit(){
|
||||||
|
@ -100,10 +99,10 @@ public final class InitBooklet{
|
||||||
|
|
||||||
private static void initChapters(){
|
private static void initChapters(){
|
||||||
//Getting Started
|
//Getting Started
|
||||||
chapterIntro = new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3));
|
|
||||||
new BookletChapter("reviews", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.BOOK), new PageTextOnly(1));
|
|
||||||
chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM")).setImportant();
|
|
||||||
chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText());
|
chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText());
|
||||||
|
chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM")).setImportant();
|
||||||
|
new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3));
|
||||||
|
new BookletChapter("reviews", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.BOOK), new PageTextOnly(1));
|
||||||
ArrayList<BookletPage> crystalPages = new ArrayList<BookletPage>();
|
ArrayList<BookletPage> crystalPages = new ArrayList<BookletPage>();
|
||||||
crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard()));
|
crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard()));
|
||||||
for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){
|
for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){
|
||||||
|
|
|
@ -98,10 +98,13 @@ public class BookmarkButton extends GuiButton{
|
||||||
list.add(TextFormatting.ITALIC+"Shift-Click to remove");
|
list.add(TextFormatting.ITALIC+"Shift-Click to remove");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
list.add(TextFormatting.GOLD+"None");
|
list.add(TextFormatting.GOLD+"No Bookmark");
|
||||||
|
|
||||||
if(this.booklet instanceof GuiPage){
|
if(this.booklet instanceof GuiPage){
|
||||||
list.add("Click to save current page");
|
list.add("Click to bookmark current page");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
list.add("Open a page to bookmark it");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.button.BookmarkButton;
|
||||||
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
|
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
|
||||||
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
|
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.TexturedButton;
|
import de.ellpeck.actuallyadditions.mod.inventory.gui.TexturedButton;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
@ -28,8 +29,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
@ -45,7 +48,7 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
private GuiButton buttonLeft;
|
private GuiButton buttonLeft;
|
||||||
private GuiButton buttonRight;
|
private GuiButton buttonRight;
|
||||||
private GuiButton buttonBack;
|
private GuiButton buttonBack;
|
||||||
private final BookmarkButton[] bookmarkButtons = new BookmarkButton[12];
|
protected final BookmarkButton[] bookmarkButtons = new BookmarkButton[12];
|
||||||
|
|
||||||
public GuiTextField searchField;
|
public GuiTextField searchField;
|
||||||
|
|
||||||
|
@ -70,17 +73,20 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
this.guiTop = (this.height-this.ySize)/2;
|
this.guiTop = (this.height-this.ySize)/2;
|
||||||
|
|
||||||
if(this.hasPageLeftButton()){
|
if(this.hasPageLeftButton()){
|
||||||
this.buttonLeft = new TexturedButton(RES_LOC_GADGETS, -2000, this.guiLeft-12, this.guiTop+this.ySize-8, 18, 54, 18, 10);
|
List<String> hoverText = Arrays.asList(TextFormatting.GOLD+"Previous Page", TextFormatting.ITALIC+"Or scroll up");
|
||||||
|
this.buttonLeft = new TexturedButton(RES_LOC_GADGETS, -2000, this.guiLeft-12, this.guiTop+this.ySize-8, 18, 54, 18, 10, hoverText);
|
||||||
this.buttonList.add(this.buttonLeft);
|
this.buttonList.add(this.buttonLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.hasPageRightButton()){
|
if(this.hasPageRightButton()){
|
||||||
this.buttonRight = new TexturedButton(RES_LOC_GADGETS, -2001, this.guiLeft+this.xSize-6, this.guiTop+this.ySize-8, 0, 54, 18, 10);
|
List<String> hoverText = Arrays.asList(TextFormatting.GOLD+"Next Page", TextFormatting.ITALIC+"Or scroll down");
|
||||||
|
this.buttonRight = new TexturedButton(RES_LOC_GADGETS, -2001, this.guiLeft+this.xSize-6, this.guiTop+this.ySize-8, 0, 54, 18, 10, hoverText);
|
||||||
this.buttonList.add(this.buttonRight);
|
this.buttonList.add(this.buttonRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.hasBackButton()){
|
if(this.hasBackButton()){
|
||||||
this.buttonBack = new TexturedButton(RES_LOC_GADGETS, -2002, this.guiLeft-15, this.guiTop-3, 36, 54, 18, 10);
|
List<String> hoverText = Arrays.asList(TextFormatting.GOLD+"Go Back", TextFormatting.ITALIC+"Or right-click", TextFormatting.ITALIC.toString()+TextFormatting.GRAY+"Hold Shift for Main Page");
|
||||||
|
this.buttonBack = new TexturedButton(RES_LOC_GADGETS, -2002, this.guiLeft-15, this.guiTop-3, 36, 54, 18, 10, hoverText);
|
||||||
this.buttonList.add(this.buttonBack);
|
this.buttonList.add(this.buttonBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,8 +98,10 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
|
|
||||||
if(this.hasBookmarkButtons()){
|
if(this.hasBookmarkButtons()){
|
||||||
PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer);
|
PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer);
|
||||||
|
|
||||||
|
int xStart = this.guiLeft+this.xSize/2-16*this.bookmarkButtons.length/2;
|
||||||
for(int i = 0; i < this.bookmarkButtons.length; i++){
|
for(int i = 0; i < this.bookmarkButtons.length; i++){
|
||||||
this.bookmarkButtons[i] = new BookmarkButton(1337+i, this.guiLeft+12+i*16, this.guiTop+this.ySize, this);
|
this.bookmarkButtons[i] = new BookmarkButton(1337+i, xStart+i*16, this.guiTop+this.ySize, this);
|
||||||
this.buttonList.add(this.bookmarkButtons[i]);
|
this.buttonList.add(this.bookmarkButtons[i]);
|
||||||
|
|
||||||
if(data.bookmarks[i] != null){
|
if(data.bookmarks[i] != null){
|
||||||
|
@ -109,11 +117,18 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
|
|
||||||
PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer);
|
PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer);
|
||||||
|
|
||||||
|
boolean change = false;
|
||||||
for(int i = 0; i < this.bookmarkButtons.length; i++){
|
for(int i = 0; i < this.bookmarkButtons.length; i++){
|
||||||
data.bookmarks[i] = this.bookmarkButtons[i].assignedPage;
|
if(data.bookmarks[i] != this.bookmarkButtons[i].assignedPage){
|
||||||
|
data.bookmarks[i] = this.bookmarkButtons[i].assignedPage;
|
||||||
|
change = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.lastOpenBooklet = this;
|
data.lastOpenBooklet = this;
|
||||||
|
|
||||||
|
if(change){
|
||||||
|
PacketHandlerHelper.sendPlayerDataPacket(this.mc.thePlayer, true, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -146,9 +161,12 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawScreenPost(int mouseX, int mouseY, float partialTicks){
|
public void drawScreenPost(int mouseX, int mouseY, float partialTicks){
|
||||||
if(this.hasBookmarkButtons()){
|
for(GuiButton button : this.buttonList){
|
||||||
for(BookmarkButton button : this.bookmarkButtons){
|
if(button instanceof BookmarkButton){
|
||||||
button.drawHover(mouseX, mouseY);
|
((BookmarkButton)button).drawHover(mouseX, mouseY);
|
||||||
|
}
|
||||||
|
else if(button instanceof TexturedButton){
|
||||||
|
((TexturedButton)button).drawHover(mouseX, mouseY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,6 +178,28 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
if(this.hasSearchBar()){
|
if(this.hasSearchBar()){
|
||||||
this.searchField.mouseClicked(mouseX, mouseY, mouseButton);
|
this.searchField.mouseClicked(mouseX, mouseY, mouseButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mouseButton == 1 && this.hasBackButton()){
|
||||||
|
this.onBackButtonPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMouseInput() throws IOException{
|
||||||
|
int wheel = Mouse.getEventDWheel();
|
||||||
|
if(wheel != 0){
|
||||||
|
if(wheel < 0){
|
||||||
|
if(this.hasPageRightButton()){
|
||||||
|
this.onPageRightButtonPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(wheel > 0){
|
||||||
|
if(this.hasPageLeftButton()){
|
||||||
|
this.onPageLeftButtonPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.handleMouseInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -197,7 +237,7 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBackButtonPressed(){
|
public void onBackButtonPressed(){
|
||||||
|
this.mc.displayGuiScreen(new GuiMainPage(this.previousScreen));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSearchBar(){
|
public boolean hasSearchBar(){
|
||||||
|
@ -241,8 +281,13 @@ public abstract class GuiBooklet extends GuiBookletBase{
|
||||||
this.mc.displayGuiScreen(this.previousScreen);
|
this.mc.displayGuiScreen(this.previousScreen);
|
||||||
}
|
}
|
||||||
else if(this.hasSearchBar() & this.searchField.isFocused()){
|
else if(this.hasSearchBar() & this.searchField.isFocused()){
|
||||||
|
String lastText = this.searchField.getText();
|
||||||
|
|
||||||
this.searchField.textboxKeyTyped(typedChar, key);
|
this.searchField.textboxKeyTyped(typedChar, key);
|
||||||
this.onSearchBarChanged(this.searchField.getText());
|
|
||||||
|
if(!lastText.equals(this.searchField.getText())){
|
||||||
|
this.onSearchBarChanged(this.searchField.getText());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
super.keyTyped(typedChar, key);
|
super.keyTyped(typedChar, key);
|
||||||
|
|
|
@ -138,6 +138,11 @@ public class GuiEntry extends GuiBooklet{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackButtonPressed(){
|
public void onBackButtonPressed(){
|
||||||
this.mc.displayGuiScreen(this.parentPage);
|
if(!isShiftKeyDown()){
|
||||||
|
this.mc.displayGuiScreen(this.parentPage);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
super.onBackButtonPressed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,20 @@ package de.ellpeck.actuallyadditions.mod.booklet.gui;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.button.EntryButton;
|
import de.ellpeck.actuallyadditions.mod.booklet.button.EntryButton;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -24,6 +34,10 @@ import java.io.IOException;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiMainPage extends GuiBooklet{
|
public class GuiMainPage extends GuiBooklet{
|
||||||
|
|
||||||
|
private GuiButton tutorialButton;
|
||||||
|
private String bookletName;
|
||||||
|
private boolean showTutorial;
|
||||||
|
|
||||||
public GuiMainPage(GuiScreen previousScreen){
|
public GuiMainPage(GuiScreen previousScreen){
|
||||||
super(previousScreen, null);
|
super(previousScreen, null);
|
||||||
}
|
}
|
||||||
|
@ -32,15 +46,29 @@ public class GuiMainPage extends GuiBooklet{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
for(int i = 0; i < BUTTONS_PER_PAGE; i++){
|
int flavor = 1;
|
||||||
if(ActuallyAdditionsAPI.BOOKLET_ENTRIES.size() > i){
|
if(this.mc.theWorld.rand.nextFloat() <= 0.1){
|
||||||
IBookletEntry entry = ActuallyAdditionsAPI.BOOKLET_ENTRIES.get(i);
|
flavor = MathHelper.getRandomIntegerInRange(this.mc.theWorld.rand, 2, 7);
|
||||||
this.buttonList.add(new EntryButton(i, this.guiLeft+156, this.guiTop+11+i*13, 115, 10, "- "+entry.getLocalizedNameWithFormatting(), null));
|
}
|
||||||
}
|
this.bookletName = "info."+ModUtil.MOD_ID+".booklet.manualName.1."+flavor;
|
||||||
else{
|
|
||||||
return;
|
PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer);
|
||||||
}
|
if(!data.didBookTutorial){
|
||||||
|
this.showTutorial = true;
|
||||||
|
|
||||||
|
this.tutorialButton = new GuiButton(666666, this.guiLeft+140/2-50, this.guiTop+146, 100, 20, "Please click me <3");
|
||||||
|
this.buttonList.add(this.tutorialButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < BUTTONS_PER_PAGE; i++){
|
||||||
|
if(ActuallyAdditionsAPI.BOOKLET_ENTRIES.size() > i){
|
||||||
|
IBookletEntry entry = ActuallyAdditionsAPI.BOOKLET_ENTRIES.get(i);
|
||||||
|
this.buttonList.add(new EntryButton(i, this.guiLeft+156, this.guiTop+11+i*13, 115, 10, "- "+entry.getLocalizedNameWithFormatting(), null));
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,11 +81,80 @@ public class GuiMainPage extends GuiBooklet{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(this.showTutorial && button == this.tutorialButton){
|
||||||
|
if(this.hasBookmarkButtons()){
|
||||||
|
if(!isShiftKeyDown()){
|
||||||
|
for(int i = 0; i < InitBooklet.chaptersIntroduction.length; i++){
|
||||||
|
this.bookmarkButtons[i].assignedPage = InitBooklet.chaptersIntroduction[i].getAllPages()[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.showTutorial = false;
|
||||||
|
this.tutorialButton.visible = false;
|
||||||
|
|
||||||
|
PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer);
|
||||||
|
data.didBookTutorial = true;
|
||||||
|
PacketHandlerHelper.sendPlayerDataPacket(this.mc.thePlayer, true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
super.actionPerformed(button);
|
super.actionPerformed(button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreenPre(int mouseX, int mouseY, float partialTicks){
|
||||||
|
super.drawScreenPre(mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
|
String strg = TextFormatting.DARK_GREEN+StringUtil.localize(this.bookletName);
|
||||||
|
this.fontRendererObj.drawString(strg, this.guiLeft+72-this.fontRendererObj.getStringWidth(strg)/2-3, this.guiTop+19, 0);
|
||||||
|
strg = TextFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID+".booklet.manualName.2");
|
||||||
|
this.fontRendererObj.drawString(strg, this.guiLeft+72-this.fontRendererObj.getStringWidth(strg)/2-3, this.guiTop+19+this.fontRendererObj.FONT_HEIGHT, 0);
|
||||||
|
|
||||||
|
String versionStrg;
|
||||||
|
String playerName = Minecraft.getMinecraft().thePlayer.getName();
|
||||||
|
|
||||||
|
if(Util.isDevVersion()){
|
||||||
|
versionStrg = "Dev's Edition";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
String modVersion = Util.getMajorModVersion();
|
||||||
|
if(playerName.equalsIgnoreCase("dqmhose")){
|
||||||
|
versionStrg = "Pants Edition";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("TwoOfEight") || playerName.equalsIgnoreCase("BootyToast")){
|
||||||
|
versionStrg = "Illustrator's Edition";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("KittyVanCat")){
|
||||||
|
versionStrg = "Cat's Edition";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("canitzp")){
|
||||||
|
versionStrg = "P's Edition";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("Ellpeck")){
|
||||||
|
versionStrg = "Editor's Edition";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("direwolf20")){
|
||||||
|
versionStrg = "Edition 20";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("dannydjdk") || playerName.equalsIgnoreCase("andrew_period")){
|
||||||
|
versionStrg = "Derp's Edition";
|
||||||
|
}
|
||||||
|
else if(playerName.equalsIgnoreCase("mezz")){
|
||||||
|
versionStrg = "Just Enough Editions";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
versionStrg = StringUtil.localize("info."+ModUtil.MOD_ID+".booklet.edition")+" "+modVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
strg = TextFormatting.GOLD+TextFormatting.ITALIC.toString()+"-"+versionStrg+"-";
|
||||||
|
this.fontRendererObj.drawString(strg, this.guiLeft+72-this.fontRendererObj.getStringWidth(strg)/2-3, this.guiTop+40, 0);
|
||||||
|
|
||||||
|
if(this.showTutorial){
|
||||||
|
String text = TextFormatting.BLUE+"It looks like this is the first time you are using this manual. \nIf you click the button below, some useful bookmarks will be stored at the bottom of the GUI. You should definitely check them out to get started with "+ModUtil.NAME+"! \nIf you don't want this, shift-click the button.";
|
||||||
|
this.renderSplitScaledAsciiString(text, this.guiLeft+11, this.guiTop+55, 0, false, 0.75F, 120);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addOrModifyItemRenderer(ItemStack renderedStack, int x, int y, float scale, boolean shouldTryTransfer){
|
public void addOrModifyItemRenderer(ItemStack renderedStack, int x, int y, float scale, boolean shouldTryTransfer){
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -225,6 +224,11 @@ public class GuiPage extends GuiBooklet{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackButtonPressed(){
|
public void onBackButtonPressed(){
|
||||||
this.mc.displayGuiScreen(this.parentPage);
|
if(!isShiftKeyDown()){
|
||||||
|
this.mc.displayGuiScreen(this.parentPage);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
super.onBackButtonPressed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public final class PlayerData{
|
||||||
|
|
||||||
public boolean displayTesla;
|
public boolean displayTesla;
|
||||||
public boolean bookGottenAlready;
|
public boolean bookGottenAlready;
|
||||||
|
public boolean didBookTutorial;
|
||||||
|
|
||||||
public IBookletPage[] bookmarks = new IBookletPage[12];
|
public IBookletPage[] bookmarks = new IBookletPage[12];
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ public final class PlayerData{
|
||||||
public void readFromNBT(NBTTagCompound compound){
|
public void readFromNBT(NBTTagCompound compound){
|
||||||
this.displayTesla = compound.getBoolean("DisplayTesla");
|
this.displayTesla = compound.getBoolean("DisplayTesla");
|
||||||
this.bookGottenAlready = compound.getBoolean("BookGotten");
|
this.bookGottenAlready = compound.getBoolean("BookGotten");
|
||||||
|
this.didBookTutorial = compound.getBoolean("DidTutorial");
|
||||||
|
|
||||||
NBTTagList bookmarks = compound.getTagList("Bookmarks", 8);
|
NBTTagList bookmarks = compound.getTagList("Bookmarks", 8);
|
||||||
for(int i = 0; i < bookmarks.tagCount(); i++){
|
for(int i = 0; i < bookmarks.tagCount(); i++){
|
||||||
|
@ -77,6 +79,7 @@ public final class PlayerData{
|
||||||
public void writeToNBT(NBTTagCompound compound){
|
public void writeToNBT(NBTTagCompound compound){
|
||||||
compound.setBoolean("DisplayTesla", this.displayTesla);
|
compound.setBoolean("DisplayTesla", this.displayTesla);
|
||||||
compound.setBoolean("BookGotten", this.bookGottenAlready);
|
compound.setBoolean("BookGotten", this.bookGottenAlready);
|
||||||
|
compound.setBoolean("DidTutorial", this.didBookTutorial);
|
||||||
|
|
||||||
NBTTagList bookmarks = new NBTTagList();
|
NBTTagList bookmarks = new NBTTagList();
|
||||||
for(IBookletPage bookmark : this.bookmarks){
|
for(IBookletPage bookmark : this.bookmarks){
|
||||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -40,11 +41,6 @@ public class TexturedButton extends GuiButton{
|
||||||
this.textList.addAll(hoverTextList);
|
this.textList.addAll(hoverTextList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTexturePos(int x, int y){
|
|
||||||
this.texturePosX = x;
|
|
||||||
this.texturePosY = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawButton(Minecraft minecraft, int x, int y){
|
public void drawButton(Minecraft minecraft, int x, int y){
|
||||||
if(this.visible){
|
if(this.visible){
|
||||||
|
@ -63,4 +59,11 @@ public class TexturedButton extends GuiButton{
|
||||||
this.mouseDragged(minecraft, x, y);
|
this.mouseDragged(minecraft, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void drawHover(int x, int y){
|
||||||
|
if(this.isMouseOver()){
|
||||||
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
GuiUtils.drawHoveringText(this.textList, x, y, mc.displayWidth, mc.displayHeight, -1, mc.fontRendererObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ public final class PacketHandler{
|
||||||
UUID id = compound.getUniqueId("UUID");
|
UUID id = compound.getUniqueId("UUID");
|
||||||
PlayerData.getDataFromPlayer(id).readFromNBT(data);
|
PlayerData.getDataFromPlayer(id).readFromNBT(data);
|
||||||
if(compound.getBoolean("Log")){
|
if(compound.getBoolean("Log")){
|
||||||
ModUtil.LOGGER.info("Receiving (new or changed) Player Data for current player with UUID "+id+".");
|
ModUtil.LOGGER.info("Receiving (new or changed) Player Data for player with UUID "+id+".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -750,7 +750,7 @@ booklet.actuallyadditions.clickToSeeRecipe=Click to see more Information
|
||||||
booklet.actuallyadditions.amountOfWordsAndChars=Total: %s words, %s characters
|
booklet.actuallyadditions.amountOfWordsAndChars=Total: %s words, %s characters
|
||||||
|
|
||||||
#Booklet Chapters
|
#Booklet Chapters
|
||||||
booklet.actuallyadditions.chapter.intro.name=An Introduction to ActAdd
|
booklet.actuallyadditions.chapter.intro.name=A story about ActAdd
|
||||||
booklet.actuallyadditions.chapter.intro.text.1=<i>For too long have the people of Minecraftia toiled under a relentless whip. A whip more hurtful and more injurious than that of any slave-master: inconvenience. Aye, the thousand million inconveniences that make up the grind, that force players to waste hours- nay, days!- chopping wood and farming wheat and other such mundane tasks, just to momentarily escape the remorseless tedium and experience the true joys of Minecraftia, building, caving and adventuring into the beautiful uncharted abundance
|
booklet.actuallyadditions.chapter.intro.text.1=<i>For too long have the people of Minecraftia toiled under a relentless whip. A whip more hurtful and more injurious than that of any slave-master: inconvenience. Aye, the thousand million inconveniences that make up the grind, that force players to waste hours- nay, days!- chopping wood and farming wheat and other such mundane tasks, just to momentarily escape the remorseless tedium and experience the true joys of Minecraftia, building, caving and adventuring into the beautiful uncharted abundance
|
||||||
booklet.actuallyadditions.chapter.intro.text.2=<i>of the world. Yet no sooner has one immersed oneself in this creative enterprise than the inconveniences return, like millions of furious bees pestering, stinging, swarming all over you until the game ceases to be enjoyable, and you are driven away from it forever. To that end, a certain Ellpeck has created this Actual Addition to the world of Minecraft, that will allow the player to better engage with the core experiences of the game- building and adventuring- by automating and streamlining the monotony that
|
booklet.actuallyadditions.chapter.intro.text.2=<i>of the world. Yet no sooner has one immersed oneself in this creative enterprise than the inconveniences return, like millions of furious bees pestering, stinging, swarming all over you until the game ceases to be enjoyable, and you are driven away from it forever. To that end, a certain Ellpeck has created this Actual Addition to the world of Minecraft, that will allow the player to better engage with the core experiences of the game- building and adventuring- by automating and streamlining the monotony that
|
||||||
booklet.actuallyadditions.chapter.intro.text.3=<i>is grinding in Minecraft. Therefore, Ellpeck humbly presents to you this Actually Additions Manual, that shall teach you the ways of this modification and, ultimately, allow you to transcend inconvenience and attain enlightenment. <r><n><n> ~by <imp>Tulkas<r>
|
booklet.actuallyadditions.chapter.intro.text.3=<i>is grinding in Minecraft. Therefore, Ellpeck humbly presents to you this Actually Additions Manual, that shall teach you the ways of this modification and, ultimately, allow you to transcend inconvenience and attain enlightenment. <r><n><n> ~by <imp>Tulkas<r>
|
||||||
|
@ -935,9 +935,9 @@ booklet.actuallyadditions.chapter.crystals.text.5=When you have crafted a couple
|
||||||
booklet.actuallyadditions.chapter.crystals.text.6=<n><n><n><i>Molecular Transformilator
|
booklet.actuallyadditions.chapter.crystals.text.6=<n><n><n><i>Molecular Transformilator
|
||||||
|
|
||||||
booklet.actuallyadditions.chapter.bookTutorial.name=Intro to the Manual
|
booklet.actuallyadditions.chapter.bookTutorial.name=Intro to the Manual
|
||||||
booklet.actuallyadditions.chapter.bookTutorial.text.1=The <item>Actually Additions Manual<r> is the place to get <imp>information about the mod<r> in lots of different ways. It contains <imp>in-depth descriptions<r> of features and more. <n><n>Here is a quick overview: <n>The <item>orange buttons<r> on the bottom of the page, from left to right, can be used to <imp>go a page to the left<r> in the current chapter, <imp>go back one level<r>, and to <imp>go a page to the right<r> in the current chapter. <n><n><i>Press the button on the right to turn the page.
|
booklet.actuallyadditions.chapter.bookTutorial.text.1=The <item>Actually Additions Manual<r>, the book you are looking at right now, contains a variety of <imp>useful information about all of the items<r>. <n>Once you get the hang of it, it is very easy to navigate. Here is a quick rundown: <n><n>While you are in a <item>chapter<r>, like this one, you can use the <imp>white buttons at the bottom<r> to turn the page back or forwards. This can also be done by <imp>using the scroll wheel<r>. <n>Chapters, however, aren't the only thing that this book consists of.
|
||||||
booklet.actuallyadditions.chapter.bookTutorial.text.2=The manual is split into <imp>three main parts<r> of hierarchy. There is the <item>front page<r>, multiple <item>overwiew pages for specific topics<r> or chapters and <item>chapters<r> themselves. As said before, the <item>orange button in the middle<r> can be used to go back a level. <n><n>There are also a variety of <imp>other functions<r>. In the bottom right, you can see a <item>search bar<r>. Once clicked on, this will allow you to <imp>search for items and chapters<r> via key words. <n><n><i>Turn the page again now.
|
booklet.actuallyadditions.chapter.bookTutorial.text.2=Were you to <imp>go back<r> a level via the <imp>buttom on the top left<r> or via <imp>right-clicking<r>, you would find yourself inside an <item>entry<r>. Entries contain all chapters that are related to <imp>a specific topic<r>. Here, you can also <imp>turn pages<r> and click the items on the page. <n><n>Were you to <imp>go back another level<r> (again, via the button on the top left or right-clicking), you would find yourself on the <item>main page<r> of the manual. <n><n><i>Turn the page now via the button on the bottom right.
|
||||||
booklet.actuallyadditions.chapter.bookTutorial.text.3=The <item>bookmarks<r> on the bottom can store different pages and chapters <imp>for later use<r>. Hover over them to see how they work. <n><n>At the top, there is a variety of buttons <imp>linking to other things<r>. Mainly, on the top right, there is a <item>config button<r> and an <item>achievement button<r>. These can be used to quickly access said things. <n><n><i>Once you are done reading this chapter, press the middle orange button on the bottom twice to reach the index.
|
booklet.actuallyadditions.chapter.bookTutorial.text.3=On the <item>main page<r>, you can see (and click on!) a list of <imp>all of the entries<r>. <n><n>The <item>bookmarks<r> are placed at the <imp>bottom of the booklet<r>. While you are <imp>in a chapter<r>, you can <imp>bookmark<r> the page you are currently on <imp>for later viewing<r>. <n><n>The booklet also has <imp>a lot of other functions<r>, though. Look around in the GUI to explore them all! <n><n><i>Now press the back button on the top left or right-click to leave this chapter.
|
||||||
|
|
||||||
booklet.actuallyadditions.chapter.reconstructorLenses.name=Intro to Lenses
|
booklet.actuallyadditions.chapter.reconstructorLenses.name=Intro to Lenses
|
||||||
booklet.actuallyadditions.chapter.reconstructorLenses.text.1=The <item>Atomic Reconstructor<r>, by default, can only convert some blocks. <n>This can be changed, however, with <item>Lenses<r>. They can be attached to the Reconstructor via <imp>right-clicking<r> with them in hand. To remove them, right-click with an empty hand. <n>They all use a different amount of power and will only activate <imp>once they have it<r>. <n><item>Lenses<r> have lots of different features and uses, as you can see in <imp>this chapter<r>. <n>However, there is also some <imp>other useful recipes<r> too.
|
booklet.actuallyadditions.chapter.reconstructorLenses.text.1=The <item>Atomic Reconstructor<r>, by default, can only convert some blocks. <n>This can be changed, however, with <item>Lenses<r>. They can be attached to the Reconstructor via <imp>right-clicking<r> with them in hand. To remove them, right-click with an empty hand. <n>They all use a different amount of power and will only activate <imp>once they have it<r>. <n><item>Lenses<r> have lots of different features and uses, as you can see in <imp>this chapter<r>. <n>However, there is also some <imp>other useful recipes<r> too.
|
||||||
|
|
Loading…
Reference in a new issue