aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-02-07 21:46:04 +0100
committer0neGal <mail@0negal.com>2022-02-07 21:56:56 +0100
commit39d8f10c282c409d5fa2d62b0d39c33d183e90c8 (patch)
treea7c5c67b32068c91a4d0fd5c2c4595c7d712307c /src/app
parent7c2fe789d759bcbf69bdc5ca4f2ff0fede4d4883 (diff)
downloadViper-39d8f10c282c409d5fa2d62b0d39c33d183e90c8.tar.gz
Viper-39d8f10c282c409d5fa2d62b0d39c33d183e90c8.zip
added support for more obscure mod structure
If a developer for some reason decides to put their mod inside mods/ instead of putting it inside a folder in mods/, it used to fail the install, now that's fixed. However since there's no folder to directly copy the name from we take it from the manifest.json provided by Thunderstore. It of course also has the proper status in the browser UI (update/reinstall etc)
Diffstat (limited to 'src/app')
-rw-r--r--src/app/browser.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/app/browser.js b/src/app/browser.js
index 7b67822..c266b41 100644
--- a/src/app/browser.js
+++ b/src/app/browser.js
@@ -77,10 +77,15 @@ var Browser = {
setTimeout(() => {
for (let i = 0; i < modsobj.all.length; i++) {
let modname = normalize(modsobj.all[i].Name);
+ let modfolder = normalize(modsobj.all[i].FolderName);
if (mod.includes(modname)) {
if (document.getElementById(modname)) {
Browser.setbutton(modname, string);
}
+ } else if (mod.includes(modfolder)) {
+ if (document.getElementById(modfolder)) {
+ Browser.setbutton(modfolder, string);
+ }
}
}
}, 1501)
@@ -137,6 +142,20 @@ function BrowserEl(properties) {
installstr = lang("gui.browser.update");
}
}
+ } else {
+ for (let i = 0; i < modsobj.all.length; i++) {
+ let title = normalize(properties.title);
+ let folder = normalize(modsobj.all[i].FolderName);
+ if (title.includes(folder)) {
+ installstr = lang("gui.browser.reinstall");
+
+ if (folder == title
+ && "v" + modsobj.all[i].Version != properties.version) {
+
+ installstr = lang("gui.browser.update");
+ }
+ }
+ }
}
browserEntries.innerHTML += `