diff options
author | Alystrasz <contact@remyraes.com> | 2021-12-30 00:19:21 +0100 |
---|---|---|
committer | Alystrasz <contact@remyraes.com> | 2021-12-30 00:19:21 +0100 |
commit | 869fef7de703174b5b0e0eadc6565a8963bb6bfc (patch) | |
tree | 6d0cfb1c6c1dcec1f53b8853474f4910db17bdbe | |
parent | 9df37da13c5eeba92ceeed7a5e9ffbaed976a615 (diff) | |
parent | fabfee3a0b845a9b58dbb59932228d6c4223aad3 (diff) | |
download | Viper-869fef7de703174b5b0e0eadc6565a8963bb6bfc.tar.gz Viper-869fef7de703174b5b0e0eadc6565a8963bb6bfc.zip |
Merge branch 'main' into feat/version-indicator
-rw-r--r-- | src/app/index.html | 2 | ||||
-rw-r--r-- | src/app/lang.js | 16 | ||||
-rw-r--r-- | src/app/main.css | 7 | ||||
-rw-r--r-- | src/app/main.js | 5 | ||||
-rw-r--r-- | src/index.js | 14 | ||||
-rw-r--r-- | src/lang/fr.json | 34 |
6 files changed, 66 insertions, 12 deletions
diff --git a/src/app/index.html b/src/app/index.html index c486f28..3eadd96 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -28,7 +28,7 @@ </div> </div> - <script src="main.js"></script> <script src="lang.js"></script> + <script src="main.js"></script> </body> </html> diff --git a/src/app/lang.js b/src/app/lang.js index 8cf3d4b..5cc9708 100644 --- a/src/app/lang.js +++ b/src/app/lang.js @@ -1,10 +1,12 @@ -html = document.body.innerHTML.split("%%"); +function setlang() { + html = document.body.innerHTML.split("%%"); -for (let i = 0; i < html.length; i++) { - if (html[i][0] != " " && - html[i][html[i].length - 1] != " ") { - html[i] = lang(html[i]) + for (let i = 0; i < html.length; i++) { + if (html[i][0] != " " && + html[i][html[i].length - 1] != " ") { + html[i] = lang(html[i]) + } } -} -document.body.innerHTML = html.join(""); + document.body.innerHTML = html.join(""); +} diff --git a/src/app/main.css b/src/app/main.css index f3cd7c5..c86e08d 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -28,16 +28,22 @@ body, button, input { font-family: "Roboto Mono", monospace; } +nobr {white-space: nowrap} + .line { display: flex; margin-top: 15px; } .buttons { + text-align: right; margin-left: auto; margin-right: 7px; } +.text {max-width: 38vw} +.buttons {max-width: 55vw} + button, .text { border: none; outline: none; @@ -47,6 +53,7 @@ button, .text { } button { + margin-bottom: 10px; color: var(--btnforeground); -webkit-app-region: no-drag; } diff --git a/src/app/main.js b/src/app/main.js index a059671..ab41af6 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -40,3 +40,8 @@ ipcRenderer.on('versionInfo', (_, payload) => { document.getElementById('nsVersion').innerText = `Northstar version: ${payload.ns}`; }); ipcRenderer.send('getVersionInfo'); + +setlang(); +setInterval(() => { + ipcRenderer.send("setsize", document.querySelector(".lines").offsetHeight + 20); +}, 150); diff --git a/src/index.js b/src/index.js index 56b0df4..639cbeb 100644 --- a/src/index.js +++ b/src/index.js @@ -9,9 +9,10 @@ const utils = require("./utils"); const cli = require("./cli"); function start() { + let width = 600; win = new BrowserWindow({ - width: 600, - height: 130, + width: width, + height: 115, show: false, title: "Viper", resizable: false, @@ -26,10 +27,15 @@ function start() { win.removeMenu(); win.loadFile(__dirname + "/app/index.html"); - win.webContents.once("dom-ready", () => {win.show()}); - ipcMain.on("setpath", (event) => {utils.setpath(win)}) ipcMain.on("exit", (event) => {process.exit(0)}) + ipcMain.on("setpath", (event) => {utils.setpath(win)}) + ipcMain.on("setsize", (event, height) => { + win.setSize(width, height); + if (! win.isVisible()) { + win.show(); + } + }) } ipcMain.on("launch", (event) => {utils.launch()}) diff --git a/src/lang/fr.json b/src/lang/fr.json new file mode 100644 index 0000000..0dd9f99 --- /dev/null +++ b/src/lang/fr.json @@ -0,0 +1,34 @@ +{ + "cli.help.help": "affiche ce message d'aide", + "cli.help.debug": "affiche les outils de développement", + "cli.help.cli": "force l'activation de la CLI", + "cli.help.update": "met à jour Northstar sur le chemin du jeu précisé", + "cli.help.setpath": "enregistre le chemin du client de jeu", + + "cli.setpath.noarg": "Aucun argument donné à --setpath", + + "cli.update.current": "Version actuelle :", + "cli.update.downloading": "Téléchargement en cours :", + "cli.update.checking": "Vérification des mises à jour ...", + "cli.update.downloaddone": "Téléchargement terminé ! Extraction des fichiers...", + "cli.update.finished": "Mise à jour terminée !", + "cli.update.uptodate": "La dernière version (%s) est déjà installée.", + + "cli.launch.linuxerror": "Le support du jeu sur Linux n'est pas encore implémenté.", + + "gui.welcome": "Bienvenue sur Viper !", + "gui.exit": "Fermer", + "gui.update": "Mise à jour", + "gui.setpath": "Chemin du jeu", + + "gui.launch": "Jouer", + "gui.launchvanilla": "Vanilla", + "gui.launchnorthstar": "Northstar", + + "gui.selectpath": "Veuillez sélectionner le dossier où se trouve le client Titanfall 2.", + "gui.missinggamepath": "Le chemin du client n'est pas défini !", + + + "general.launching": "Lancement", + "general.missingpath": "Le chemin du client n'est pas défini !" +} |