diff options
author | Obsidian <108832807+Obsidianninja11@users.noreply.github.com> | 2023-12-31 04:49:44 -0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-31 14:49:44 +0100 |
commit | d6dd4cfa9e5e1d3f5f8b0142365404671b9647a9 (patch) | |
tree | 4af610c71b7802c0fc3a17a42e3d99e4e79586f2 /src/main | |
parent | 13a1c03698716178822b81b4510e63908ce8e5dd (diff) | |
download | NotEnoughUpdates-d6dd4cfa9e5e1d3f5f8b0142365404671b9647a9.tar.gz NotEnoughUpdates-d6dd4cfa9e5e1d3f5f8b0142365404671b9647a9.tar.bz2 NotEnoughUpdates-d6dd4cfa9e5e1d3f5f8b0142365404671b9647a9.zip |
Item list: Option to open wiki in browser (#990)
Option to open wiki in browser
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 22 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/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; } |