Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
chore: Remove broken quest book (#679)
Browse files Browse the repository at this point in the history
* chore: Remove broken quest book

* fix: Allow access to guides and lootruns

---------

Co-authored-by: Magnus Ihse Bursie <mag@icus.se>
  • Loading branch information
ryanzhoudev and magicus committed Jul 18, 2023
1 parent ffab244 commit b9d15f5
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void updateQuestBook(TickEvent.ClientTickEvent e) {

QuestBookPages.MAIN.getPage().open(true);

QuestManager.readQuestBook();
//QuestManager.readQuestBook();
}

private int tickCounter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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<String> 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<T> 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<T> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void updateAnalysis(Collection<AnalysePosition> position, boolean
}

if (immediate) {
readQuestBook();
//readQuestBook();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<String> getHoveredDescription() {
public void open(boolean showAnimation) {
super.open(showAnimation);

QuestManager.readQuestBook();
//QuestManager.readQuestBook();
}

@Override
Expand Down

0 comments on commit b9d15f5

Please sign in to comment.