aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-04-13 23:22:42 +0200
committer0neGal <mail@0negal.com>2022-04-13 23:28:24 +0200
commitcbcaafa35624c70e313c00232f78a366d05ef3a9 (patch)
treef537d951c54437b8d1a195348ef66f51112f6fcd /src/index.js
parente48c5d92d0bd113c680e53aa307ff6d440794007 (diff)
downloadViper-cbcaafa35624c70e313c00232f78a366d05ef3a9.tar.gz
Viper-cbcaafa35624c70e313c00232f78a366d05ef3a9.zip
check to make sure gamepath exists
When Viper starts up it'll check to make sure the gamepath still exists, and throws errors if not, it also redirects you to the first page (the one where you can set the gamepath), and gives you an informative error. This could happen because the user unmounted the drive the gamepath is on, or it could happen if the user moved their game location.
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 752410e..b38b65d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -53,6 +53,14 @@ function start() {
ipcMain.on("installedmod", (event, modname) => {win.webContents.send("installedmod", modname)});
ipcMain.on("guigetmods", (event, ...args) => {win.webContents.send("mods", utils.mods.list())});
+ let gamepathlost = false;
+ ipcMain.on("gamepathlost", (event, ...args) => {
+ if (! gamepathlost) {
+ gamepathlost = true;
+ win.webContents.send("gamepathlost");
+ }
+ });
+
ipcMain.on("savesettings", (event, obj) => {utils.saveSettings(obj)})
ipcMain.on("can-autoupdate", (event) => {