diff options
author | 0neGal <mail@0negal.com> | 2022-02-08 23:22:39 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-02-08 23:22:39 +0100 |
commit | 0a317f81def6b4c041cfc340e454a9bc8f0046fb (patch) | |
tree | f8be9e32dbef3ed9fc1a8a961420d9402dea2bbe /src/app | |
parent | 0813769008f5436e1cea2ad97f1a527c8ce94df7 (diff) | |
download | Viper-0a317f81def6b4c041cfc340e454a9bc8f0046fb.tar.gz Viper-0a317f81def6b4c041cfc340e454a9bc8f0046fb.zip |
added toasts for installation of mods
It'll notify of incorrectly formatted mods, it'll also notify on errors
and on success.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/browser.js | 29 | ||||
-rw-r--r-- | src/app/main.css | 2 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/app/browser.js b/src/app/browser.js index e1f37e5..ded12fa 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -198,9 +198,34 @@ ipcRenderer.on("removedmod", (event, mod) => { } }) -ipcRenderer.on("installedmod", (event, modname) => { +ipcRenderer.on("failedmod", (event, modname) => { setButtons(true); - Browser.setbutton(modname, lang("gui.browser.reinstall")); + new Toast({ + timeout: 10000, + scheme: "error", + title: lang("gui.toast.title.failed"), + description: lang("gui.toast.desc.failed") + }) +}) + +ipcRenderer.on("installedmod", (event, mod) => { + setButtons(true); + Browser.setbutton(mod.name, lang("gui.browser.reinstall")); + + if (mod.malformed) { + new Toast({ + timeout: 8000, + scheme: "warning", + title: lang("gui.toast.title.malformed"), + description: mod.name + " " + lang("gui.toast.desc.malformed") + }) + } + + new Toast({ + scheme: "success", + title: lang("gui.toast.title.installed"), + description: mod.name + " " + lang("gui.toast.desc.installed") + }) }) function normalize(items) { diff --git a/src/app/main.css b/src/app/main.css index 14348bd..a532490 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -609,7 +609,7 @@ code { .toast .description { opacity: 0.8; font-size: 0.8em; - font-weight: 400; + font-weight: 600; } /* drag control */ |