diff options
author | 0neGal <mail@0negal.com> | 2024-12-20 01:49:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-20 01:49:06 +0100 |
commit | a8ba1b376ff16a69c52f223341a2ed39fd59a8ea (patch) | |
tree | 2a8c0535a22264f4f3d37d684231d2ac147ac199 /src/app/js | |
parent | 7403086ce7d2a9d3b68801dc4c2135f5766b8d60 (diff) | |
parent | bd4391f737ee4405fc390ab47c4124fe28df48d7 (diff) | |
download | Viper-a8ba1b376ff16a69c52f223341a2ed39fd59a8ea.tar.gz Viper-a8ba1b376ff16a69c52f223341a2ed39fd59a8ea.zip |
Merge branch 'main' into gamepad-supportgamepad-support
Diffstat (limited to 'src/app/js')
-rw-r--r-- | src/app/js/browser.js | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/app/js/browser.js b/src/app/js/browser.js index 7dc84d9..bd9506f 100644 --- a/src/app/js/browser.js +++ b/src/app/js/browser.js @@ -1,5 +1,5 @@ const Fuse = require("fuse.js"); -const ipcRenderer = require("electron").ipcRenderer; +const { ipcRenderer, shell } = require("electron"); const lang = require("../../lang"); @@ -414,13 +414,24 @@ browser.mod_el = (properties) => { let installicon = "downloads"; let installstr = lang("gui.browser.install"); - let normalized_mods = []; + let normalized_title = mods.normalize(properties.title) + let installcallback = () => { + browser.install(properties); + } - for (let i = 0; i < mods.list().all; i++) { - normalized_mods.push(mods.normalize(mods_list[i].name)); + let nondefault_install = { + "vanillaplus": "https://github.com/Zayveeo5e/NP.VanillaPlus/blob/main/README.md" } - if (properties.pkg.local_version) { + if (normalized_title in nondefault_install) { + installicon = "open"; + installstr = lang("gui.browser.guide"); + + installcallback = () => { + shell.openExternal(nondefault_install[normalized_title]) + } + } + else if (properties.pkg.local_version) { installicon = "redo"; installstr = lang("gui.browser.reinstall"); @@ -432,7 +443,7 @@ browser.mod_el = (properties) => { let entry = document.createElement("div"); entry.classList.add("el"); - entry.id = `mod-${mods.normalize(properties.title)}`; + entry.id = `mod-${normalized_title}`; entry.innerHTML = ` <div class="image"> @@ -459,9 +470,7 @@ browser.mod_el = (properties) => { </div> ` - entry.querySelector("button.install").addEventListener("click", () => { - browser.install(properties); - }) + entry.querySelector("button.install").addEventListener("click", installcallback) browserEntries.appendChild(entry); } |