From f474005ea330198caa066a50c5f71ff087d4158f Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 23 Jan 2022 21:58:56 +0100 Subject: added loading, close button, element fadein etc To show the loading simply do Browser.loading(), when a BrowserEl() is made it auto removes it. The loading and BrowserEl's will fade into view instead of popping in instantly. And then now there's a tiny close button, as it may not be obvious you can click the dark overlay or click Escape. --- src/lang/en.json | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lang') diff --git a/src/lang/en.json b/src/lang/en.json index c2b6f98..ecc2cc5 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -62,6 +62,8 @@ "gui.mods.installing": "Installing mod...", "gui.mods.installedmod": "Installed mod!", + "gui.browser.loading": "Loading mods...", + "gui.update.downloading": "Downloading...", "gui.update.extracting": "Extracting update...", "gui.update.finished": "Done! Ready to play!", -- cgit v1.2.3 From 89bd545b938fb05980393a3f2ae3f0aa2cbee220 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 23 Jan 2022 22:17:59 +0100 Subject: added "Find Mods" button --- src/app/index.html | 1 + src/app/main.css | 5 ++++- src/lang/en.json | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/app/index.html b/src/app/index.html index e03936d..c2978bd 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -92,6 +92,7 @@ + diff --git a/src/app/main.css b/src/app/main.css index e13979a..acec007 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -513,7 +513,10 @@ code { } .modbtns button { - margin-left: calc(var(--padding) / 3); + --spacing: calc(var(--padding) / 3); + margin-left: var(--spacing); + margin-top: calc(var(--spacing) / 2); + margin-bottom: calc(var(--spacing) / 2); } /* drag control */ diff --git a/src/lang/en.json b/src/lang/en.json index ecc2cc5..5377ca2 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -49,6 +49,7 @@ "gui.mods.count": "Mods Installed:", "gui.mods.disabledtag": "Disabled", "gui.mods.install": "Install Mod", + "gui.mods.find": "Find Mods", "gui.mods.toggle": "Toggle Mod", "gui.mods.toggleall": "Toggle All", "gui.mods.remove": "Remove Mod", -- cgit v1.2.3 From 396c1f3c9499a2bb50b2b5f3760cc58acfe9b87f Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 23 Jan 2022 23:18:45 +0100 Subject: minor aesthetic changes --- src/app/browser.js | 2 +- src/app/main.css | 59 ++++++++++++++++++++++++++++++++---------------------- src/lang/en.json | 1 + 3 files changed, 37 insertions(+), 25 deletions(-) (limited to 'src/lang') diff --git a/src/app/browser.js b/src/app/browser.js index 8af6afe..eb18fe5 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -61,7 +61,7 @@ function BrowserEl(properties) {
${properties.title}
-
${properties.description} - by ${properties.author}
+
${properties.description} - ${lang("gui.browser.madeby")} ${properties.author}
diff --git a/src/app/main.css b/src/app/main.css index acec007..67174b8 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -26,12 +26,40 @@ background: var(--red); } +::selection { + color: black; + background: var(--red); +} + +body { + margin: 0; + overflow: hidden; + user-select: none; +} + +body, button, input {font-family: "Roboto", sans-serif} + +button {outline: none} +b, strong {font-weight: 700} +body, input, button {font-weight: 500} + +button { + border: none; + color: white; + outline: none; + cursor: pointer; + font-weight: 700; + padding: 5px 10px; + border-radius: 5px; + transition: 0.2s ease-in-out; +} + .playBtn, .gamesContainer button, #winbtns div { cursor: pointer; } #browser { - --spacing: calc(var(--padding) * 3); + --spacing: var(--padding); z-index: 2; opacity: 0.0; @@ -116,9 +144,14 @@ #browser #search { border: none; outline: none; + transition: filter 0.15s ease-in-out; width: calc(100% - var(--spacing) * 2); } +#browser #search:focus { + filter: brightness(1.5); +} + #browser #close { --height: calc(var(--padding) * 1.5); @@ -182,28 +215,6 @@ #winbtns div:hover {opacity: 1.0} #winbtns div:active {transform: scale(0.98)} -body { - margin: 0; - overflow: hidden; - user-select: none; -} - -body, button, input {font-family: "Roboto", sans-serif} - -button {outline: none} -b, strong {font-weight: 700} -body, input, button {font-weight: 500} - -button { - border: none; - color: white; - outline: none; - font-weight: 700; - padding: 5px 10px; - border-radius: 5px; - transition: 0.2s ease-in-out; -} - button:hover {filter: brightness(110%)} button:active {filter: brightness(90%)} @@ -513,8 +524,8 @@ code { } .modbtns button { - --spacing: calc(var(--padding) / 3); margin-left: var(--spacing); + --spacing: calc(var(--padding) / 3); margin-top: calc(var(--spacing) / 2); margin-bottom: calc(var(--spacing) / 2); } diff --git a/src/lang/en.json b/src/lang/en.json index 5377ca2..0d29115 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -64,6 +64,7 @@ "gui.mods.installedmod": "Installed mod!", "gui.browser.loading": "Loading mods...", + "gui.browser.madeby": "by", "gui.update.downloading": "Downloading...", "gui.update.extracting": "Extracting update...", -- cgit v1.2.3 From 18d1166b6b8beef422590607cd02d613dd02d2d0 Mon Sep 17 00:00:00 2001 From: 3top1a <57371001+3top1a@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:27:29 +0100 Subject: Edge case in vdf reading (#56) * Edge case * Alert user only when automatic detection failed * extra info on not found message * support for [Free/Open]BSD Co-authored-by: 0neGal --- .github/FUNDING.yml | 2 +- src/app/main.js | 1 - src/extras/findgame.js | 6 ++++-- src/lang/en.json | 2 +- src/utils.js | 2 ++ 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lang') diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 96f466a..8991fb3 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,2 @@ liberapay: 0neGal -custom: ["https://github.com/R2Northstar"] +custom: ["github.com/R2Northstar"] diff --git a/src/app/main.js b/src/app/main.js index 5f0cc9a..dab584e 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -32,7 +32,6 @@ if (fs.existsSync("viper.json")) { setpath(true); } } else { - alert(lang("general.missingpath")); setpath(); } diff --git a/src/extras/findgame.js b/src/extras/findgame.js index f7da1c0..42c9b85 100644 --- a/src/extras/findgame.js +++ b/src/extras/findgame.js @@ -41,17 +41,19 @@ module.exports = async () => { } } - let folder = ""; + let folder = null; switch (process.platform) { case "win32": folder = "C:\\Program Files (x86)\\Steam\\steamapps\\libraryfolders.vdf"; break case "linux": + case "openbsd": + case "freebsd": folder = path.join(app.getPath("home"), "/.steam/steam/steamapps/libraryfolders.vdf"); break } - if (fs.existsSync(folder)) { + if (fs.existsSync(folder) && folder) { let data = fs.readFileSync(folder) let read_vdf = readvdf(data.toString()) if (read_vdf ) {return read_vdf} diff --git a/src/lang/en.json b/src/lang/en.json index c2b6f98..8d4daeb 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -96,7 +96,7 @@ "general.mods.enabled": "Enabled mods:", "general.mods.disabled": "Disabled mods:", "general.mods.installed": "Installed mods:", - "general.missingpath": "Game path is not set!", + "general.missingpath": "Game location could not be found automatically! Please select it manually!", "general.notinstalled": "Northstar is not installed!", "general.launching": "Launching" } diff --git a/src/utils.js b/src/utils.js index a2c61d4..ef647fe 100644 --- a/src/utils.js +++ b/src/utils.js @@ -142,6 +142,8 @@ async function setpath(win) { return; } + alert(lang("general.missingpath")); + // Fallback to manual selection dialog.showOpenDialog({properties: ["openDirectory"]}).then(res => { if (res.canceled) { -- cgit v1.2.3 From 5566e6c1cd572c18944f651083e6f30b8e7a4354 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Mon, 24 Jan 2022 15:38:17 +0100 Subject: [fix] update general.missingpath French translation --- src/lang/fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/lang/fr.json b/src/lang/fr.json index 59a3090..1ba7acf 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -96,7 +96,7 @@ "general.mods.enabled": "Mods activés :", "general.mods.disabled": "Mods désactivés :", "general.mods.installed": "Mods installés :", - "general.missingpath": "Le chemin du client n'est pas défini !", + "general.missingpath": "Le chemin du client n'a pu être trouvé automatiquement, merci de le sélectionner manuellement.", "general.notinstalled": "Northstar n'est pas installé !", "general.launching": "Lancement" } -- cgit v1.2.3 From 9c6ac295189acab7303952725755dfac87e18470 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 24 Jan 2022 18:21:13 +0100 Subject: no alert when manually changing the game path When changing the game path by clicking the button you shouldn't be told it can't find the game and you've to select one manually, as you know that already. More importantly, if it could be found automatically it'll just not do anything. With this change I also changed the "gui.setpath" string to be more logical, and to make it clear what it does. --- src/app/main.js | 1 - src/index.js | 10 +++++++--- src/lang/en.json | 2 +- src/utils.js | 30 ++++++++++++++++-------------- 4 files changed, 24 insertions(+), 19 deletions(-) (limited to 'src/lang') diff --git a/src/app/main.js b/src/app/main.js index dab584e..a3a1d04 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -26,7 +26,6 @@ if (fs.existsSync("viper.json")) { settings.zip = path.join(settings.gamepath + "/northstar.zip"); if (settings.gamepath.length === 0) { - alert(lang("general.missingpath")); setpath(false); } else { setpath(true); diff --git a/src/index.js b/src/index.js index f4207e7..c8bfc53 100644 --- a/src/index.js +++ b/src/index.js @@ -87,9 +87,13 @@ ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")}) ipcMain.on("update", (event) => {utils.update()}) ipcMain.on("setpathcli", (event) => {utils.setpath()}); ipcMain.on("setpath", (event, value) => { - if (!value) { - utils.setpath(win); - } else if (!win.isVisible()) { + if (! value) { + if (! win.isVisible()) { + utils.setpath(win); + } else { + utils.setpath(win, true); + } + } else if (! win.isVisible()) { win.show(); } }); diff --git a/src/lang/en.json b/src/lang/en.json index 8d4daeb..fe9b0b0 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -42,7 +42,7 @@ "gui.versions.northstar": "Northstar version", "gui.exit": "Exit", "gui.update": "Update", - "gui.setpath": "Game Path", + "gui.setpath": "Change Game Path", "gui.update.check": "Check for updates", "gui.mods": "Mods", diff --git a/src/utils.js b/src/utils.js index ef647fe..fb94b92 100644 --- a/src/utils.js +++ b/src/utils.js @@ -116,7 +116,7 @@ northstar_auto_updates: { // // If running with CLI it takes in the --setpath argument otherwise it // open the systems file browser for the user to select a path. -async function setpath(win) { +async function setpath(win, forcedialog) { function setGamepath(folder) { settings.gamepath = folder; settings.zip = path.join(settings.gamepath + "/northstar.zip"); @@ -128,21 +128,23 @@ async function setpath(win) { if (! win) { // CLI setGamepath(cli.param("setpath")); } else { // GUI - function setGamepath(folder) { - settings.gamepath = folder; - settings.zip = path.join(settings.gamepath + "/northstar.zip"); - saveSettings(); - win.webContents.send("newpath", settings.gamepath); - ipcMain.emit("newpath", null, settings.gamepath); - } + if (! forcedialog) { + function setGamepath(folder, forcedialog) { + settings.gamepath = folder; + settings.zip = path.join(settings.gamepath + "/northstar.zip"); + saveSettings(); + win.webContents.send("newpath", settings.gamepath); + ipcMain.emit("newpath", null, settings.gamepath); + } - let gamepath = await findgame(); - if (gamepath) { - setGamepath(gamepath); - return; - } + let gamepath = await findgame(); + if (gamepath) { + setGamepath(gamepath); + return; + } - alert(lang("general.missingpath")); + winAlert(lang("general.missingpath")); + } // Fallback to manual selection dialog.showOpenDialog({properties: ["openDirectory"]}).then(res => { -- cgit v1.2.3 From 72825d6bd99799144f432c42d38e521d61e62399 Mon Sep 17 00:00:00 2001 From: Delta <31860825+AA-Delta@users.noreply.github.com> Date: Tue, 25 Jan 2022 12:56:43 -0500 Subject: Add es.json Add spanish translation (Latin-america) --- src/lang/es.json | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/lang/es.json (limited to 'src/lang') diff --git a/src/lang/es.json b/src/lang/es.json new file mode 100644 index 0000000..cb790e8 --- /dev/null +++ b/src/lang/es.json @@ -0,0 +1,102 @@ +{ + "cli.help.help": "muestra este mensaje de ayuda", + "cli.help.debug": "habre las herramientas de desarrollador/depuración ", + "cli.help.version": "muestra la información de la versión", + "cli.help.cli": "obliga la linea de comandos a habilitarse", + "cli.help.update": "actualiza Northstar desde la ruta de juego establecida", + "cli.help.setpath": "establece la ruta del juego", + "cli.help.updatevp": "actualiza Viper si es soportado", + "cli.help.installmod": "instala una modificación, desde una carpeta o zip", + "cli.help.removemod": "remueve una modificación", + "cli.help.togglemod": "alterna el estado de la modificación", + + "cli.setpath.noarg": "No se ha proporcionado ningún argumento para --setpath", + + "cli.update.current": "Versión actual:", + "cli.update.downloading": "Descargando...", + "cli.update.checking": "Buscando actualizaciones...", + "cli.update.downloaddone": "¡Descarga completa! Extrayendo...", + "cli.update.finished": "Instalación/Actualización completada!", + "cli.update.uptodate": "La ultima versión (%s) ya está instalada, omitiendo actualización.", + "cli.update.uptodate.short": "Está actualizado", + + "cli.autoupdates.checking": "Buscando actualizaciones de Northstar...", + "cli.autoupdates.available": "¡Actualización de Northsar disponible!", + "cli.autoupdates.gamerunning": "El juego se está ejecutando, no se puede actualizar Northstar", + "cli.autoupdates.updatingns": "Lanzando proceso de actualización...", + "cli.autoupdates.noupdate": "No hay actualizaciones de Northstar disponibles.", + + "cli.launch.linuxerror": "La ejecución del juego en Linux aun no está implementada", + + "cli.mods.failed": "¡Fallo al instalar el mod!", + "cli.mods.removed": "¡Modificación removida exitosamente!", + "cli.mods.toggled": "¡El estado de la modificación ha cambiado exitosamente!", + "cli.mods.installed": "¡Modificiación instalada exitosamente!", + "cli.mods.cantfind": "¡No se encuentra una modificación con ese nombre!", + "cli.mods.notamod": "La carpeta o el archivo seleccionado no es una modificación", + "cli.mods.toggledall": "¡Estado de todas las modiciaciones ha sido cambiado exitosamente!", + "cli.mods.improperjson": "%s's mod.json tiene errores de formato", + + "gui.welcome": "Bienvenido a Viper!", + "gui.versions.viper": "Versión de Viper", + "gui.versions.northstar": "Versión de Northstar", + "gui.exit": "Salir", + "gui.update": "Actualizar", + "gui.setpath": "Ruta del juego", + + "gui.update.check": "Buscar actualizaciones", + "gui.mods": "Modificaciones (Mods)", + "gui.mods.count": "Modificaciones instaladas:", + "gui.mods.disabledtag": "Deshabilitado", + "gui.mods.install": "Instalar modificación", + "gui.mods.toggle": "Alternar modificación", + "gui.mods.toggleall": "Alternar todo", + "gui.mods.remove": "Remover modificación", + "gui.mods.removeall": "Remover todo", + "gui.mods.nothingselected": "No has seleccionado una modificación.", + "gui.mods.toggleall.confirm": "Alternar todo podría deshabilitar las modificaciones requeridas para que Northstar funcione. ¿Está seguro?", + "gui.mods.removeall.confirm": "Eliminar todas las modificaciones generalmente requerirá que reinstales Northstar. ¿Está seguro?", + "gui.mods.required.confirm": "Ha seleccionado un mod esencial, es posible que Northstar no funcione sin él. ¿Está seguro?", + "gui.mods.notamod": "¡No es una modificación!", + "gui.mods.extracting": "Extrayendo modificación...", + "gui.mods.installing": "Instalando modificación...", + "gui.mods.installedmod": "¡Modificación instalada!", + + "gui.update.downloading": "Descargando...", + "gui.update.extracting": "Extrayendo actualización...", + "gui.update.finished": "¡Hecho! ¡Está listo para jugar!", + "gui.update.uptodate": "¡Ya está actualizado!", + "gui.update.available": "Hay una actualización disponible para Viper, ¿desea reiniciar y aplicarla?", + + "gui.nsupdate.gaming.title": "¡Actualización de Northstar disponible!", + "gui.nsupdate.gaming.body": "Una actualización de northstar está disponible.\nPuedes forzar su instalación despues de cerrar el juego.", + + "gui.launch": "Ejecutar", + "gui.launchvanilla": "Vanilla", + "gui.launchnorthstar": "Northstar", + "gui.installnorthstar": "Instalar", + + "gui.selectpath": "Por favor, ¡elija la ruta del juego!", + "gui.gamepath.must": "La ruta del juego debe establecerse para ejecutar Viper.", + "gui.gamepath.wrong": "Esta carpeta no es una ruta válida para el juego.", + + "viper.menu.main": "Viper", + "viper.menu.release": "Notas de actualización", + "viper.menu.info": "Extras", + "viper.menu.info.links": "Links", + "viper.menu.info.credits": "Creditos", + + "viper.info.discord": "Unete al Discord:", + "viper.info.issues": "Reporta problemas de Viper:", + + "ns.menu.main": "Northstar Launcher", + "ns.menu.mods": "Modificiaciones", + "ns.menu.release": "Notas de actualización", + + "general.mods.enabled": "Modificaciones habilitadas:", + "general.mods.disabled": "Modificaciones deshabilitadas:", + "general.mods.installed": "Modificiaciones intaladas:", + "general.missingpath": "¡La ruta del jueno no se ha establecido!", + "general.notinstalled": "¡Northstar no se ha instalado!", + "general.launching": "Ejecutando" +} -- cgit v1.2.3 From dd1a4d50f590b127f0fd3404b063bc42cf29112b Mon Sep 17 00:00:00 2001 From: Delta <31860825+AA-Delta@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:58:36 -0500 Subject: Updated Languaje --- src/lang/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/lang/es.json b/src/lang/es.json index cb790e8..263494b 100644 --- a/src/lang/es.json +++ b/src/lang/es.json @@ -81,7 +81,7 @@ "gui.gamepath.wrong": "Esta carpeta no es una ruta válida para el juego.", "viper.menu.main": "Viper", - "viper.menu.release": "Notas de actualización", + "viper.menu.release": "Notas de la versión", "viper.menu.info": "Extras", "viper.menu.info.links": "Links", "viper.menu.info.credits": "Creditos", -- cgit v1.2.3 From 61f9bc80b33ff4a3d9397640db7ca82f7bb79861 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Tue, 25 Jan 2022 22:08:23 +0100 Subject: changed French localization, remove .vscode/ --- .vscode/launch.json | 17 ----------------- src/lang/fr.json | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 .vscode/launch.json (limited to 'src/lang') diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index ef3f9b3..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Debug Main Process", - "type": "node", - "request": "launch", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", - "windows": { - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd" - }, - "args" : ["."], - "outputCapture": "std" - } - ] - } \ No newline at end of file diff --git a/src/lang/fr.json b/src/lang/fr.json index 1ba7acf..2fbc89a 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -42,7 +42,7 @@ "gui.versions.northstar": "Version de Northstar", "gui.exit": "Fermer", "gui.update": "Mise à jour", - "gui.setpath": "Chemin du jeu", + "gui.setpath": "Mettre à jour le chemin du jeu", "gui.update.check": "Vérifier les mises à jour", "gui.mods": "Mods", -- cgit v1.2.3 From ca9ac01957973cd0b8d3fbd640da1fdbb135a4e7 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 26 Jan 2022 00:41:06 +0100 Subject: added lang/maintainers.json, updated langs.js langs.js now prints out a proper good looking output, and also now takes advantage of maintainers.json to provide proper information. --- build/langs.js | 16 +++++++++++++++- src/lang/maintainers.json | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/lang/maintainers.json (limited to 'src/lang') diff --git a/build/langs.js b/build/langs.js index 0e82022..9e21dff 100644 --- a/build/langs.js +++ b/build/langs.js @@ -1,10 +1,14 @@ const fs = require("fs"); let lang = require("../src/lang/en.json"); +let maintainers = require("../src/lang/maintainers.json"); langs = fs.readdirSync("src/lang") langs.forEach((localefile) => { + if (localefile == "maintainers.json") {return} + let missing = []; + let langmaintainers = maintainers.list[localefile.replace(/\..*$/, "")]; let locale = require("../src/lang/" + localefile) for (let i in lang) { if (! locale[i]) { @@ -13,6 +17,16 @@ langs.forEach((localefile) => { } if (missing.length > 0) { - console.error(`${localefile} is missing: ${missing}`) + console.error(`${localefile} is missing:`) + for (let i in missing) { + console.log(` ${missing[i]}`) + } + + console.log() + + console.log("Maintainers of language: ") + for (let i in langmaintainers) { + console.log(` ${langmaintainers[i]}`) + } } }) diff --git a/src/lang/maintainers.json b/src/lang/maintainers.json new file mode 100644 index 0000000..7d276c9 --- /dev/null +++ b/src/lang/maintainers.json @@ -0,0 +1,13 @@ +{ + "explanation": "This file is for storing contact informatino for the various maintainers of various languages/localizations", + + "list": { + "es": [ + "https://github.com/AA-Delta" + ], + + "fr": [ + "https://github.com/Alystrasz" + ] + } +} -- cgit v1.2.3 From f7f5708f6f8aaefaec6adfbbd7b626941214dc9d Mon Sep 17 00:00:00 2001 From: Delta <31860825+AA-Delta@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:43:58 -0500 Subject: Update es.json translation to match #53 en.json --- src/lang/es.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lang') diff --git a/src/lang/es.json b/src/lang/es.json index 263494b..c6e282d 100644 --- a/src/lang/es.json +++ b/src/lang/es.json @@ -42,7 +42,7 @@ "gui.versions.northstar": "Versión de Northstar", "gui.exit": "Salir", "gui.update": "Actualizar", - "gui.setpath": "Ruta del juego", + "gui.setpath": "Cambiar la ruta del juego", "gui.update.check": "Buscar actualizaciones", "gui.mods": "Modificaciones (Mods)", @@ -96,7 +96,7 @@ "general.mods.enabled": "Modificaciones habilitadas:", "general.mods.disabled": "Modificaciones deshabilitadas:", "general.mods.installed": "Modificiaciones intaladas:", - "general.missingpath": "¡La ruta del jueno no se ha establecido!", + "general.missingpath": "¡La ruta del jueno no se ha podido encontrar automaticamente! ¡Por favor, elige la ruta manualmente!", "general.notinstalled": "¡Northstar no se ha instalado!", "general.launching": "Ejecutando" } -- cgit v1.2.3 From 691d7766c7ec2b72ea895ce559659c4c613f3750 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Thu, 27 Jan 2022 17:10:38 +0100 Subject: fix spelling in maintainers.json --- src/lang/maintainers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/lang/maintainers.json b/src/lang/maintainers.json index 7d276c9..094814a 100644 --- a/src/lang/maintainers.json +++ b/src/lang/maintainers.json @@ -1,5 +1,5 @@ { - "explanation": "This file is for storing contact informatino for the various maintainers of various languages/localizations", + "explanation": "This file is for storing contact information for the various maintainers of various languages/localizations", "list": { "es": [ -- cgit v1.2.3 From ea671766d7589d4efdb81996237dca9290b329c1 Mon Sep 17 00:00:00 2001 From: GitExample Date: Thu, 3 Feb 2022 01:47:56 +0100 Subject: added English localizations I forgot about these before... --- src/app/browser.js | 8 ++++---- src/lang/en.json | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lang') diff --git a/src/app/browser.js b/src/app/browser.js index 357a076..7fbae1d 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -61,9 +61,9 @@ function BrowserEl(properties) { browserEntries.innerHTML = ""; } - let installstring = "Install"; + let installstr = lang("gui.browser.install"); if (normalize(modsdiv.innerText.split("\n")).includes(normalize(properties.title))) { - installstring = "Re-Install"; + installstr = lang("gui.browser.reinstall"); } browserEntries.innerHTML += ` @@ -74,7 +74,7 @@ function BrowserEl(properties) {
${properties.title}
${properties.description} - ${lang("gui.browser.madeby")} ${properties.author}
- +
@@ -86,7 +86,7 @@ ipcRenderer.on("installedmod", (event, modname) => { modname = normalize(modname); if (document.getElementById(modname)) { - document.getElementById(modname).querySelector(".text button").innerHTML = "Re-Install"; + document.getElementById(modname).querySelector(".text button").innerHTML = lang("gui.browser.reinstall"); } }) diff --git a/src/lang/en.json b/src/lang/en.json index 0d29115..47bfacb 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -65,6 +65,8 @@ "gui.browser.loading": "Loading mods...", "gui.browser.madeby": "by", + "gui.browser.install": "Install", + "gui.browser.reinstall": "Re-Install", "gui.update.downloading": "Downloading...", "gui.update.extracting": "Extracting update...", -- cgit v1.2.3 From 5884b9a8e91ed8b2c5cfea90afa2709697b05afb Mon Sep 17 00:00:00 2001 From: GitExample Date: Thu, 3 Feb 2022 23:03:33 +0100 Subject: detection for new updates of mods --- src/app/browser.js | 9 +++++++++ src/app/main.js | 2 ++ src/lang/en.json | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/app/browser.js b/src/app/browser.js index b387a6a..dda0441 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -95,8 +95,17 @@ function BrowserEl(properties) { } let installstr = lang("gui.browser.install"); + if (normalize(modsdiv.innerText.split("\n")).includes(normalize(properties.title))) { installstr = lang("gui.browser.reinstall"); + + for (let i = 0; i < modsobj.all.length; i++) { + if (normalize(modsobj.all[i].Name) == normalize(properties.title) + && "v" + modsobj.all[i].Version != properties.version) { + + installstr = lang("gui.browser.update"); + } + } } browserEntries.innerHTML += ` diff --git a/src/app/main.js b/src/app/main.js index fa7cea8..08c70c1 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -3,6 +3,7 @@ const path = require("path"); const { ipcRenderer, shell } = require("electron"); const lang = require("../lang"); +var modsobj = {}; let shouldInstallNorthstar = false; // Base settings @@ -180,6 +181,7 @@ ipcRenderer.on("alert", (event, msg) => {alert(msg)}) // Updates the installed mods ipcRenderer.on("mods", (event, mods) => { + modsobj = mods; modcount.innerHTML = `${lang("gui.mods.count")} ${mods.all.length}`; modsdiv.innerHTML = ""; diff --git a/src/lang/en.json b/src/lang/en.json index 47bfacb..59af04b 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -63,10 +63,11 @@ "gui.mods.installing": "Installing mod...", "gui.mods.installedmod": "Installed mod!", - "gui.browser.loading": "Loading mods...", "gui.browser.madeby": "by", + "gui.browser.update": "Update", "gui.browser.install": "Install", "gui.browser.reinstall": "Re-Install", + "gui.browser.loading": "Loading mods...", "gui.update.downloading": "Downloading...", "gui.update.extracting": "Extracting update...", -- cgit v1.2.3 From 4b2c2512ac726aa900227ad7b35c6160688f59de Mon Sep 17 00:00:00 2001 From: Delta <31860825+AA-Delta@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:30:28 -0800 Subject: Spanish localization for thunderstore support (#64) * Create es.json * Updated es.json for thunderstore * Updated "es" localization with gui.browser.update --- src/lang/es.json | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 src/lang/es.json (limited to 'src/lang') diff --git a/src/lang/es.json b/src/lang/es.json new file mode 100644 index 0000000..770bb5f --- /dev/null +++ b/src/lang/es.json @@ -0,0 +1,109 @@ +{ + "cli.help.help": "muestra este mensaje de ayuda", + "cli.help.debug": "habre las herramientas de desarrollador/depuración ", + "cli.help.version": "muestra la información de la versión", + "cli.help.cli": "obliga la linea de comandos a habilitarse", + "cli.help.update": "actualiza Northstar desde la ruta de juego establecida", + "cli.help.setpath": "establece la ruta del juego", + "cli.help.updatevp": "actualiza Viper si es soportado", + "cli.help.installmod": "instala una modificación, desde una carpeta o zip", + "cli.help.removemod": "remueve una modificación", + "cli.help.togglemod": "alterna el estado de la modificación", + + "cli.setpath.noarg": "No se ha proporcionado ningún argumento para --setpath", + + "cli.update.current": "Versión actual:", + "cli.update.downloading": "Descargando...", + "cli.update.checking": "Buscando actualizaciones...", + "cli.update.downloaddone": "¡Descarga completa! Extrayendo...", + "cli.update.finished": "Instalación/Actualización completada!", + "cli.update.uptodate": "La ultima versión (%s) ya está instalada, omitiendo actualización.", + "cli.update.uptodate.short": "Está actualizado", + + "cli.autoupdates.checking": "Buscando actualizaciones de Northstar...", + "cli.autoupdates.available": "¡Actualización de Northsar disponible!", + "cli.autoupdates.gamerunning": "El juego se está ejecutando, no se puede actualizar Northstar", + "cli.autoupdates.updatingns": "Lanzando proceso de actualización...", + "cli.autoupdates.noupdate": "No hay actualizaciones de Northstar disponibles.", + + "cli.launch.linuxerror": "La ejecución del juego en Linux aun no está implementada", + + "cli.mods.failed": "¡Fallo al instalar el mod!", + "cli.mods.removed": "¡Modificación removida exitosamente!", + "cli.mods.toggled": "¡El estado de la modificación ha cambiado exitosamente!", + "cli.mods.installed": "¡Modificiación instalada exitosamente!", + "cli.mods.cantfind": "¡No se encuentra una modificación con ese nombre!", + "cli.mods.notamod": "La carpeta o el archivo seleccionado no es una modificación", + "cli.mods.toggledall": "¡Estado de todas las modiciaciones ha sido cambiado exitosamente!", + "cli.mods.improperjson": "%s's mod.json tiene errores de formato", + + "gui.welcome": "Bienvenido a Viper!", + "gui.versions.viper": "Versión de Viper", + "gui.versions.northstar": "Versión de Northstar", + "gui.exit": "Salir", + "gui.update": "Actualizar", + "gui.setpath": "Cambiar la ruta del juego", + + "gui.update.check": "Buscar actualizaciones", + "gui.mods": "Modificaciones (Mods)", + "gui.mods.count": "Modificaciones instaladas:", + "gui.mods.disabledtag": "Deshabilitado", + "gui.mods.install": "Instalar modificación", + "gui.mods.find": "Encontrar modificaciones", + "gui.mods.toggle": "Alternar modificación", + "gui.mods.toggleall": "Alternar todo", + "gui.mods.remove": "Remover modificación", + "gui.mods.removeall": "Remover todo", + "gui.mods.nothingselected": "No has seleccionado una modificación.", + "gui.mods.toggleall.confirm": "Alternar todo podría deshabilitar las modificaciones requeridas para que Northstar funcione. ¿Está seguro?", + "gui.mods.removeall.confirm": "Eliminar todas las modificaciones generalmente requerirá que reinstales Northstar. ¿Está seguro?", + "gui.mods.required.confirm": "Ha seleccionado un mod esencial, es posible que Northstar no funcione sin él. ¿Está seguro?", + "gui.mods.notamod": "¡No es una modificación!", + "gui.mods.extracting": "Extrayendo modificación...", + "gui.mods.installing": "Instalando modificación...", + "gui.mods.installedmod": "¡Modificación instalada!", + + "gui.browser.madeby": "por", + "gui.browser.update": "Actualizar", + "gui.browser.install": "Instalar", + "gui.browser.reinstall": "Re-Instalar", + "gui.browser.loading": "Cargando modificaciones...", + + "gui.update.downloading": "Descargando...", + "gui.update.extracting": "Extrayendo actualización...", + "gui.update.finished": "¡Hecho! ¡Está listo para jugar!", + "gui.update.uptodate": "¡Ya está actualizado!", + "gui.update.available": "Hay una actualización disponible para Viper, ¿desea reiniciar y aplicarla?", + + "gui.nsupdate.gaming.title": "¡Actualización de Northstar disponible!", + "gui.nsupdate.gaming.body": "Una actualización de northstar está disponible.\nPuedes forzar su instalación despues de cerrar el juego.", + + "gui.launch": "Ejecutar", + "gui.launchvanilla": "Vainilla", + "gui.launchnorthstar": "Northstar", + "gui.installnorthstar": "Instalar", + + "gui.selectpath": "Por favor, ¡elija la ruta del juego!", + "gui.gamepath.must": "La ruta del juego debe establecerse para ejecutar Viper.", + "gui.gamepath.wrong": "Esta carpeta no es una ruta válida para el juego.", + + "viper.menu.main": "Viper", + "viper.menu.release": "Notas de la versión", + "viper.menu.info": "Extras", + "viper.menu.info.links": "Links", + "viper.menu.info.credits": "Creditos", + + "viper.info.discord": "Unete al Discord:", + "viper.info.issues": "Reporta problemas de Viper:", + + "ns.menu.main": "Northstar Launcher", + "ns.menu.mods": "Modificiaciones", + "ns.menu.release": "Notas de actualización", + + "general.mods.enabled": "Modificaciones habilitadas:", + "general.mods.disabled": "Modificaciones deshabilitadas:", + "general.mods.installed": "Modificiaciones intaladas:", + "general.missingpath": "¡La ruta del jueno no se ha podido encontrar automaticamente! ¡Por favor, elige la ruta manualmente!", + "general.notinstalled": "¡Northstar no se ha instalado!", + "general.launching": "Ejecutando" +} -- cgit v1.2.3 From d4315f64255f0cca8999b939ccba0f55e6eece00 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 4 Feb 2022 23:40:15 +0100 Subject: [feat] add french translations to thunderstore-related stuff --- src/lang/fr.json | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lang') diff --git a/src/lang/fr.json b/src/lang/fr.json index 59a3090..2c2fcfc 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -49,6 +49,7 @@ "gui.mods.count": "Mods installés :", "gui.mods.disabledtag": "Désactivé", "gui.mods.install": "Installer le mod", + "gui.mods.find": "Chercher des mods", "gui.mods.toggle": "Activer/désactiver le mod", "gui.mods.toggleall": "Activer/désactiver tous les mods", "gui.mods.remove": "Supprimer le mod", @@ -62,6 +63,12 @@ "gui.mods.installing": "Installation du mod...", "gui.mods.installedmod": "Mod installé !", + "gui.browser.madeby": "par", + "gui.browser.update": "Mise à jour", + "gui.browser.install": "Installer", + "gui.browser.reinstall": "Réinstaller", + "gui.browser.loading": "Chargement des mods...", + "gui.update.downloading": "Téléchargement de la mise à jour...", "gui.update.extracting": "Extraction des fichiers...", "gui.update.finished": "Terminé, vous pouvez jouer !", -- cgit v1.2.3 From 392a46168971eb3a4d578cec2b8ebea533e02747 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sat, 5 Feb 2022 18:47:46 +0100 Subject: implemented limit to loading packages I have no clue if 50 packages is too small or too, big, we'll adjust this the more mods that arrive. I also made the browser auto scroll to the top when closed, it looks far better. --- src/app/browser.js | 8 ++++++++ src/app/main.css | 7 +++++++ src/lang/en.json | 1 + 3 files changed, 16 insertions(+) (limited to 'src/lang') diff --git a/src/app/browser.js b/src/app/browser.js index 6d10bfb..c23f217 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -3,8 +3,10 @@ var fuse; var packages = []; var Browser = { + maxentries: 50, toggle: (state) => { if (state) { + browser.scrollTo(0, 0); overlay.classList.add("shown") browser.classList.add("shown") return @@ -16,6 +18,7 @@ var Browser = { } } + browser.scrollTo(0, 0); overlay.classList.toggle("shown") browser.classList.toggle("shown") }, @@ -31,6 +34,7 @@ var Browser = { } for (let i in packages) { + if (i == Browser.maxentries) {Browser.endoflist();break} new BrowserElFromObj(packages[i]); } }, @@ -43,6 +47,9 @@ var Browser = { browserEntries.innerHTML = `
${lang('gui.browser.loading')}
`; } }, + endoflist: () => { + browserEntries.innerHTML += `
${lang('gui.browser.endoflist')}
` + }, search: (string) => { Browser.loading(); let res = fuse.search(string); @@ -53,6 +60,7 @@ var Browser = { } for (let i = 0; i < res.length; i++) { + if (i == Browser.maxentries) {Browser.endoflist();break} new BrowserElFromObj(res[i].item); } }, diff --git a/src/app/main.css b/src/app/main.css index e48625b..b6a07eb 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -177,6 +177,13 @@ button { height: calc(100% - var(--mischeight) - var(--height)); } +#browser .message { + color: white; + text-align: center; + margin: var(--padding); + width: calc(100% - var(--padding)); +} + #browser .el .image, #browser .el .image img { width: var(--height); height: var(--height); diff --git a/src/lang/en.json b/src/lang/en.json index 59af04b..6bef99f 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -65,6 +65,7 @@ "gui.browser.madeby": "by", "gui.browser.update": "Update", + "gui.browser.endoflist": "Maximum packages has been loaded.
Use the search for finding other packages!", "gui.browser.install": "Install", "gui.browser.reinstall": "Re-Install", "gui.browser.loading": "Loading mods...", -- cgit v1.2.3 From 8b97390a9e35117bd4bc2f9ceb26f090d6a67ee9 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sat, 5 Feb 2022 19:51:20 +0100 Subject: various changes, aesthetic and functionality This should fix the window drag not working, however I cannot test that. As my WM doesn't support it, a Windows contributor will have to test it. I also added an info button that opens the mod's page in your web browser, this button is of course localized, along with that I localized the placeholder in the search input. There's also a few general aesthetic changes, like adding a tiny border around #modsdiv and #browser. --- src/app/browser.js | 2 ++ src/app/index.html | 2 +- src/app/main.css | 10 ++++++++-- src/lang/en.json | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/lang') diff --git a/src/app/browser.js b/src/app/browser.js index 5695661..7b67822 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -100,6 +100,7 @@ function BrowserElFromObj(obj) { title: pkg.name, image: pkg.icon, author: pkg.owner, + url: pkg.package_url, download: pkg.download_url, version: pkg.version_number, description: pkg.description @@ -147,6 +148,7 @@ function BrowserEl(properties) {
${properties.title}
${properties.description}
+ diff --git a/src/app/index.html b/src/app/index.html index c2978bd..b861736 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -16,7 +16,7 @@
- + diff --git a/src/app/main.css b/src/app/main.css index 4f1ddc2..2791488 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -9,7 +9,11 @@ --selbg: rgba(80, 80, 80, 0.5); --redbg: linear-gradient(45deg, var(--red), #FA4343); --bluebg: linear-gradient(45deg, var(--blue), #7380ED); +} +#browser, #modsdiv { + outline: 1px solid #444444; + border: 3px solid var(--bg); } ::-webkit-scrollbar { @@ -73,7 +77,7 @@ button { bottom: var(--spacing); transform: scale(0.98); backdrop-filter: blur(15px); - border-radius: calc(var(--padding) / 2); + border-radius: calc(var(--padding) / 3); transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out; } @@ -556,7 +560,9 @@ code { /* drag control */ -#bgHolder { +#bgHolder, +#overlay.shown + .mainContainer, +#overlay.shown + .gamesContainer { user-select: none; -webkit-app-region: drag; } diff --git a/src/lang/en.json b/src/lang/en.json index 6bef99f..c51c843 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -63,12 +63,14 @@ "gui.mods.installing": "Installing mod...", "gui.mods.installedmod": "Installed mod!", + "gui.browser.info": "Info", "gui.browser.madeby": "by", + "gui.browser.search": "Search...", "gui.browser.update": "Update", - "gui.browser.endoflist": "Maximum packages has been loaded.
Use the search for finding other packages!", "gui.browser.install": "Install", "gui.browser.reinstall": "Re-Install", "gui.browser.loading": "Loading mods...", + "gui.browser.endoflist": "Maximum packages has been loaded.
Use the search for finding other packages!", "gui.update.downloading": "Downloading...", "gui.update.extracting": "Extracting update...", -- cgit v1.2.3 From 738026f6c98231538874c51e24ab4e59df7fcea1 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sat, 5 Feb 2022 22:44:44 +0100 Subject: [feat] add french translations --- src/lang/fr.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lang') diff --git a/src/lang/fr.json b/src/lang/fr.json index 2c2fcfc..f518e05 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -63,11 +63,14 @@ "gui.mods.installing": "Installation du mod...", "gui.mods.installedmod": "Mod installé !", + "gui.browser.info": "Info", "gui.browser.madeby": "par", + "gui.browser.search": "Rechercher", "gui.browser.update": "Mise à jour", "gui.browser.install": "Installer", "gui.browser.reinstall": "Réinstaller", "gui.browser.loading": "Chargement des mods...", + "gui.browser.endoflist": "Fin de la liste de mods.
Utilisez la barre de recherche pour en trouver davantage !", "gui.update.downloading": "Téléchargement de la mise à jour...", "gui.update.extracting": "Extraction des fichiers...", -- cgit v1.2.3 From 592145fe322a17a7667c5b32cad0650eecd953fc Mon Sep 17 00:00:00 2001 From: Delta <31860825+AA-Delta@users.noreply.github.com> Date: Sat, 5 Feb 2022 17:48:52 -0500 Subject: Update es.json --- src/lang/es.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lang') diff --git a/src/lang/es.json b/src/lang/es.json index 770bb5f..5df53c2 100644 --- a/src/lang/es.json +++ b/src/lang/es.json @@ -63,11 +63,14 @@ "gui.mods.installing": "Instalando modificación...", "gui.mods.installedmod": "¡Modificación instalada!", + "gui.browser.info": "Información", "gui.browser.madeby": "por", + "gui.browser.search": "Buscar...", "gui.browser.update": "Actualizar", "gui.browser.install": "Instalar", "gui.browser.reinstall": "Re-Instalar", "gui.browser.loading": "Cargando modificaciones...", + "gui.browser.endoflist": "Se ha cargado el máximo de paquetes.
¡Usa la búsqueda para encontrar otros paquetes!", "gui.update.downloading": "Descargando...", "gui.update.extracting": "Extrayendo actualización...", -- cgit v1.2.3 From 0a317f81def6b4c041cfc340e454a9bc8f0046fb Mon Sep 17 00:00:00 2001 From: 0neGal Date: Tue, 8 Feb 2022 23:22:39 +0100 Subject: added toasts for installation of mods It'll notify of incorrectly formatted mods, it'll also notify on errors and on success. --- src/app/browser.js | 29 +++++++++++++++++++++++++++-- src/app/main.css | 2 +- src/lang/en.json | 7 +++++++ src/utils.js | 10 +++++++--- 4 files changed, 42 insertions(+), 6 deletions(-) (limited to 'src/lang') 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 */ diff --git a/src/lang/en.json b/src/lang/en.json index a9eb47f..27630ec 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -90,6 +90,13 @@ "gui.gamepath.must": "The game path must be set to start Viper.", "gui.gamepath.wrong": "This folder is not a valid game path.", + "gui.toast.title.installed": "Mod installed!", + "gui.toast.title.failed": "Failed to install", + "gui.toast.title.malformed": "Incorrect folder structure!", + "gui.toast.desc.installed": "has been installed successfully!", + "gui.toast.desc.malformed": "has an incorrect folder structure, if you're the developer, you should fix this.", + "gui.toast.desc.failed": "An unknown error occurred while trying to install the mod. This may be the author's fault, and it may also be Viper's fault.", + "viper.menu.main": "Viper", "viper.menu.release": "Release Notes", "viper.menu.info": "Extras", diff --git a/src/utils.js b/src/utils.js index b825309..7a1e333 100644 --- a/src/utils.js +++ b/src/utils.js @@ -450,7 +450,7 @@ const mods = { // Either a zip or folder is supported, we'll also try to search // inside the zip or folder to see if buried in another folder or // not, as sometimes that's the case. - install: (mod, destname, manifestfile) => { + install: (mod, destname, manifestfile, malformed = false) => { let modname = mod.replace(/^.*(\\|\/|\:)/, ""); if (getNSVersion() == "unknown") { @@ -481,7 +481,10 @@ const mods = { } } - ipcMain.emit("installedmod", "", modname); + ipcMain.emit("installedmod", "", { + name: modname, + malformed: malformed, + }); ipcMain.emit("guigetmods"); return true; } @@ -539,7 +542,7 @@ const mods = { files = fs.readdirSync(path.join(cache, "mods")); if (fs.existsSync(path.join(cache, "mods/mod.json"))) { - if (mods.install(path.join(cache, "mods"), require(manifest).name, manifest)) { + if (mods.install(path.join(cache, "mods"), require(manifest).name, manifest, true)) { return true; } } else { @@ -553,6 +556,7 @@ const mods = { } } + ipcMain.emit("failedmod", "", modname); return notamod(); } -- cgit v1.2.3 From 7be6ddc614774d86c87782c3b28ad5a3816650fe Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 8 Feb 2022 23:56:41 +0100 Subject: [feat] add missing French translations --- src/lang/fr.json | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lang') diff --git a/src/lang/fr.json b/src/lang/fr.json index 4e6103a..3bdeec6 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -90,6 +90,13 @@ "gui.gamepath.must": "Vous devez sélectionner le chemin du dossier du jeu Titanfall 2 pour pouvoir lancer Viper.", "gui.gamepath.wrong": "Ce dossier ne contient pas le jeu Titanfall 2, et n'est donc pas valide.", + "gui.toast.title.installed": "Mod installé !", + "gui.toast.title.failed": "L'installation a échoué", + "gui.toast.title.malformed": "La structure du dossier du mod est incorrecte.", + "gui.toast.desc.installed": "a été installé avec succès !", + "gui.toast.desc.malformed": "a une structure de dossier incorrecte ; si vous êtes son développeur, vous devriez réparer ça.", + "gui.toast.desc.failed": "Une erreur inconnue est survenue lors de l'installation du mod. Cela peut être du ressort de l'auteur du mod ou de Viper.", + "viper.menu.main": "Viper", "viper.menu.release": "Notes de mises à jour", "viper.menu.info": "Informations", -- cgit v1.2.3 From f2a05d99cf63dc7c967eaa984a1ddcc5ad89426b Mon Sep 17 00:00:00 2001 From: Delta <31860825+AA-Delta@users.noreply.github.com> Date: Tue, 8 Feb 2022 18:04:42 -0500 Subject: Updated localization for toast notifications #69 --- src/lang/es.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/lang') diff --git a/src/lang/es.json b/src/lang/es.json index 9eac2b0..8beabef 100644 --- a/src/lang/es.json +++ b/src/lang/es.json @@ -88,7 +88,14 @@ "gui.selectpath": "Por favor, ¡elija la ruta del juego!", "gui.gamepath.must": "La ruta del juego debe establecerse para ejecutar Viper.", - "gui.gamepath.wrong": "Esta carpeta no es una ruta válida para el juego.", + "gui.gamepath.wrong": "Esta carpeta no es una ruta válida para el juego.", + + "gui.toast.title.installed": "¡Modificación instalada!", + "gui.toast.title.failed": "¡Falló al instalar!", + "gui.toast.title.malformed": "¡Estructura de las carpetas incorrecta!", + "gui.toast.desc.installed": "¡Ha sido instalado exitosamente!", + "gui.toast.desc.malformed": "tiene una estructura de carpetas incorrecta, si usted es el desarrollador, debe corregir esto.", + "gui.toast.desc.failed": "Se produjo un error desconocido al intentar instalar la modificación. Esto puede ser culpa del autor de la modificación, y también puede ser culpa de Viper.", "viper.menu.main": "Viper", "viper.menu.release": "Notas de la versión", @@ -109,4 +116,4 @@ "general.missingpath": "¡La ruta del jueno no se ha podido encontrar automaticamente! ¡Por favor, elige la ruta manualmente!", "general.notinstalled": "¡Northstar no se ha instalado!", "general.launching": "Ejecutando" -} \ No newline at end of file +} -- cgit v1.2.3