From bb73d2ceb518cdb92003c66700f7bbb05f2b60fb Mon Sep 17 00:00:00 2001 From: Nirudium <37319157+Nirudium@users.noreply.github.com> Date: Tue, 10 Apr 2018 23:52:43 -0700 Subject: [PATCH 1/4] Update README.md (#104) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2bc175f..1ce7530 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ ## Compile from Source Note: Git MUST be installed and in the system path to use our scripts. * setup: Run [gradle]in the repository root: `gradlew[.bat] [setupDevWorkspace|setupDecompWorkspace] [eclipse|idea]` -* build: Run [gradle]in the repository root: `gradlew[.bat] build' -* if obscure gradle issues are found try running 'gradlew clean' or/and 'gradlew cleanCache' +* build: Run [gradle]in the repository root: `gradlew[.bat] build` +* if obscure gradle issues are found try running `gradlew clean` or/and `gradlew cleanCache` ## Issue reporting Please include the following: From 849da5c03477cbdfb139775da6ef7e14c28b33f1 Mon Sep 17 00:00:00 2001 From: Arthur Uzulin Date: Wed, 18 Jul 2018 06:08:02 +1000 Subject: [PATCH 2/4] [Books] Added separate render layer for tooltips - Added drawText method that takes a list of for tooltip for separate rendering - Deprecated TextDataRenderer's old drawText in favour of the new one - Made TextDataRenderer's drawTooltip method public and renamed from drawHoveringText - Updated ElementText to follow new norms This fixes Tinkers book's tooltip compositing issues --- .../mantle/client/gui/book/GuiBook.java | 16 ++++++ .../client/gui/book/TextDataRenderer.java | 51 ++++++++++--------- .../client/gui/book/element/BookElement.java | 3 ++ .../client/gui/book/element/ElementText.java | 14 ++++- 4 files changed, 57 insertions(+), 27 deletions(-) diff --git a/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java b/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java index 96714b5..432c974 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java @@ -255,6 +255,14 @@ public class GuiBook extends GuiScreen implements IProgressMeter { element.drawOverlay(mX, mY, partialTicks, fontRenderer); } + // Not foreach to prevent conmodification crashes + for(int i = 0; i < leftElements.size(); i++) { + BookElement element = leftElements.get(i); + + GlStateManager.color(1F, 1F, 1F, 1F); + element.drawTooltips(mX, mY, partialTicks, fontRenderer); + } + GlStateManager.popMatrix(); } @@ -297,6 +305,14 @@ public class GuiBook extends GuiScreen implements IProgressMeter { element.drawOverlay(mX, mY, partialTicks, fontRenderer); } + // Not foreach to prevent conmodification crashes + for(int i = 0; i < rightElements.size(); i++) { + BookElement element = rightElements.get(i); + + GlStateManager.color(1F, 1F, 1F, 1F); + element.drawTooltips(mX, mY, partialTicks, fontRenderer); + } + GlStateManager.popMatrix(); } } diff --git a/src/main/java/slimeknights/mantle/client/gui/book/TextDataRenderer.java b/src/main/java/slimeknights/mantle/client/gui/book/TextDataRenderer.java index 4341963..771d9c3 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/TextDataRenderer.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/TextDataRenderer.java @@ -1,15 +1,13 @@ package slimeknights.mantle.client.gui.book; -import com.google.common.collect.ImmutableList; - import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.translation.I18n; import net.minecraftforge.fml.client.config.GuiUtils; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -17,13 +15,29 @@ import net.minecraftforge.fml.relauncher.SideOnly; import slimeknights.mantle.Mantle; import slimeknights.mantle.client.book.data.element.TextData; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + @SideOnly(Side.CLIENT) public class TextDataRenderer { - + /** + * @deprecated Call drawText with tooltip param and then call drawTooltip separately on the tooltip layer to prevent overlap + */ public static String drawText(int x, int y, int boxWidth, int boxHeight, TextData[] data, int mouseX, int mouseY, FontRenderer fr) { - String action = ""; + List tooltip = new ArrayList(); + String action = drawText(x, y, boxWidth, boxHeight, data, mouseX, mouseY, fr, tooltip); - String[] drawLabel = null; + if(tooltip.size() > 0) { + drawTooltip(tooltip, mouseX, mouseY, fr); + } + + return action; + } + + public static String drawText(int x, int y, int boxWidth, int boxHeight, TextData[] data, int mouseX, int mouseY, FontRenderer fr, @Nonnull List tooltip) { + String action = ""; int atX = x; int atY = y; @@ -124,7 +138,7 @@ public class TextDataRenderer { drawGradientRect(mouseX, mouseY, mouseX + 5, mouseY + 5, 0xFFFF00FF, 0xFFFFFF00);*/ if((mouseX >= box1X && mouseX <= box1W && mouseY >= box1Y && mouseY <= box1H && box1X != box1W && box1Y != box1H) || (mouseX >= box2X && mouseX <= box2W && mouseY >= box2Y && mouseY <= box2H && box2X != box2W && box2Y != box2H) || (mouseX >= box3X && mouseX <= box3W && mouseY >= box3Y && mouseY <= box3H && box3X != box3W && box1Y != box3H)) { - drawLabel = item.tooltip; + tooltip.addAll(Arrays.asList(item.tooltip)); } } @@ -142,21 +156,8 @@ public class TextDataRenderer { } if(GuiBook.debug && action != null && !action.isEmpty()) { - String[] label = drawLabel; - drawLabel = new String[label != null ? label.length + 2 : 1]; - - if(label != null) { - for(int i = 0; i < label.length; i++) { - drawLabel[i] = label[i]; - } - } - - drawLabel[drawLabel.length > 1 ? drawLabel.length - 2 : 0] = ""; - drawLabel[drawLabel.length - 1] = TextFormatting.GRAY + "Action: " + action; - } - - if(drawLabel != null) { - drawHoveringText(drawLabel, mouseX, mouseY, fr); + tooltip.add(""); + tooltip.add(TextFormatting.GRAY + "Action: " + action); } return action; @@ -167,7 +168,7 @@ public class TextDataRenderer { while(s.contains("$(") && s.contains(")$") && s.indexOf("$(") < s.indexOf(")$")) { String loc = s.substring(s.indexOf("$(") + 2, s.indexOf(")$")); - s = s.replace("$(" + loc + ")$", I18n.translateToLocal(loc)); + s = s.replace("$(" + loc + ")$", I18n.format(loc)); } if(s.indexOf("$(") > s.indexOf(")$") || s.contains(")$")) { @@ -214,8 +215,8 @@ public class TextDataRenderer { } //BEGIN METHODS FROM GUI - private static void drawHoveringText(String[] textLines, int x, int y, FontRenderer font) { - GuiUtils.drawHoveringText(ImmutableList.copyOf(textLines), x, y, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT, GuiBook.PAGE_WIDTH, font); + public static void drawTooltip(List textLines, int mouseX, int mouseY, FontRenderer font) { + GuiUtils.drawHoveringText(textLines, mouseX, mouseY, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT, GuiBook.PAGE_WIDTH, font); RenderHelper.disableStandardItemLighting(); } diff --git a/src/main/java/slimeknights/mantle/client/gui/book/element/BookElement.java b/src/main/java/slimeknights/mantle/client/gui/book/element/BookElement.java index 5f3199d..f766398 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/element/BookElement.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/element/BookElement.java @@ -37,6 +37,9 @@ public abstract class BookElement extends Gui { public void drawOverlay(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { } + public void drawTooltips(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { + } + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { } diff --git a/src/main/java/slimeknights/mantle/client/gui/book/element/ElementText.java b/src/main/java/slimeknights/mantle/client/gui/book/element/ElementText.java index 6ebd8b9..55f014b 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/element/ElementText.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/element/ElementText.java @@ -4,7 +4,9 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import slimeknights.mantle.client.book.action.StringActionProcessor; import slimeknights.mantle.client.book.data.element.TextData; @@ -12,8 +14,8 @@ import slimeknights.mantle.client.gui.book.TextDataRenderer; @SideOnly(Side.CLIENT) public class ElementText extends SizedBookElement { - public TextData[] text; + private List tooltip = new ArrayList(); private boolean doAction = false; @@ -33,7 +35,7 @@ public class ElementText extends SizedBookElement { @Override public void draw(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { - String action = TextDataRenderer.drawText(x, y, width, height, text, mouseX, mouseY, fontRenderer); + String action = TextDataRenderer.drawText(x, y, width, height, text, mouseX, mouseY, fontRenderer, tooltip); if(doAction) { doAction = false; @@ -41,6 +43,14 @@ public class ElementText extends SizedBookElement { } } + @Override + public void drawTooltips(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { + if(tooltip.size() > 0){ + TextDataRenderer.drawTooltip(tooltip, mouseX, mouseY, fontRenderer); + tooltip.clear(); + } + } + @Override public void mouseClicked(int mouseX, int mouseY, int mouseButton) { if(mouseButton == 0) { From 13695e8464b1f110c47f06fb141021ce3118f143 Mon Sep 17 00:00:00 2001 From: Arthur Uzulin Date: Wed, 18 Jul 2018 08:37:58 +1000 Subject: [PATCH 3/4] [Books] Updated book advancement system - Books now list requirements by id because the client no longer knows about advancements until prerequisites unlocked - Advancement id -> advancement is now cached so we no longer search every frame --- .../mantle/client/book/BookTransformer.java | 15 +- .../mantle/client/book/data/BookData.java | 66 ++++--- .../mantle/client/book/data/SectionData.java | 47 ++--- .../mantle/client/gui/book/GuiBook.java | 162 +++++++++--------- .../client/gui/book/editor/GuiBookEditor.java | 3 +- .../client/gui/book/element/ElementItem.java | 2 +- .../gui/book/element/ElementSection.java | 24 +-- 7 files changed, 144 insertions(+), 175 deletions(-) diff --git a/src/main/java/slimeknights/mantle/client/book/BookTransformer.java b/src/main/java/slimeknights/mantle/client/book/BookTransformer.java index 1d10b0f..14d0583 100644 --- a/src/main/java/slimeknights/mantle/client/book/BookTransformer.java +++ b/src/main/java/slimeknights/mantle/client/book/BookTransformer.java @@ -1,17 +1,16 @@ package slimeknights.mantle.client.book; -import net.minecraft.stats.StatisticsManager; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import slimeknights.mantle.client.book.data.BookData; import slimeknights.mantle.client.book.data.PageData; import slimeknights.mantle.client.book.data.SectionData; import slimeknights.mantle.client.book.data.content.ContentSectionList; import slimeknights.mantle.client.book.data.content.ContentTableOfContents; import slimeknights.mantle.client.book.data.element.TextData; +import slimeknights.mantle.client.gui.book.GuiBook; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public abstract class BookTransformer { @@ -34,10 +33,10 @@ public abstract class BookTransformer { public void transform(BookData book) { SectionData index = new SectionData(true) { @Override - public void update(StatisticsManager statisticsManager) { + public void update(GuiBook.AdvancementCache advancementCache) { pages.clear(); - List visibleSections = parent.getVisibleSections(statisticsManager); + List visibleSections = parent.getVisibleSections(advancementCache); if(visibleSections.isEmpty()) { return; diff --git a/src/main/java/slimeknights/mantle/client/book/data/BookData.java b/src/main/java/slimeknights/mantle/client/book/data/BookData.java index bbb469e..6afedf9 100644 --- a/src/main/java/slimeknights/mantle/client/book/data/BookData.java +++ b/src/main/java/slimeknights/mantle/client/book/data/BookData.java @@ -3,20 +3,9 @@ package slimeknights.mantle.client.book.data; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.stats.StatisticsManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import javax.annotation.Nullable; - import slimeknights.mantle.Mantle; import slimeknights.mantle.client.book.BookLoader; import slimeknights.mantle.client.book.BookTransformer; @@ -25,6 +14,14 @@ import slimeknights.mantle.client.book.data.element.ItemStackData; import slimeknights.mantle.client.book.repository.BookRepository; import slimeknights.mantle.client.gui.book.GuiBook; +import javax.annotation.Nullable; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + @SideOnly(Side.CLIENT) public class BookData implements IDataItem { @@ -169,12 +166,12 @@ public class BookData implements IDataItem { return findSection(name, null); } - public SectionData findSection(String name, @Nullable StatisticsManager statisticsManager) { + public SectionData findSection(String name, GuiBook.AdvancementCache advancementCache) { for(SectionData section : sections) { - section.update(statisticsManager); + section.update(advancementCache); if(section.name.equals(name.toLowerCase())) { - return section.isUnlocked(statisticsManager) ? section : null; + return section.isUnlocked(advancementCache) ? section : null; } } @@ -185,16 +182,16 @@ public class BookData implements IDataItem { return getFirstPageNumber(section, null); } - public int getFirstPageNumber(SectionData section, @Nullable StatisticsManager statisticsManager) { + public int getFirstPageNumber(SectionData section, @Nullable GuiBook.AdvancementCache advancementCache) { int pages = 0; for(SectionData sect : sections) { - sect.update(statisticsManager); + sect.update(advancementCache); if(section == sect) { - return section.isUnlocked(statisticsManager) ? pages + 1 : -1; + return section.isUnlocked(advancementCache) ? pages + 1 : -1; } - if(!sect.isUnlocked(statisticsManager)) { + if(!sect.isUnlocked(advancementCache)) { continue; } @@ -208,16 +205,16 @@ public class BookData implements IDataItem { return findPage(number, null); } - public PageData findPage(int number, @Nullable StatisticsManager statisticsManager) { + public PageData findPage(int number, @Nullable GuiBook.AdvancementCache advancementCache) { if(number < 0) { return null; } int pages = 0; for(SectionData section : sections) { - section.update(statisticsManager); + section.update(advancementCache); - if(!section.isUnlocked(statisticsManager)) { + if(!section.isUnlocked(advancementCache)) { continue; } @@ -236,15 +233,15 @@ public class BookData implements IDataItem { return findPage(location, null); } - public PageData findPage(String location, @Nullable StatisticsManager statisticsManager) { - return findPage(findPageNumber(location, statisticsManager)); + public PageData findPage(String location, @Nullable GuiBook.AdvancementCache advancementCache) { + return findPage(findPageNumber(location, advancementCache)); } public int findPageNumber(String location) { return findPageNumber(location, null); } - public int findPageNumber(String location, @Nullable StatisticsManager statisticsManager) { + public int findPageNumber(String location, @Nullable GuiBook.AdvancementCache advancementCache) { location = location.toLowerCase(); int pages = 0; @@ -257,9 +254,9 @@ public class BookData implements IDataItem { String pageName = location.substring(location.indexOf('.') + 1); for(SectionData section : sections) { - section.update(statisticsManager); + section.update(advancementCache); - if(!section.isUnlocked(statisticsManager)) { + if(!section.isUnlocked(advancementCache)) { continue; } @@ -285,12 +282,12 @@ public class BookData implements IDataItem { return getPageCount(null); } - public int getPageCount(@Nullable StatisticsManager statisticsManager) { + public int getPageCount(@Nullable GuiBook.AdvancementCache advancementCache) { int pages = 0; for(SectionData section : sections) { - section.update(statisticsManager); + section.update(advancementCache); - pages += section.isUnlocked(statisticsManager) ? section.getPageCount() : 0; + pages += section.isUnlocked(advancementCache) ? section.getPageCount() : 0; } return pages; } @@ -299,8 +296,8 @@ public class BookData implements IDataItem { return getFullPageCount(null); } - public int getFullPageCount(@Nullable StatisticsManager statisticsManager) { - return (int) Math.ceil((getPageCount(statisticsManager) - 1) / 2F) + 1; + public int getFullPageCount(@Nullable GuiBook.AdvancementCache advancementCache) { + return (int) Math.ceil((getPageCount(advancementCache) - 1) / 2F) + 1; } public String getItemAction(ItemStackData item) { @@ -313,11 +310,11 @@ public class BookData implements IDataItem { return ""; } - public List getVisibleSections(StatisticsManager statisticsManager) { + public List getVisibleSections(GuiBook.AdvancementCache advancementCache) { List visible = new ArrayList<>(); for(SectionData section : sections) { - if(section.isUnlocked(statisticsManager) || !section.hideWhenLocked) { + if(section.isUnlocked(advancementCache) || !section.hideWhenLocked) { visible.add(section); } } @@ -336,8 +333,7 @@ public class BookData implements IDataItem { load(); } if(Minecraft.getMinecraft().player != null) { - Minecraft.getMinecraft() - .displayGuiScreen(new GuiBook(this, Minecraft.getMinecraft().player.getStatFileWriter(), item)); + Minecraft.getMinecraft().displayGuiScreen(new GuiBook(this, item)); } } diff --git a/src/main/java/slimeknights/mantle/client/book/data/SectionData.java b/src/main/java/slimeknights/mantle/client/book/data/SectionData.java index 51b051b..7ad2223 100644 --- a/src/main/java/slimeknights/mantle/client/book/data/SectionData.java +++ b/src/main/java/slimeknights/mantle/client/book/data/SectionData.java @@ -1,23 +1,18 @@ package slimeknights.mantle.client.book.data; -import net.minecraft.advancements.Advancement; -import net.minecraft.advancements.AdvancementManager; -import net.minecraft.client.Minecraft; +import net.minecraft.advancements.AdvancementProgress; import net.minecraft.client.resources.IResource; -import net.minecraft.stats.StatisticsManager; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.ArrayList; -import java.util.Arrays; - -import javax.annotation.Nullable; - import slimeknights.mantle.client.book.BookLoader; import slimeknights.mantle.client.book.data.content.ContentError; import slimeknights.mantle.client.book.data.element.ImageData; import slimeknights.mantle.client.book.repository.BookRepository; +import slimeknights.mantle.client.gui.book.GuiBook; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; @SideOnly(Side.CLIENT) public class SectionData implements IDataItem { @@ -82,7 +77,7 @@ public class SectionData implements IDataItem { icon.location = source.getResourceLocation(icon.file, true); } - public void update(@Nullable StatisticsManager statisticsManager) { + public void update(@Nullable GuiBook.AdvancementCache advancementCache) { } public String getTitle() { @@ -94,13 +89,13 @@ public class SectionData implements IDataItem { return pages.size(); } - public boolean isUnlocked(StatisticsManager statisticsManager) { - if(statisticsManager == null || requirements == null || requirements.length == 0) { + public boolean isUnlocked(GuiBook.AdvancementCache advancementCache) { + if(advancementCache == null || requirements == null || requirements.length == 0) { return true; } for(String achievement : requirements) { - if(!requirementSatisfied(achievement, statisticsManager)) { + if(!requirementSatisfied(achievement, advancementCache)) { return false; } } @@ -108,28 +103,14 @@ public class SectionData implements IDataItem { return true; } - public static boolean requirementSatisfied(String requirement, StatisticsManager writer) { - if(writer == null) { + public static boolean requirementSatisfied(String requirement, GuiBook.AdvancementCache advancementCache) { + if(advancementCache == null) { return true; } - Advancement advancement = findAdvancement(requirement); + AdvancementProgress progress = advancementCache.getProgress(requirement); - return advancement == null;//TODO: Readd || writer.hasAchievementUnlocked(advancement); + return progress != null && progress.isDone(); } - - public static Advancement findAdvancement(String name) { - if(name == null || name.isEmpty()) { - return null; - } - - for(Advancement advancement : Minecraft.getMinecraft().player.connection.getAdvancementManager().getAdvancementList().getAdvancements()) { - if(advancement.getId().equals(new ResourceLocation(name))) { - return advancement; - } - } - - return null; - } } diff --git a/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java b/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java index 432c974..0020e25 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/GuiBook.java @@ -2,11 +2,15 @@ package slimeknights.mantle.client.gui.book; import com.google.common.collect.ImmutableList; +import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementList; +import net.minecraft.advancements.AdvancementProgress; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.multiplayer.ClientAdvancementManager; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.texture.TextureManager; @@ -14,6 +18,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.network.play.client.CPacketClientStatus; import net.minecraft.stats.StatisticsManager; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -22,6 +27,7 @@ import org.lwjgl.input.Mouse; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import javax.annotation.Nullable; @@ -38,7 +44,7 @@ import static slimeknights.mantle.client.gui.book.Textures.TEX_BOOK; import static slimeknights.mantle.client.gui.book.Textures.TEX_BOOKFRONT; @SideOnly(Side.CLIENT) -public class GuiBook extends GuiScreen implements IProgressMeter { +public class GuiBook extends GuiScreen { public static boolean debug = false; @@ -63,7 +69,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { init(); // initializes page width and height } - private boolean loadingAchievements = true; private GuiArrow previousArrow, nextArrow, backArrow, indexArrow; public final BookData book; @@ -74,21 +79,25 @@ public class GuiBook extends GuiScreen implements IProgressMeter { private ArrayList leftElements = new ArrayList<>(); private ArrayList rightElements = new ArrayList<>(); - public StatisticsManager statisticsManager; + public AdvancementCache advancementCache; public static void init() { PAGE_WIDTH = (int) ((PAGE_WIDTH_UNSCALED - (PAGE_PADDING_LEFT + PAGE_PADDING_RIGHT + PAGE_MARGIN + PAGE_MARGIN)) / PAGE_SCALE); PAGE_HEIGHT = (int) ((PAGE_HEIGHT_UNSCALED - (PAGE_PADDING_TOP + PAGE_PADDING_BOT + PAGE_MARGIN + PAGE_MARGIN)) / PAGE_SCALE); } - public GuiBook(BookData book, StatisticsManager statisticsManager, @Nullable ItemStack item) { + public GuiBook(BookData book, @Nullable ItemStack item) { this.book = book; this.item = item; - this.statisticsManager = statisticsManager; this.mc = Minecraft.getMinecraft(); this.fontRenderer = mc.fontRenderer; init(); + + advancementCache = new AdvancementCache(); + this.mc.player.connection.getAdvancementManager().setListener(advancementCache); + + openPage(book.findPageNumber(BookHelper.getSavedPage(item), advancementCache)); } public void drawerTransform(boolean rightSide) { @@ -131,17 +140,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { fontRenderer = mc.fontRenderer; } - if(loadingAchievements) { - this.drawDefaultBackground(); - - this.drawCenteredString(this.fontRenderer, I18n - .format("multiplayer.downloadingStats"), this.width / 2, this.height / 2, 16777215); - this.drawCenteredString(this.fontRenderer, LOADING_STRINGS[(int) (Minecraft - .getSystemTime() / 150L % (long) LOADING_STRINGS.length)], this.width / 2, this.height / 2 + this.fontRenderer.FONT_HEIGHT * 2, 16777215); - - return; - } - if(debug) { drawRect(0, 0, fontRenderer.getStringWidth("DEBUG") + 4, fontRenderer.FONT_HEIGHT + 4, 0x55000000); fontRenderer.drawString("DEBUG", 2, 2, 0xFFFFFFFF); @@ -272,8 +270,8 @@ public class GuiBook extends GuiScreen implements IProgressMeter { GlStateManager.color(1F, 1F, 1F, 1F); RenderHelper.disableStandardItemLighting(); - if((page < book.getFullPageCount(statisticsManager) - 1 || book.getPageCount(statisticsManager) % 2 != 0) && page < book - .getFullPageCount(statisticsManager)) { + int fullPageCount = book.getFullPageCount(advancementCache); + if((page < fullPageCount - 1 || fullPageCount % 2 != 0) && page < fullPageCount) { drawModalRectWithCustomSizedTexture(width / 2, height / 2 - PAGE_HEIGHT_UNSCALED / 2, PAGE_WIDTH_UNSCALED, PAGE_HEIGHT_UNSCALED, PAGE_WIDTH_UNSCALED, PAGE_HEIGHT_UNSCALED, TEX_SIZE, TEX_SIZE); GlStateManager.pushMatrix(); @@ -327,10 +325,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { } public int openPage(int page, boolean returner) { - if(loadingAchievements) { - return -1; - } - if(page < 0) { return -1; } @@ -344,7 +338,7 @@ public class GuiBook extends GuiScreen implements IProgressMeter { bookPage = (page - 2) / 2 + 1; } - if(bookPage >= -1 && bookPage < book.getFullPageCount(statisticsManager)) { + if(bookPage >= -1 && bookPage < book.getFullPageCount(advancementCache)) { if(returner) { oldPage = this.page; } @@ -383,10 +377,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { } public void openCover() { - if(loadingAchievements) { - return; - } - _setPage(-1); this.leftElements.clear(); @@ -399,10 +389,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { } private void buildPages() { - if(loadingAchievements) { - return; - } - leftElements.clear(); rightElements.clear(); @@ -411,14 +397,14 @@ public class GuiBook extends GuiScreen implements IProgressMeter { } if(page == 0) { - PageData page = book.findPage(0, statisticsManager); + PageData page = book.findPage(0, advancementCache); if(page != null) { page.content.build(book, rightElements, false); } } else { - PageData leftPage = book.findPage((page - 1) * 2 + 1, statisticsManager); - PageData rightPage = book.findPage((page - 1) * 2 + 2, statisticsManager); + PageData leftPage = book.findPage((page - 1) * 2 + 1, advancementCache); + PageData rightPage = book.findPage((page - 1) * 2 + 2, advancementCache); if(leftPage != null) { leftPage.content.build(book, leftElements, false); @@ -440,11 +426,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { public void initGui() { super.initGui(); - if(loadingAchievements) { - this.mc.getConnection().sendPacket(new CPacketClientStatus((CPacketClientStatus.State.REQUEST_STATS))); - return; - } - // The books are unreadable at Gui Scale set to small, so we'll double the scale, and of course half the size so that all our code still works as it should /* if(mc.gameSettings.guiScale == 1) { @@ -470,12 +451,8 @@ public class GuiBook extends GuiScreen implements IProgressMeter { public void updateScreen() { super.updateScreen(); - if(loadingAchievements) { - return; - } - previousArrow.visible = page != -1; - nextArrow.visible = page < book.getFullPageCount(statisticsManager) - (book.getPageCount(statisticsManager) % 2 != 0 ? 0 : 1); + nextArrow.visible = page < book.getFullPageCount(advancementCache) - (book.getPageCount(advancementCache) % 2 != 0 ? 0 : 1); backArrow.visible = oldPage >= -1; if(page == -1) { @@ -493,22 +470,10 @@ public class GuiBook extends GuiScreen implements IProgressMeter { nextArrow.y = height / 2 + 75; } - @Override - public void onStatsUpdated() { - loadingAchievements = false; - - initGui(); - openPage(book.findPageNumber(BookHelper.getSavedPage(item), statisticsManager)); - } - @Override public void actionPerformed(GuiButton button) { - if(loadingAchievements) { - return; - } - if(button instanceof GuiBookmark) { - openPage(book.findPageNumber(((GuiBookmark) button).data.page, statisticsManager)); + openPage(book.findPageNumber(((GuiBookmark) button).data.page, advancementCache)); return; } @@ -520,8 +485,9 @@ public class GuiBook extends GuiScreen implements IProgressMeter { } } else if(button == nextArrow) { page++; - if(page > book.getFullPageCount(statisticsManager) - (book.getPageCount(statisticsManager) % 2 != 0 ? 0 : 1)) { - page = book.getFullPageCount(statisticsManager) - 1; + int fullPageCount = book.getFullPageCount(advancementCache); + if(page > fullPageCount - (fullPageCount % 2 != 0 ? 0 : 1)) { + page = fullPageCount - 1; } } else if(button == backArrow) { if(oldPage >= -1) { @@ -539,10 +505,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { protected void keyTyped(char typedChar, int keyCode) throws IOException { super.keyTyped(typedChar, keyCode); - if(loadingAchievements) { - return; - } - switch(keyCode) { case Keyboard.KEY_LEFT: case Keyboard.KEY_A: @@ -560,10 +522,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - if(loadingAchievements) { - return; - } - super.mouseClicked(mouseX, mouseY, mouseButton); boolean right = false; @@ -592,10 +550,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { protected void mouseReleased(int mouseX, int mouseY, int state) { super.mouseReleased(mouseX, mouseY, state); - if(loadingAchievements) { - return; - } - boolean right = false; mouseX = getMouseX(false); mouseY = getMouseY(); @@ -614,10 +568,6 @@ public class GuiBook extends GuiScreen implements IProgressMeter { @Override protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { - if(loadingAchievements) { - return; - } - boolean right = false; mouseX = getMouseX(false); mouseY = getMouseY(); @@ -636,17 +586,14 @@ public class GuiBook extends GuiScreen implements IProgressMeter { @Override public void onGuiClosed() { - if(loadingAchievements) { - return; - } if(mc.player == null) { return; } - PageData page = this.page == 0 ? book.findPage(0, statisticsManager) : book.findPage((this.page - 1) * 2 + 1, statisticsManager); + PageData page = this.page == 0 ? book.findPage(0, advancementCache) : book.findPage((this.page - 1) * 2 + 1, advancementCache); if(page == null) { - page = book.findPage((this.page - 1) * 2 + 2, statisticsManager); + page = book.findPage((this.page - 1) * 2 + 2, advancementCache); } if(this.page == -1) { @@ -660,4 +607,59 @@ public class GuiBook extends GuiScreen implements IProgressMeter { public boolean doesGuiPauseGame() { return false; } + + public class AdvancementCache implements ClientAdvancementManager.IListener { + private HashMap progress = new HashMap<>(); + private HashMap nameCache = new HashMap<>(); + + public AdvancementProgress getProgress(String id){ + return getProgress(getAdvancement(id)); + } + + public AdvancementProgress getProgress(Advancement advancement){ + return progress.get(advancement); + } + + public Advancement getAdvancement(String id){ + return nameCache.get(new ResourceLocation(id)); + } + + @Override + public void onUpdateAdvancementProgress(Advancement advancement, AdvancementProgress advancementProgress) { + progress.put(advancement, advancementProgress); + } + + @Override + public void setSelectedTab(@Nullable Advancement advancement) { + // noop + } + + @Override + public void rootAdvancementAdded(Advancement advancement) { + nameCache.put(advancement.getId(), advancement); + } + + @Override + public void rootAdvancementRemoved(Advancement advancement) { + progress.remove(advancement); + nameCache.remove(advancement.getId()); + } + + @Override + public void nonRootAdvancementAdded(Advancement advancement) { + nameCache.put(advancement.getId(), advancement); + } + + @Override + public void nonRootAdvancementRemoved(Advancement advancement) { + progress.remove(advancement); + nameCache.remove(advancement.getId()); + } + + @Override + public void advancementsCleared() { + progress.clear(); + nameCache.clear(); + } + } } diff --git a/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java b/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java index 63b9790..12ef85c 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java @@ -25,9 +25,8 @@ public class GuiBookEditor extends GuiScreen { book = new BookData(); } - innerUi = new GuiBook(book, null, null); + innerUi = new GuiBook(book, null); innerUi.mc = Minecraft.getMinecraft(); - innerUi.onStatsUpdated(); innerUi._setPage(-1); } diff --git a/src/main/java/slimeknights/mantle/client/gui/book/element/ElementItem.java b/src/main/java/slimeknights/mantle/client/gui/book/element/ElementItem.java index fea6fb1..1dc463a 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/element/ElementItem.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/element/ElementItem.java @@ -96,7 +96,7 @@ public class ElementItem extends SizedBookElement { } @Override - public void drawOverlay(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { + public void drawTooltips(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { if(isHovered(mouseX, mouseY) && currentItem < itemCycle.size()) { if(tooltip != null) { drawHoveringText(tooltip, mouseX, mouseY, fontRenderer); diff --git a/src/main/java/slimeknights/mantle/client/gui/book/element/ElementSection.java b/src/main/java/slimeknights/mantle/client/gui/book/element/ElementSection.java index f3c3f67..1038915 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/element/ElementSection.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/element/ElementSection.java @@ -1,16 +1,15 @@ package slimeknights.mantle.client.gui.book.element; -import net.minecraft.advancements.Advancement; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.util.text.TextFormatting; +import slimeknights.mantle.client.book.data.SectionData; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import slimeknights.mantle.client.book.data.SectionData; - public class ElementSection extends SizedBookElement { public static final int IMG_SIZE = 32; @@ -28,7 +27,7 @@ public class ElementSection extends SizedBookElement { @Override public void draw(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { - boolean unlocked = section.isUnlocked(parent.statisticsManager); + boolean unlocked = section.isUnlocked(parent.advancementCache); boolean hover = isHovered(mouseX, mouseY); if(section.icon != null) { @@ -75,22 +74,15 @@ public class ElementSection extends SizedBookElement { } @Override - public void drawOverlay(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { + public void drawTooltips(int mouseX, int mouseY, float partialTicks, FontRenderer fontRenderer) { if(section != null && isHovered(mouseX, mouseY)) { List text = new ArrayList<>(); text.add(section.getTitle()); - if(!section.isUnlocked(parent.statisticsManager)) { + if(!section.isUnlocked(parent.advancementCache)) { text.add(TextFormatting.RED + "Locked"); text.add("Requirements:"); - for(String requirement : section.requirements) { - Advancement advancement = SectionData.findAdvancement(requirement); - if(advancement != null) { - text.add((SectionData - .requirementSatisfied(requirement, parent.statisticsManager) ? TextFormatting.GREEN : TextFormatting.RED) + TextFormatting - .getTextWithoutFormattingCodes(advancement.getDisplay().getTitle().getFormattedText())); - } - } + text.addAll(Arrays.asList(section.requirements)); } drawHoveringText(text, mouseX, mouseY, fontRenderer); } @@ -98,8 +90,8 @@ public class ElementSection extends SizedBookElement { @Override public void mouseClicked(int mouseX, int mouseY, int mouseButton) { - if(mouseButton == 0 && section != null && section.isUnlocked(parent.statisticsManager) && isHovered(mouseX, mouseY)) { - parent.openPage(parent.book.getFirstPageNumber(section, parent.statisticsManager)); + if(mouseButton == 0 && section != null && section.isUnlocked(parent.advancementCache) && isHovered(mouseX, mouseY)) { + parent.openPage(parent.book.getFirstPageNumber(section, parent.advancementCache)); } } } From ceec486257d8b1b0a581bd1e70f640e91802690e Mon Sep 17 00:00:00 2001 From: Arthur Uzulin Date: Tue, 24 Jul 2018 09:16:04 +1000 Subject: [PATCH 4/4] Removed old book test resources --- .../mantle/client/gui/book/BoxRenderer.java | 68 ------------ .../mantle/client/gui/book/Textures.java | 1 - .../client/gui/book/editor/GuiBookEditor.java | 103 ------------------ .../mantle/books/TestBook/appearance.json | 10 -- .../mantle/books/TestBook/en_US/language.lang | 11 -- .../books/TestBook/en_US/section1/page2.json | 34 ------ .../books/TestBook/en_US/section1/page3.json | 5 - .../TestBook/en_US/section1/page4_5.json | 10 -- .../TestBook/en_US/section1/page6_7.json | 15 --- .../en_US/section1/pageblkinteraction.json | 14 --- .../TestBook/en_US/section1/pagecrafting.json | 46 -------- .../en_US/section1/pagecraftingsmall.json | 34 ------ .../TestBook/en_US/section1/pagesmelting.json | 14 --- .../TestBook/en_US/section1/pagesmithing.json | 33 ------ .../en_US/section1/pagestructure.json | 3 - .../en_US/section1/pagestructure2.json | 3 - .../en_US/section1/pagestructure3.json | 3 - .../en_US/section1/pagestructure4.json | 3 - .../mantle/books/TestBook/images/test.png | Bin 25222 -> 0 bytes .../assets/mantle/books/TestBook/index.json | 34 ------ .../assets/mantle/books/TestBook/items.json | 10 -- .../mantle/books/TestBook/items/records.json | 41 ------- .../books/TestBook/sections/section1.json | 81 -------------- .../TestBook/structures/netherportal.json | 31 ------ .../TestBook/structures/netherportal2.json | 32 ------ .../TestBook/structures/stonesmeltery.json | 41 ------- .../TestBook/structures/stonesmeltery2.json | 11 -- .../TestBook/structures/stonesmeltery3.json | 10 -- .../TestBook/structures/stonesmeltery4.json | 10 -- 29 files changed, 711 deletions(-) delete mode 100644 src/main/java/slimeknights/mantle/client/gui/book/BoxRenderer.java delete mode 100644 src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java delete mode 100644 src/main/resources/assets/mantle/books/TestBook/appearance.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/language.lang delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/page2.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/page3.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/page4_5.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/page6_7.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pageblkinteraction.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecrafting.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecraftingsmall.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmelting.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmithing.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure2.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure3.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure4.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/images/test.png delete mode 100644 src/main/resources/assets/mantle/books/TestBook/index.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/items.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/items/records.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/sections/section1.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/structures/netherportal.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/structures/netherportal2.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery2.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery3.json delete mode 100644 src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery4.json diff --git a/src/main/java/slimeknights/mantle/client/gui/book/BoxRenderer.java b/src/main/java/slimeknights/mantle/client/gui/book/BoxRenderer.java deleted file mode 100644 index db4d11c..0000000 --- a/src/main/java/slimeknights/mantle/client/gui/book/BoxRenderer.java +++ /dev/null @@ -1,68 +0,0 @@ -package slimeknights.mantle.client.gui.book; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.util.math.MathHelper; - -import static slimeknights.mantle.client.gui.book.Textures.TEX_BOX; - -public class BoxRenderer { - - public static final int TEX_SIZE = 128; - - public static void drawBox(int x, int y, int width, int height, int index) { - drawBox(x, y, width, height, index, 16, 16, 4, 4, 2, 2); - } - - public static void drawBox(int x, int y, int width, int height, int index, int sprW, int sprH, int segW, int segH, int segGW, int segGH) { - Minecraft.getMinecraft().renderEngine.bindTexture(TEX_BOX); - - int sx = x, sy = y; - - for(int i = 0; i < 3; i++) { - int sgW = width - segW * 2; - - if(i % 2 == 0) { - sgW = segW; - } - - for(int j = 0; j < 3; j++) { - int sgH = height - segH * 2; - - if(j % 2 == 0) { - sgH = segH; - } - - int[] matrix = getTextureMatrixCoords(index, sprW, sprH, segW, segH, segGW, segGH, i + j * 3); - Gui.drawScaledCustomSizeModalRect(sx, sy, matrix[0], matrix[1], segW, segH, sgW, sgH, TEX_SIZE, TEX_SIZE); - - sy += sgH; - } - - sx += sgW; - sy = y; - } - } - - public static int[] getTextureMatrixCoords(int index, int sprW, int sprH, int segW, int segH, int segGW, int segGH, int segId) { - int totalWidth = segW * 3 + segGW * 2; - int totalHeight = segH * 3 + segGH * 2; - - return getTextureMatrixCoords((index % (256 / sprW) * sprW) + (sprW / 2 - totalWidth / 2), (MathHelper - .floor(index / (256F / sprH)) * sprH) + (sprH / 2 - totalHeight / 2), segW, segH, segGW, segGH, segId); - } - - public static int[] getTextureMatrixCoords(int u, int v, int segW, int segH, int segGW, int segGH, int segId) { - int[] coords = new int[4]; - - int col = segId % 3; - int row = MathHelper.floor(segId / 3F); - - coords[0] = u + col * segW + col * segGW; - coords[1] = v + row * segH + row * segGH; - coords[2] = coords[0] + segW; - coords[3] = coords[1] + segH; - - return coords; - } -} diff --git a/src/main/java/slimeknights/mantle/client/gui/book/Textures.java b/src/main/java/slimeknights/mantle/client/gui/book/Textures.java index 4d9059b..bd6145f 100644 --- a/src/main/java/slimeknights/mantle/client/gui/book/Textures.java +++ b/src/main/java/slimeknights/mantle/client/gui/book/Textures.java @@ -6,7 +6,6 @@ public class Textures { public static final ResourceLocation TEX_BOOK = new ResourceLocation("mantle:textures/gui/book/book.png"); public static final ResourceLocation TEX_BOOKFRONT = new ResourceLocation("mantle:textures/gui/book/bookfront.png"); - public static final ResourceLocation TEX_BOX = new ResourceLocation("mantle:textures/gui/box.png"); public static final ResourceLocation TEX_CRAFTING = new ResourceLocation("mantle:textures/gui/book/crafting.png"); public static final ResourceLocation TEX_SMELTING = new ResourceLocation("mantle:textures/gui/book/smelting.png"); diff --git a/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java b/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java deleted file mode 100644 index 12ef85c..0000000 --- a/src/main/java/slimeknights/mantle/client/gui/book/editor/GuiBookEditor.java +++ /dev/null @@ -1,103 +0,0 @@ -package slimeknights.mantle.client.gui.book.editor; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.texture.TextureManager; - -import javax.annotation.Nullable; - -import slimeknights.mantle.client.book.data.BookData; -import slimeknights.mantle.client.gui.book.BoxRenderer; -import slimeknights.mantle.client.gui.book.GuiBook; -import slimeknights.mantle.client.gui.book.Textures; - -public class GuiBookEditor extends GuiScreen { - - private static final int SIDEBAR_WIDTH = 120; - - private GuiBook innerUi; - private int side; - - public GuiBookEditor(@Nullable BookData book) { - if(book == null) { - book = new BookData(); - } - - innerUi = new GuiBook(book, null); - innerUi.mc = Minecraft.getMinecraft(); - - innerUi._setPage(-1); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - GlStateManager.pushMatrix(); - - TextureManager render = this.mc.renderEngine; - - if(mc.gameSettings.guiScale == 1) { - GlStateManager.scale(2F, 2F, 2F); - - mouseX /= 2; - mouseY /= 2; - } - - BoxRenderer.drawBox(width / 2 - (GuiBook.PAGE_WIDTH_UNSCALED + SIDEBAR_WIDTH) / 2, - height / 2 - (GuiBook.PAGE_HEIGHT_UNSCALED - GuiBook.PAGE_PADDING_TOP) / 2, - SIDEBAR_WIDTH + GuiBook.PAGE_PADDING_RIGHT + GuiBook.PAGE_MARGIN, - GuiBook.PAGE_HEIGHT_UNSCALED - GuiBook.PAGE_PADDING_BOT, 0); - - if(innerUi.getPage_() == -1) { - GlStateManager.pushMatrix(); - if(mc.gameSettings.guiScale == 1) { - GlStateManager.scale(0.5F, 0.5F, 0.5F); - } - innerUi.openCover(); - innerUi - .drawScreen(mouseX * (mc.gameSettings.guiScale == 1 ? 2 : 1), mouseY * (mc.gameSettings.guiScale == 1 ? 2 : 1), partialTicks); - GlStateManager.popMatrix(); - } else { - render.bindTexture(Textures.TEX_BOOK); - - GlStateManager.color(1F, 1F, 1F); - drawModalRectWithCustomSizedTexture(width / 2 - GuiBook.PAGE_WIDTH_UNSCALED / 2, - height / 2 - GuiBook.PAGE_HEIGHT_UNSCALED / 2, - 0, GuiBook.PAGE_HEIGHT_UNSCALED, - GuiBook.PAGE_WIDTH_UNSCALED - GuiBook.PAGE_MARGIN - GuiBook.PAGE_PADDING_LEFT, - GuiBook.PAGE_HEIGHT_UNSCALED, - GuiBook.TEX_SIZE, GuiBook.TEX_SIZE); - drawModalRectWithCustomSizedTexture(width / 2 - GuiBook.PAGE_WIDTH_UNSCALED / 2 + GuiBook.PAGE_MARGIN + GuiBook.PAGE_PADDING_LEFT, - height / 2 - GuiBook.PAGE_HEIGHT_UNSCALED / 2, - GuiBook.PAGE_WIDTH_UNSCALED + GuiBook.PAGE_MARGIN + GuiBook.PAGE_PADDING_LEFT, - GuiBook.PAGE_HEIGHT_UNSCALED, - GuiBook.PAGE_WIDTH_UNSCALED - GuiBook.PAGE_MARGIN - GuiBook.PAGE_PADDING_RIGHT, - GuiBook.PAGE_HEIGHT_UNSCALED, - GuiBook.TEX_SIZE, GuiBook.TEX_SIZE); - } - - super.drawScreen(mouseX, mouseY, partialTicks); - GlStateManager.popMatrix(); - } - - @Override - public void initGui() { - buttonList.clear(); - - innerUi.width = width + SIDEBAR_WIDTH * (mc.gameSettings.guiScale == 1 ? 2 : 1); - innerUi.height = height; - - if(mc.gameSettings.guiScale == 1) { - width /= 2F; - height /= 2F; - } - - innerUi.initGui(); - innerUi.updateScreen(); - innerUi.buttonList.clear(); - - buttonList.add(new GuiButton(0, 0, height - 20, 50, 20, "Import")); - buttonList.add(new GuiButton(1, 55, height - 20, 50, 20, "Export")); - } -} diff --git a/src/main/resources/assets/mantle/books/TestBook/appearance.json b/src/main/resources/assets/mantle/books/TestBook/appearance.json deleted file mode 100644 index 0e2bdb5..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/appearance.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - //"coverColor": "0x8B4631", - //"arrowColor": "0xFFFFD3", - //"arrowColorHover": "0xFF541C", - //"indexBookmark": true, - //"lockedSectionColor": "0xFFFFFF", - "title": "Materials and You", - "subtitle": "By Skyla", - "drawPageNumbers": true -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/language.lang b/src/main/resources/assets/mantle/books/TestBook/en_US/language.lang deleted file mode 100644 index 7644376..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/language.lang +++ /dev/null @@ -1,11 +0,0 @@ -// Sections -test section=Test Section -section 2=Locked Section -section 3=Hidden Section -// Test Section Pages -test section.page1=Blank Page -test section.pagecrafter=Crafting Page -test section.pagesmallcrafting=Small Crafting Page -test section.pagesmelting=Smelting Page -test section.pageblockinteraction=Block Interaction Page -test section.pagestructure=3D Model Page \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page2.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page2.json deleted file mode 100644 index c4da5fc..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page2.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "text": [ - { - "text": "Long ago in a galaxy far ", - "color": "gold" - }, - { - "text": "far", - "underlined": true, - "tooltip": [ - "You missed the joke", - "By Skyla" - ], - "action": "go-to-page:Test Section.Page5", - "color": "gold" - }, - { - "text": " away. ", - "action": "go-to-page:Test Section.Page4", - "color": "gold" - }, - { - "text": "Use the force, " - }, - { - "text": "Harry!", - "scale": 2 - }, - { - "text": "For I am the wizard that you seek! $(language.name)$", - "paragraph": true - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page3.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page3.json deleted file mode 100644 index 762a4c6..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "image": { - "file": "images/test.png" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page4_5.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page4_5.json deleted file mode 100644 index 215eb99..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page4_5.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "text": [ - { - "text": "Test of mississipi" - } - ], - "image": { - "file": "images/test.png" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page6_7.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page6_7.json deleted file mode 100644 index e151556..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/page6_7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "text1": [ - { - "text": "Test of mississipi" - } - ], - "text2": [ - { - "text": "Test of mississipi" - } - ], - "image": { - "file": "images/test.png" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pageblkinteraction.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pageblkinteraction.json deleted file mode 100644 index c4ff182..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pageblkinteraction.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "title": "Interacting with Blocks", - "input": { - "itemList": "items/records.json" - }, - "block": { - "id": "minecraft:jukebox" - }, - "description": [ - { - "text": "That's my jam!" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecrafting.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecrafting.json deleted file mode 100644 index e3fc391..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecrafting.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "title": "Crafting a Thing", - "grid_size": "large", - "grid": [ - [ - {}, - { - "id": "minecraft:redstone_torch" - } - ], - [ - { - "id": "minecraft:redstone_torch" - }, - { - "id": "minecraft:quartz" - }, - { - "id": "minecraft:redstone_torch" - } - ], - [ - { - "id": "minecraft:stone" - }, - { - "id": "minecraft:stone" - }, - { - "id": "minecraft:stone" - } - ] - ], - "result": { - "id": "minecraft:comparator" - }, - "description": [ - { - "text": "This item does stuff and, of course, " - }, - { - "text": "things.", - "underlined": true - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecraftingsmall.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecraftingsmall.json deleted file mode 100644 index 648a90c..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagecraftingsmall.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "title": "Crafting a Thing", - "grid_size": "small", - "grid": [ - [ - { - "id": "minecraft:stick" - }, - { - "id": "minecraft:planks" - } - ], - [ - { - "id": "minecraft:planks" - }, - { - "id": "minecraft:stick" - } - ] - ], - "result": { - "id": "tconstruct:stencil" - }, - "description": [ - { - "text": "This item does stuff and, of course, " - }, - { - "text": "things.", - "underlined": true - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmelting.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmelting.json deleted file mode 100644 index c8b7d86..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmelting.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "title": "Smelting a Thing", - "input": { - "id": "minecraft:iron_ore" - }, - "result": { - "id": "minecraft:iron_ingot" - }, - "description": [ - { - "text": "Very delicious iron." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmithing.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmithing.json deleted file mode 100644 index a6795a0..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagesmithing.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "title": "Smithing a Thing", - "input": { - "id": "minecraft:diamond_sword" - }, - "modifier": { - "id": "minecraft:enchanted_book", - "nbt": { - "ench": [ - { - "id": 16, - "lvl": 5 - } - ] - } - }, - "result": { - "id": "minecraft:diamond_sword", - "nbt": { - "ench": [ - { - "id": 16, - "lvl": 5 - } - ] - } - }, - "description": [ - { - "text": "Ow, that's sharp." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure.json deleted file mode 100644 index 47552f7..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": "structures/netherportal2.json" -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure2.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure2.json deleted file mode 100644 index 1e85a71..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure2.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": "structures/stonesmeltery2.json" -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure3.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure3.json deleted file mode 100644 index d9fc30a..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure3.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": "structures/stonesmeltery3.json" -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure4.json b/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure4.json deleted file mode 100644 index 0edf4ec..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/en_US/section1/pagestructure4.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": "structures/stonesmeltery4.json" -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/images/test.png b/src/main/resources/assets/mantle/books/TestBook/images/test.png deleted file mode 100644 index 1ece86304edfdf95dfa16e5c6751f94800916b4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25222 zcmeIabySq!7XSay-KmID0wOSUcXxLWFoe|5B`}~!3KG(dNQa=bFob}lfOMCXvOw<_o3Zc~56C~;_1k%#T6kS=N zNKsL+ND_5s>~PF+v}Nj?s3*Ch;oT<-zPWazjYnVl&fkrRtd<<4R}G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iu3#Gqq=PNI* LB2^|~7WDrCnOV*| diff --git a/src/main/resources/assets/mantle/books/TestBook/index.json b/src/main/resources/assets/mantle/books/TestBook/index.json deleted file mode 100644 index 1ce3d84..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/index.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "name": "test section", - "icon": { - "file": "images/test.png" - }, - "data": "sections/section1.json" - }, - { - "name": "section 2", - "icon": { - "item": { - "id": "minecraft:command_block" - } - }, - "data": "sections/section1.json", - "requirements": [ - "achievement.buildHoe", - "achievement.makeBread" - ] - }, - { - "name": "section 3", - "title": "Hidden Section", - "icon": { - "file": "images/test.png" - }, - "data": "sections/section1.json", - "requirements": [ - "achievement.mineWood" - ], - "hideWhenLocked": true - } -] \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/items.json b/src/main/resources/assets/mantle/books/TestBook/items.json deleted file mode 100644 index c1845d2..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/items.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "item": { - "id": "minecraft:golden_apple", - "damage": 1 - }, - "damageSensitive": true, - "action": "go-to-page-rtn:test section.page5" - } -] \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/items/records.json b/src/main/resources/assets/mantle/books/TestBook/items/records.json deleted file mode 100644 index df667bf..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/items/records.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "items": [ - { - "id": "record_13" - }, - { - "id": "record_cat" - }, - { - "id": "record_blocks" - }, - { - "id": "record_chirp" - }, - { - "id": "record_far" - }, - { - "id": "record_mall" - }, - { - "id": "record_mellohi" - }, - { - "id": "record_stal" - }, - { - "id": "record_strad" - }, - { - "id": "record_ward" - }, - { - "id": "record_11" - }, - { - "id": "record_wait" - } - ], - "action": "go-to-page-rtn:test section.page5" -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/sections/section1.json b/src/main/resources/assets/mantle/books/TestBook/sections/section1.json deleted file mode 100644 index e26cc75..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/sections/section1.json +++ /dev/null @@ -1,81 +0,0 @@ -[ - { - "name": "Page1", - "type": "blank" - }, - { - "name": "PageCrafter", - "type": "crafting", - "data": "section1/pagecrafting.json" - }, - { - "name": "PageSmallCrafter", - "type": "crafting", - "data": "section1/pagecraftingsmall.json" - }, - { - "name": "PageSmelting", - "type": "smelting", - "data": "section1/pagesmelting.json" - }, - { - "name": "PageSmithing", - "type": "smithing", - "data": "section1/pagesmithing.json" - }, - { - "name": "PageBlockInteraction", - "type": "block interaction", - "data": "section1/pageblkinteraction.json" - }, - { - "name": "PageStructure", - "type": "structure", - "data": "section1/pagestructure2.json" - }, - { - "name": "PageStructure", - "type": "structure", - "data": "section1/pagestructure3.json" - }, - { - "name": "PageStructure", - "type": "structure", - "data": "section1/pagestructure4.json" - }, - { - "name": "PageStructure", - "type": "structure", - "data": "section1/pagestructure.json" - }, - { - "name": "Page2", - "type": "text", - "data": "section1/page2.json" - }, - { - "name": "Page3", - "type": "image", - "data": "section1/page3.json" - }, - { - "name": "Page4", - "type": "image with text below", - "data": "section1/page4_5.json" - }, - { - "name": "Page5", - "type": "text with image below", - "data": "section1/page4_5.json" - }, - { - "name": "Page6", - "type": "text with left image etch", - "data": "section1/page6_7.json" - }, - { - "name": "Page7", - "type": "text with right image etch", - "data": "section1/page6_7.json" - } -] \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/structures/netherportal.json b/src/main/resources/assets/mantle/books/TestBook/structures/netherportal.json deleted file mode 100644 index 60f2b69..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/structures/netherportal.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "size": [4, 5, 1], - "structure": [ - { - "pos": [0, 0, 0], - "endPos": [3, 0, 0], - "block": "minecraft:obsidian" - }, - { - "pos": [0, 0, 0], - "endPos": [0, 4, 0], - "block": "minecraft:obsidian" - }, - { - "pos": [3, 0, 0], - "endPos": [3, 4, 0], - "block": "minecraft:obsidian" - }, - { - "pos": [0, 4, 0], - "endPos": [3, 4, 0], - "block": "minecraft:obsidian" - }, - { - "pos": [1, 1, 0], - "endPos": [2, 3, 0], - "block": "minecraft:portal", - "meta": 2 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/structures/netherportal2.json b/src/main/resources/assets/mantle/books/TestBook/structures/netherportal2.json deleted file mode 100644 index d9ab3f8..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/structures/netherportal2.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "size": [1, 5, 4], - "text": "This is a nether portal. It leads to the nether.Pretty cool, eh?Lorem Ipsum dolor, Lorem Ipsum Dolores", - "structure": [ - { - "pos": [0, 0, 0], - "endPos": [0, 0, 3], - "block": "minecraft:obsidian" - }, - { - "pos": [0, 0, 0], - "endPos": [0, 4, 0], - "block": "minecraft:obsidian" - }, - { - "pos": [0, 0, 3], - "endPos": [0, 4, 3], - "block": "minecraft:obsidian" - }, - { - "pos": [0, 4, 0], - "endPos": [0, 4, 3], - "block": "minecraft:obsidian" - }, - { - "pos": [0, 1, 1], - "endPos": [0, 3, 2], - "block": "minecraft:portal", - "meta": 2 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery.json b/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery.json deleted file mode 100644 index bde3d0b..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "size": [5, 3, 5], - "structure": [ - { - "pos": [1, 0, 1], - "endPos": [3, 0, 3], - "block": "minecraft:stonebrick" - }, - { - "pos": [0, 1, 1], - "endPos": [0, 2, 3], - "block": "minecraft:stonebrick", - "meta": 0 - }, - { - "pos": [4, 1, 1], - "endPos": [4, 2, 3], - "block": "minecraft:stonebrick", - "meta": 1 - }, - { - "pos": [1, 1, 0], - "endPos": [3, 2, 0], - "block": "minecraft:stonebrick", - "meta": 2 - }, - { - "pos": [1, 1, 4], - "endPos": [3, 2, 4], - "block": "minecraft:wool", - "state": { - "color": "orange" - } - }, - { - "pos": [2, 2, 2], - "endPos": [2, 2, 2], - "block": "minecraft:glowstone" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery2.json b/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery2.json deleted file mode 100644 index ffad0dd..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "size": [4, 4, 4], - "text": "This is a nether portal. It leads to the nether.Pretty cool, eh?Lorem Ipsum dolor, Lorem Ipsum Dolores", - "structure": [ - { - "pos": [0, 0, 0], - "endPos": [3, 3, 3], - "block": "minecraft:stonebrick" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery3.json b/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery3.json deleted file mode 100644 index f64e3db..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery3.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "size": [9, 9, 9], - "structure": [ - { - "pos": [0, 0, 0], - "endPos": [8, 8, 8], - "block": "minecraft:stonebrick" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery4.json b/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery4.json deleted file mode 100644 index 086c2c4..0000000 --- a/src/main/resources/assets/mantle/books/TestBook/structures/stonesmeltery4.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "size": [1, 1, 1], - "structure": [ - { - "pos": [0, 0, 0], - "endPos": [0, 0, 0], - "block": "minecraft:stonebrick" - } - ] -} \ No newline at end of file