diff --git a/src/main/java/com/wynntils/modules/questbook/QuestBookModule.java b/src/main/java/com/wynntils/modules/questbook/QuestBookModule.java index 9e0867ebf..7ddb50dba 100644 --- a/src/main/java/com/wynntils/modules/questbook/QuestBookModule.java +++ b/src/main/java/com/wynntils/modules/questbook/QuestBookModule.java @@ -39,7 +39,7 @@ public void onEnable() { registerKeyBinding("Open HUD configuration", Keyboard.KEY_NONE, "Wynntils", KeyConflictContext.IN_GAME, true, () -> QuestBookPages.HUDCONFIG.getPage().open(true)); registerKeyBinding("Open Menu", Keyboard.KEY_I, "Wynntils", KeyConflictContext.IN_GAME, true, () -> { QuestBookPages.MAIN.getPage().open(true); - QuestManager.readQuestBook(); + //QuestManager.readQuestBook(); }); } diff --git a/src/main/java/com/wynntils/modules/questbook/events/ClientEvents.java b/src/main/java/com/wynntils/modules/questbook/events/ClientEvents.java index 203c489b3..716e0c567 100644 --- a/src/main/java/com/wynntils/modules/questbook/events/ClientEvents.java +++ b/src/main/java/com/wynntils/modules/questbook/events/ClientEvents.java @@ -146,7 +146,7 @@ public void updateQuestBook(TickEvent.ClientTickEvent e) { QuestBookPages.MAIN.getPage().open(true); - QuestManager.readQuestBook(); + //QuestManager.readQuestBook(); } private int tickCounter = 0; diff --git a/src/main/java/com/wynntils/modules/questbook/instances/QuestBookListPage.java b/src/main/java/com/wynntils/modules/questbook/instances/QuestBookListPage.java index 19c63d8da..fe8dd1c63 100644 --- a/src/main/java/com/wynntils/modules/questbook/instances/QuestBookListPage.java +++ b/src/main/java/com/wynntils/modules/questbook/instances/QuestBookListPage.java @@ -8,10 +8,14 @@ import com.wynntils.core.framework.rendering.ScreenRenderer; import com.wynntils.core.framework.rendering.SmartFontRenderer; import com.wynntils.core.framework.rendering.colors.CommonColors; +import com.wynntils.modules.questbook.overlays.ui.DialoguePage; +import com.wynntils.modules.questbook.overlays.ui.DiscoveriesPage; +import com.wynntils.modules.questbook.overlays.ui.QuestsPage; import net.minecraft.client.gui.ScaledResolution; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -49,49 +53,54 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) { { preEntries(mouseX, mouseY, partialTicks); - // Page Text - render.drawString(currentPage + " / " + pages, x + 80, y + 88, CommonColors.BLACK, SmartFontRenderer.TextAlignment.MIDDLE, SmartFontRenderer.TextShadow.NONE); + if (this instanceof QuestsPage || this instanceof DiscoveriesPage || this instanceof DialoguePage) { + // Page Text + render.drawString(currentPage + " / " + pages, x + 80, y + 88, CommonColors.BLACK, SmartFontRenderer.TextAlignment.MIDDLE, SmartFontRenderer.TextShadow.NONE); + List textLines = Arrays.asList("The Wynntils quest book is", "no longer available on 1.12.2.", "", "Wynntils 1.12.2 is being", "sunset in favour of newer", "Minecraft versions.", "", "Please download the latest", "version of the mod at", "https://wynntils.com"); + drawTextLines(textLines, x + 10, y - 40, 1); - //Forward and backward button - drawForwardAndBackButtons(x, y, posX, posY, currentPage, pages); - - // Draw all Search Results - if (search.size() > 0) { - List page = search.get(currentPage - 1); - - if (page.size() > 0) { - for (int i = 0; i < page.size(); i++) { - T currentItem = page.get(i); - - if (isHovered(i, posX, posY) && !showAnimation) { - //hovered - drawEntry(currentItem, i, true); - - selectedEntry = currentItem; - //selected is set relative to the page - selected = i; - hoveredText = getHoveredText(selectedEntry); - } else { - if (selected == i) { - selectedEntry = null; + } else { + //Forward and backward button + drawForwardAndBackButtons(x, y, posX, posY, currentPage, pages); + + // Draw all Search Results + if (search.size() > 0) { + List page = search.get(currentPage - 1); + + if (page.size() > 0) { + for (int i = 0; i < page.size(); i++) { + T currentItem = page.get(i); + + if (isHovered(i, posX, posY) && !showAnimation) { + //hovered + drawEntry(currentItem, i, true); + + selectedEntry = currentItem; + //selected is set relative to the page + selected = i; + hoveredText = getHoveredText(selectedEntry); + } else { + if (selected == i) { + selectedEntry = null; + } + + //not hovered + drawEntry(currentItem, i, false); } - - //not hovered - drawEntry(currentItem, i, false); } } - } - } else { - String textToDisplay = getEmptySearchString(); - int currentY = 12; + } else { + String textToDisplay = getEmptySearchString(); + int currentY = 12; - for (String line : textToDisplay.split("\n")) { - currentY += render.drawSplitString(line, 120, x + 26, y - 95 + currentY, 10, CommonColors.BLACK, SmartFontRenderer.TextAlignment.LEFT_RIGHT, SmartFontRenderer.TextShadow.NONE) * 10 + 2; - } + for (String line : textToDisplay.split("\n")) { + currentY += render.drawSplitString(line, 120, x + 26, y - 95 + currentY, 10, CommonColors.BLACK, SmartFontRenderer.TextAlignment.LEFT_RIGHT, SmartFontRenderer.TextShadow.NONE) * 10 + 2; + } - updateSearch(); + updateSearch(); + } + postEntries(mouseX, mouseY, partialTicks); } - postEntries(mouseX, mouseY, partialTicks); } ScreenRenderer.endGL(); renderHoveredText(mouseX, mouseY); diff --git a/src/main/java/com/wynntils/modules/questbook/managers/QuestManager.java b/src/main/java/com/wynntils/modules/questbook/managers/QuestManager.java index 276d8d393..4f0bded08 100644 --- a/src/main/java/com/wynntils/modules/questbook/managers/QuestManager.java +++ b/src/main/java/com/wynntils/modules/questbook/managers/QuestManager.java @@ -68,7 +68,7 @@ public static void updateAnalysis(Collection position, boolean } if (immediate) { - readQuestBook(); + //readQuestBook(); } } diff --git a/src/main/java/com/wynntils/modules/questbook/overlays/ui/QuestsPage.java b/src/main/java/com/wynntils/modules/questbook/overlays/ui/QuestsPage.java index 08fd12675..3ff409e06 100644 --- a/src/main/java/com/wynntils/modules/questbook/overlays/ui/QuestsPage.java +++ b/src/main/java/com/wynntils/modules/questbook/overlays/ui/QuestsPage.java @@ -56,7 +56,7 @@ public List getHoveredDescription() { public void open(boolean showAnimation) { super.open(showAnimation); - QuestManager.readQuestBook(); + //QuestManager.readQuestBook(); } @Override