aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app/main.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/app/main.js b/src/app/main.js
index 109ca61..362450a 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -217,9 +217,12 @@ function installFromURL(url, dependencies, clearqueue) {
let depend = dependencies[i].toLowerCase();
console.log(depend)
if (! depend.match(/northstar-northstar-.*/)) {
- newdepends.push(dependencies[i].replaceAll("-", "/"));
- let pkg = newdepends[newdepends.length - 1].split("/");
- prettydepends.push(`${pkg[1]} v${pkg[2]} - ${lang("gui.browser.madeby")} ${pkg[0]}`);
+ depend = dependencies[i].replaceAll("-", "/");
+ let pkg = depend.split("/");
+ if (! isModInstalled(pkg[1])) {
+ newdepends.push(depend);
+ prettydepends.push(`${pkg[1]} v${pkg[2]} - ${lang("gui.browser.madeby")} ${pkg[0]}`);
+ }
}
}
@@ -241,6 +244,21 @@ function installFromURL(url, dependencies, clearqueue) {
}
}
+function isModInstalled(modname) {
+ for (let i = 0; i < modsobj.all.length; i++) {
+ let mod = modsobj.all[i];
+ if (mod.ManifestName) {
+ if (mod.ManifestName.match(modname)) {
+ return true;
+ }
+ } else if (mod.Name.match(modname)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
// Frontend part of settings a new game path
ipcRenderer.on("newpath", (event, newpath) => {
settings.gamepath = newpath;