aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-03-27 19:12:44 +0200
committerGitHub <noreply@github.com>2022-03-27 19:12:44 +0200
commit47efdd4f84cc9a29738fe16d631eb33ee716db61 (patch)
treeaf7514fac2d55c7a2885025d6e858b8a2cfa3b55 /src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
parente202e4adf979073921455083f5e737bc4fcf5f14 (diff)
downloadnotenoughupdates-47efdd4f84cc9a29738fe16d631eb33ee716db61.tar.gz
notenoughupdates-47efdd4f84cc9a29738fe16d631eb33ee716db61.tar.bz2
notenoughupdates-47efdd4f84cc9a29738fe16d631eb33ee716db61.zip
New wiki in wiki renderer (#97)
* partly working and pushing cuz jani * way better rendering stuff but still not perfect * finish most of wiki renderer for new wiki * JANI MY FRIEND PLEASE TEST * Windows time :sad: * fix wiki renderer * Some things I forgor * changelog * Better corrupted file handling in graph and added check for crash that I have no idea how it happened.
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index 5ad02f94..b7aa42d6 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -751,16 +751,27 @@ public class NEUOverlay extends Gui {
public void showInfo(JsonObject item) {
if (item.has("info") && item.has("infoType")) {
JsonArray lore = item.get("info").getAsJsonArray();
- StringBuilder loreBuilder = new StringBuilder();
- for (int i = 0; i < lore.size(); i++) {
- loreBuilder.append(lore.get(i).getAsString());
- if (i != lore.size() - 1)
- loreBuilder.append("\n");
+ String infoType = item.get("infoType").getAsString();
+ String infoText = "";
+ if (infoType.equals("WIKI_URL")) {
+ for (JsonElement url : lore) {
+ infoText = url.getAsString();
+ if (
+ url.getAsString().startsWith("https://wiki.hypixel.net/") && NotEnoughUpdates.INSTANCE.config.misc.wiki == 0
+ || url.getAsString().startsWith("https://hypixel-skyblock.fandom.com/") &&
+ NotEnoughUpdates.INSTANCE.config.misc.wiki == 1) break;
+ }
+ } else {
+ StringBuilder loreBuilder = new StringBuilder();
+ for (int i = 0; i < lore.size(); i++) {
+ loreBuilder.append(lore.get(i).getAsString());
+ if (i != lore.size() - 1)
+ loreBuilder.append("\n");
+ }
+ infoText = loreBuilder.toString();
}
- String infoText = loreBuilder.toString();
String internalname = item.get("internalname").getAsString();
String name = item.get("displayname").getAsString();
- String infoType = item.get("infoType").getAsString();
displayInformationPane(new TextInfoPane(
this,
manager,
@@ -825,6 +836,10 @@ public class NEUOverlay extends Gui {
if (selectedItemGroup != null) {
int selectedX = Math.min(selectedItemGroupX, width - getBoxPadding() - 18 * selectedItemGroup.size());
if (mouseY > selectedItemGroupY + 17 && mouseY < selectedItemGroupY + 35) {
+ if (!Mouse.getEventButtonState()) {
+ Utils.pushGuiScale(-1);
+ return true; //End early if the mouse isn't pressed, but still cancel event.
+ }
for (int i = 0; i < selectedItemGroup.size(); i++) {
if (mouseX >= selectedX - 1 + 18 * i && mouseX <= selectedX + 17 + 18 * i) {
JsonObject item = selectedItemGroup.get(i);
@@ -1349,7 +1364,8 @@ public class NEUOverlay extends Gui {
} else if (getSortMode() == SORT_MODE_PET) {
return internalname.matches(petRegex) && item.get("displayname").getAsString().contains("[");
} else if (getSortMode() == SORT_MODE_TOOL) {
- return checkItemType(item.get("lore").getAsJsonArray(),
+ return checkItemType(
+ item.get("lore").getAsJsonArray(),
"SWORD",
"BOW",
"AXE",