aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app/js/browser.js29
-rw-r--r--src/lang/de.json1
-rw-r--r--src/lang/en.json1
-rw-r--r--src/lang/es.json3
-rw-r--r--src/lang/fr.json1
-rw-r--r--src/lang/zh.json1
6 files changed, 26 insertions, 10 deletions
diff --git a/src/app/js/browser.js b/src/app/js/browser.js
index 7dc84d9..3415ebf 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,22 @@ browser.mod_el = (properties) => {
let installicon = "downloads";
let installstr = lang("gui.browser.install");
- let normalized_mods = [];
+ let installcallback = () => {};
+ let normalized_title = mods.normalize(properties.title)
- 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");
@@ -428,11 +437,15 @@ browser.mod_el = (properties) => {
installicon = "downloads";
installstr = lang("gui.browser.update");
}
+
+ installcallback = () => {
+ browser.install(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 +472,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);
}
diff --git a/src/lang/de.json b/src/lang/de.json
index 9e68986..0eb17dc 100644
--- a/src/lang/de.json
+++ b/src/lang/de.json
@@ -72,6 +72,7 @@
"server": "Server-seitig",
"skins": "Skins"
},
+ "guide": "Anleitung",
"info": "Info",
"install": "Installieren",
"load_more": "Lade mehr...",
diff --git a/src/lang/en.json b/src/lang/en.json
index c705517..f968f73 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -119,6 +119,7 @@
"load_more": "Load more...",
"end_of_list": "All packages have been loaded.",
"no_results": "No results...",
+ "guide": "Guide",
"filter": {
"mods": "Mods",
diff --git a/src/lang/es.json b/src/lang/es.json
index 3da6d89..ebde5f9 100644
--- a/src/lang/es.json
+++ b/src/lang/es.json
@@ -72,6 +72,7 @@
"server": "Del lado del servidor",
"skins": "Skins"
},
+ "guide": "Guía",
"info": "Información",
"install": "Instalar",
"load_more": "Cargar más...",
@@ -286,4 +287,4 @@
"release": "Notas de la versión"
}
}
-}
+} \ No newline at end of file
diff --git a/src/lang/fr.json b/src/lang/fr.json
index 52d9703..492ba76 100644
--- a/src/lang/fr.json
+++ b/src/lang/fr.json
@@ -72,6 +72,7 @@
"server": "Côté serveur",
"skins": "Skins"
},
+ "guide": "Guide",
"info": "Info",
"install": "Installer",
"load_more": "Charger plus de mods...",
diff --git a/src/lang/zh.json b/src/lang/zh.json
index ae086d4..2976eed 100644
--- a/src/lang/zh.json
+++ b/src/lang/zh.json
@@ -72,6 +72,7 @@
"server": "服务器端",
"skins": "皮肤"
},
+ "guide": "安装指南",
"info": "详情",
"install": "安装",
"load_more": "加载更多...",