aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app/index.html8
-rw-r--r--src/app/main.css6
-rw-r--r--src/app/main.js8
-rw-r--r--src/index.js11
-rw-r--r--src/utils.js1
5 files changed, 30 insertions, 4 deletions
diff --git a/src/app/index.html b/src/app/index.html
index 426b4c5..3eadd96 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -6,7 +6,13 @@
<body>
<div class="lines">
<div class="line">
- <div class="text">%%gui.welcome%%</div>
+ <div class="text">
+ <div>%%gui.welcome%%</div>
+ <div class="versions">
+ <div id="vpVersion">Viper version: x.x.x</div>
+ <div id="nsVersion">Northstar version: x.x.x</div>
+ </div>
+ </div>
<div class="buttons">
<button id="exit" onclick="exit()">%%gui.exit%%</button>
<button id="update" onclick="update()">%%gui.update%%</button>
diff --git a/src/app/main.css b/src/app/main.css
index f49cc98..c86e08d 100644
--- a/src/app/main.css
+++ b/src/app/main.css
@@ -68,3 +68,9 @@ button:active {
#setpath {background: #5E81AC}
#northstar {background: #C7777F}
#vanilla, #exit {background: #656E7F}
+
+.versions {
+ height: 15px;
+ font-size: 12px;
+ color: #afafaf;
+} \ No newline at end of file
diff --git a/src/app/main.js b/src/app/main.js
index 9bafaa5..ab41af6 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -35,7 +35,13 @@ ipcRenderer.on("newpath", (event, newpath) => {
settings.gamepath = newpath;
})
+ipcRenderer.on('versionInfo', (_, payload) => {
+ document.getElementById('vpVersion').innerText = `Viper version: ${payload.vp}`;
+ document.getElementById('nsVersion').innerText = `Northstar version: ${payload.ns}`;
+});
+ipcRenderer.send('getVersionInfo');
+
setlang();
setInterval(() => {
ipcRenderer.send("setsize", document.querySelector(".lines").offsetHeight + 20);
-}, 150)
+}, 150);
diff --git a/src/index.js b/src/index.js
index aacfe27..639cbeb 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,6 +1,6 @@
const fs = require("fs");
const path = require("path");
-const { app, dialog, ipcMain, BrowserWindow } = require("electron");
+const { app, dialog, ipcMain, BrowserWindow, ipcRenderer } = require("electron");
const Emitter = require("events");
const events = new Emitter();
@@ -43,7 +43,14 @@ ipcMain.on("setlang", (event, lang) => {utils.setlang(lang)})
ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")})
ipcMain.on("update", (event) => {utils.update()})
-ipcMain.on("setpathcli", (event) => {utils.setpath()})
+ipcMain.on("setpathcli", (event) => {utils.setpath()});
+
+ipcMain.on('getVersionInfo', () => {
+ win.webContents.send('versionInfo', {
+ ns: utils.getInstalledVersion(),
+ vp: 'v' + require('../package.json').version
+ });
+});
process.chdir(app.getPath("appData"));
diff --git a/src/utils.js b/src/utils.js
index 7e9dbac..b5767da 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -146,4 +146,5 @@ module.exports = {
settings.lang = lang;
saveSettings();
},
+ getInstalledVersion
}