diff options
author | 0neGal <mail@0negal.com> | 2022-05-30 22:48:39 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-05-30 23:02:50 +0200 |
commit | 1c06ab53f1cf2228e1034a66538f3a31a14e3743 (patch) | |
tree | e90234803990e3562d6e3c522fed721a25e7baef /src/utils.js | |
parent | 451f1709cbdf0caa20c01ec533b96832ba9aa822 (diff) | |
download | Viper-1c06ab53f1cf2228e1034a66538f3a31a14e3743.tar.gz Viper-1c06ab53f1cf2228e1034a66538f3a31a14e3743.zip |
refactored event names
Quite a lot of them aren't in the same syntax/style, and it's quite bad
to look at, this should fix them all without causing issues.
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/utils.js b/src/utils.js index d8e968c..b69a9a2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -42,12 +42,12 @@ var settings = { // Logs into the dev tools of the renderer function winLog(msg) { - ipcMain.emit("winLog", msg, msg); + ipcMain.emit("win-log", msg, msg); } // Sends an alert to the renderer function winAlert(msg) { - ipcMain.emit("winAlert", msg, msg); + ipcMain.emit("win-alert", msg, msg); } // Creates the settings file with the base settings if it doesn't exist. @@ -187,7 +187,7 @@ async function setpath(win, forcedialog) { return; } if (! fs.existsSync(path.join(res.filePaths[0], "Titanfall2.exe"))) { - ipcMain.emit("wrongpath"); + ipcMain.emit("wrong-path"); return; } @@ -326,11 +326,11 @@ async function update() { fs.createReadStream(settings.zip).pipe(unzip.Extract({path: settings.gamepath})) .on("finish", () => { fs.writeFileSync(path.join(settings.gamepath, "ns_version.txt"), latestAvailableVersion); - ipcMain.emit("getversion"); + ipcMain.emit("get-version"); restoreExcludedFiles(); - ipcMain.emit("guigetmods"); + ipcMain.emit("gui-getmods"); ipcMain.emit("ns-update-event", "cli.update.uptodate.short"); winLog(lang("gui.update.finished")); console.log(lang("cli.update.finished")); @@ -603,11 +603,11 @@ const mods = { } } - ipcMain.emit("installedmod", "", { + ipcMain.emit("installed-mod", "", { name: modname, malformed: malformed, }); - ipcMain.emit("guigetmods"); + ipcMain.emit("gui-getmods"); return true; } @@ -679,7 +679,7 @@ const mods = { } if (files.length == 0) { - ipcMain.emit("failedmod"); + ipcMain.emit("failed-mod"); return notamod(); } } @@ -778,8 +778,8 @@ const mods = { fs.rmSync(modPath, {recursive: true}); console.log(lang("cli.mods.removed")); cli.exit(); - ipcMain.emit("guigetmods"); - ipcMain.emit("removedmod", "", { + ipcMain.emit("gui-getmods"); + ipcMain.emit("removed-mod", "", { name: mod.replace(/^.*(\\|\/|\:)/, ""), manifestname: manifestname }); @@ -818,17 +818,17 @@ const mods = { console.log(lang("cli.mods.toggled")); cli.exit(); } - ipcMain.emit("guigetmods"); + ipcMain.emit("gui-getmods"); } }; setInterval(() => { if (gamepathExists()) { - ipcMain.emit("guigetmods"); + ipcMain.emit("gui-getmods"); } else { if (fs.existsSync("viper.json")) { if (settings.gamepath != "") { - ipcMain.emit("gamepathlost"); + ipcMain.emit("gamepath-lost"); } } } |