From d6dd4cfa9e5e1d3f5f8b0142365404671b9647a9 Mon Sep 17 00:00:00 2001 From: Obsidian <108832807+Obsidianninja11@users.noreply.github.com> Date: Sun, 31 Dec 2023 04:49:44 -0900 Subject: Item list: Option to open wiki in browser (#990) Option to open wiki in browser --- .../moulberry/notenoughupdates/NEUOverlay.java | 22 ++++++++++++++-------- .../options/separatesections/Itemlist.java | 8 ++++++++ 2 files changed, 22 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 691515b4..f89eae44 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -739,14 +739,20 @@ public class NEUOverlay extends Gui { } String internalname = item.get("internalname").getAsString(); String name = item.get("displayname").getAsString(); - displayInformationPane(new TextInfoPane( - this, - manager, - EnumChatFormatting.GRAY + "Loading", - EnumChatFormatting.GRAY + "Loading your requested information about " + name + EnumChatFormatting.GRAY + "." - )); - infoPaneLoadingJob = InfoPane.create(this, manager, infoType, name, internalname, infoText) - .thenAccept(this::displayInformationPane); + if (NotEnoughUpdates.INSTANCE.config.itemlist.wikiInBrowser) { + Utils.openUrl(infoText); + Utils.addChatMessage("§e[NEU] Opening webpage in browser."); + } + else { + displayInformationPane(new TextInfoPane( + this, + manager, + EnumChatFormatting.GRAY + "Loading", + EnumChatFormatting.GRAY + "Loading your requested information about " + name + EnumChatFormatting.GRAY + "." + )); + infoPaneLoadingJob = InfoPane.create(this, manager, infoType, name, internalname, infoText) + .thenAccept(this::displayInformationPane); + } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Itemlist.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Itemlist.java index a957da75..c6389c41 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Itemlist.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Itemlist.java @@ -149,4 +149,12 @@ public class Itemlist { runnableId = 21 ) public boolean alwaysShowMonsters = false; + + @Expose + @ConfigOption( + name = "Webpage In Browser", + desc = "Open wiki pages in your web browser instead of rendering in the info pane in game." + ) + @ConfigEditorBoolean + public boolean wikiInBrowser = false; } -- cgit