Skip to content

Commit

Permalink
Merge branch 'main' into packages-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
0neGal authored Jul 24, 2023
2 parents 5cf79aa + 1126109 commit 4e870f4
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 59 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,27 @@ Currently Viper is capable of:
* Auto-Update itself
* Be pretty!

Besides this I've been considering adding some easy to use VPK modding tools so everybody can have fun with VPK modding even if you don't know how to do it the traditional way. However that is not at the top of the todo list right now.
There are of course many other things that it can do, but summed up very simply, that is what Viper is capable of doing. With every update Viper gets more features and alike, often many optional features are also available in the settings menu.

</p>

## Configuration

All settings take place in the settings page, found in the top right corner of the app, where you can disable auto-updates, and other related settings. You can also manually go in and edit your config file (`viper.json`), if you feel so inclined.
All settings take place in the settings page, found in the top right corner of the app, where you can change all kinds of settings. You can also manually go in and edit your config file (`viper.json`), if you feel so inclined.

Your configuration file will be found in `%APPDATA%\viper.json` on Windows, and inside either `~/.config` or through your environment variables (`$XDG_CONFIG_HOME`) on Linux, the latter has priority.

## Contact/Support

To get support either open a GitHub issue.<br>
Or if you must you can contact a developer through the methods below:
## Support

Ways to contact the main developer: [0neGal](https://github.com/0neGal)
* Twitter: [@0neGal](https://twitter.com/0neGal)
* Reddit: [/u/0neGal](https://reddit.com/u/0neGal)
To get support please [open a GitHub issue](https://github.com/0neGal/viper/issues/new/choose), and clearly describe the problem with as many details as possible.

### Frequently Asked Questions (FAQ)

Many of the questions and problems you may have might be able to be answered by reading the [FAQ page](FAQ.md). So before opening an issue or asking for support please read through it first!

## Sidenote

Given that we already have so many Northstar updaters and launchers I urge people to instead of creating new launchers unless there's a very specific reason, just make a pull request on one of the existing, otherwise we'll continue to have new ones.
Given that we already have so many Northstar updaters and launchers I urge people to instead of creating new launchers unless there's a very specific reason, just make a pull request on one of the existing ones, otherwise we'll continue to have new ones.

<p align="center">
Relevant xkcd:<br>
Expand All @@ -79,7 +75,7 @@ Some of the existing launchers are listed below:

## Development

If you wanna edit Viper's code and run it and so on, you can simply do something along the lines of the below:
If you wanna edit Viper's code, run it, and so on, you can simply do something along the lines of the below:

```sh
$ git clone https://github.com/0neGal/viper
Expand All @@ -99,7 +95,7 @@ Additionally, if you're creating your own fork you easily publish builds and or
$ GH_TOKEN="<your very long, private and wonderful token>" npm run publish
```

Keep in mind building all Linux builds may take a while on some systems as packaging the `tar.gz` release can take a while on many CPU's, at least from my testing. All other builds should be done quickly. When using the `publish` command it also automatically uploads the needed files to deploy auto-updates, keep in mind you'd need to have the `repository` setting changed to your new fork's location, otherwise it'll fetch from the original.
Keep in mind building all Linux builds may take a while on some systems, as packaging the `tar.gz` release can take a while on many CPUs, at least from my testing. All other builds should be done quickly. When using the `publish` command it also automatically uploads the needed files to deploy auto-updates, keep in mind you'd need to have the `repository` setting changed to your new fork's location, otherwise it'll fetch from the original.

## Credits

Expand Down
5 changes: 5 additions & 0 deletions src/app/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
transform: scale(0.9);
}

.gamesContainer button.inactive:hover {
transform: scale(0.95);
filter: brightness(120%);
}

.gamesContainer button::before {
content: "";
display: block;
Expand Down
4 changes: 4 additions & 0 deletions src/app/css/webview.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ body {
background-color: transparent !important;
}

.footer,
#ncmp_tool,
.bottom-ads,
.ncmp__banner,
#get-app-alert,
.navbar, .bottom-padding,
.card-header, .breadcrumb,
.list-group, .mb-4, .my-2, .mt-2,
Expand Down
1 change: 1 addition & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const events = new Emitter();
const cli = app.commandLine;
const lang = require("./lang");
const json = require("./modules/json");
console = require("./modules/console");

function hasArgs() {
// Makes sure the GUI isn't launched.
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const requests = require("./modules/requests");
const packages = require("./modules/packages");
const is_running = require("./modules/is_running");


console = require("./modules/console");
var log = console.log;

// Starts the actual BrowserWindow, which is only run when using the
Expand Down
11 changes: 10 additions & 1 deletion src/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,14 @@
"general.invalidconfig": "Deine Konfigurationsdatei ist nicht richtig formatiert, falls diese manuell verändert wurde bitte stelle sicher das alles korrekt ist.\n\nFalls du diese nicht manuell verändert hast, ist es empfohlen diese zurückzusetzen!\n\nUm sie zurückzusetzen drücke einfach auf \"Ok\".\n\nWeitere Informationen:\n",

"request.viper.noReleaseNotes": "Viper Release Notes konnten nicht geladen werden.\nVersuche es erneut später!",
"request.northstar.noReleaseNotes": "Northstar Release Notes konnten nicht geladen werden.\nVersuche es erneut später!"
"request.northstar.noReleaseNotes": "Northstar Release Notes konnten nicht geladen werden.\nVersuche es erneut später!",

"general.running": "Läuft bereits.",

"tooltip.close": "Schließen",
"tooltip.minimize": "Minimieren",
"tooltip.settings": "Einstellungen",
"tooltip.pages.viper": "Viper",
"tooltip.pages.northstar": "Northstar",
"tooltip.pages.titanfall": "Titanfall 2"
}
6 changes: 3 additions & 3 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@
"request.viper.noReleaseNotes": "Couldn't fetch Viper release notes.\nTry again later!",
"request.northstar.noReleaseNotes": "Couldn't fetch Northstar release notes.\nTry again later!",

"tooltip.close": "Closes Viper",
"tooltip.minimize": "Minimizes the window",
"tooltip.settings": "Opens the settings popup",
"tooltip.close": "Close Viper",
"tooltip.minimize": "Minimize Viper",
"tooltip.settings": "Settings",
"tooltip.pages.viper": "Viper",
"tooltip.pages.northstar": "Northstar",
"tooltip.pages.titanfall": "Titanfall 2"
Expand Down
31 changes: 20 additions & 11 deletions src/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"lang.title": "Spanish - Español",

"cli.help.help": "muestra este mensaje de ayuda",
"cli.help.devtools": "habre las herramientas de desarrollador/depuración ",
"cli.help.devtools": "abre 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",
Expand All @@ -15,7 +15,7 @@

"cli.setpath.noarg": "No se ha proporcionado ningún argumento para --setpath",

"cli.gamepath.lost": "El directorio del juego no fue encontrado, ¡asegúrate de que esté montado!",
"cli.gamepath.lost": "El directorio del juego no fue encontrado, ¡asegúrate de que esté disponible!",

"cli.update.current": "Versión actual:",
"cli.update.downloading": "Descargando...",
Expand All @@ -39,7 +39,7 @@
"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.toggledall": "¡El estado de todas las modifiaciones ha sido cambiado exitosamente!",
"cli.mods.improperjson": "%s's mod.json tiene errores de formato",

"gui.welcome": "Bienvenido a Viper!",
Expand All @@ -54,8 +54,8 @@
"gui.mods.count": "Modificaciones instaladas:",
"gui.mods.disabledtag": "Deshabilitado",
"gui.mods.install": "Instalar modificación",
"gui.mods.find": "Encontrar modificaciones",
"gui.mods.toggleall": "Alternar todo",
"gui.mods.find": "Buscar modificaciones",
"gui.mods.toggleall": "Activar / Desactivar todo",
"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?",
Expand All @@ -73,7 +73,7 @@
"gui.mods.confirm_plugins_description": "Los complementos nativos tienen mucho más acceso al sistema que un mod regular y, por lo tanto, son inherentemente menos seguros de instalar, ya que un complemento malicioso podría causar mucho más daño de esta manera. Si este complemento es de un desarrollador confiable o similar o si sabe lo que está haciendo, entonces puede ignorar completamente este mensaje.",

"gui.browser.info": "Información",
"gui.browser.madeby": "por",
"gui.browser.madeby": "hecho por",
"gui.browser.search": "Buscar...",
"gui.browser.update": "Actualizar",
"gui.browser.install": "Instalar",
Expand Down Expand Up @@ -142,7 +142,7 @@
"gui.server.player": "jugador",
"gui.server.players": "jugadores",
"gui.server.servers": "servidores",
"gui.server.offline": "El servidor Master está desconectado",
"gui.server.offline": "El servidor principal está desconectado",

"gui.toast.noInternet.title": "Sin Internet",
"gui.toast.noInternet.desc": "Viper puede funcionar de forma incorrecta.",
Expand All @@ -157,18 +157,27 @@
"viper.info.issues": "Reporta problemas de Viper:",

"ns.menu.main": "Northstar Launcher",
"ns.menu.mods": "Modificiaciones",
"ns.menu.mods": "Modificaciones",
"ns.menu.release": "Notas de actualización",

"general.autoupdates.gamerunning": "El juego se está ejecutando, no se puede actualizar Northstar",
"general.autoupdates.gamerunning": "El juego está en ejecución, no se puede actualizar Northstar",
"general.mods.enabled": "Modificaciones habilitadas:",
"general.mods.disabled": "Modificaciones deshabilitadas:",
"general.mods.installed": "Modificiaciones intaladas:",
"general.mods.installed": "Modificiaciones instaladas:",
"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",
"general.invalidconfig": "Su archivo de configuración está formateado de forma incorrecta, si ha sido editado manualmente, por favor valide que ha sido escrito correctamente. \n\nSi no ha editado manualmente el archivo de configuración, es recomendado que simplemente restaure la configuración. \n\nPara restaurar tu configuración simplemente de click en \"OK\" a continuación. \n\nMas detalles:\n",

"request.viper.noReleaseNotes": "No se pudo encontrar las notas de lanzamiento de Viper.\n¡Intenta mas tarde!",
"request.northstar.noReleaseNotes": "No se pudo encontrar las notas de lanzamiento de Northstar.\n¡Intenta mas tarde!"
"request.northstar.noReleaseNotes": "No se pudo encontrar las notas de lanzamiento de Northstar.\n¡Intenta mas tarde!",

"general.running": "Ejecutandose",

"tooltip.close": "Cerrar Viper",
"tooltip.minimize": "Minimizar Viper",
"tooltip.settings": "Configuraciones",
"tooltip.pages.viper": "Viper",
"tooltip.pages.northstar": "Northstar",
"tooltip.pages.titanfall": "Titanfall 2"
}
11 changes: 10 additions & 1 deletion src/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,14 @@
"general.invalidconfig": "Votre fichier de configuration n'est pas formaté correctement ; si vous l'avez manuellement édité, veuillez vérifier son contenu.\n\nSinon, il est recommandé de remettre la configuration à zéro.\n\nPour cela, cliquez sur le bouton \"Ok\" en-dessous de ce message.\n\nPlus d'informations :\n",

"request.viper.noReleaseNotes": "Impossible de récupérer les notes de mises à jour de Viper.\nVeuillez réessayer plus tard.",
"request.northstar.noReleaseNotes": "Impossible de récupérer les notes de mises à jour de Northstar.\nVeuillez réessayer plus tard."
"request.northstar.noReleaseNotes": "Impossible de récupérer les notes de mises à jour de Northstar.\nVeuillez réessayer plus tard.",

"general.running": "En cours d'exécution",

"tooltip.close": "Fermer Viper",
"tooltip.minimize": "Réduire Viper",
"tooltip.settings": "Paramètres",
"tooltip.pages.viper": "Viper",
"tooltip.pages.northstar": "Northstar",
"tooltip.pages.titanfall": "Titanfall 2"
}
27 changes: 27 additions & 0 deletions src/modules/console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
let new_console = {
...console
}

let orig_console = console;

new_console.ok = (...args) => {
orig_console.log('\x1b[92m%s\x1b[0m', ...args)
}

new_console.misc = (...args) => {
orig_console.warn('\x1b[90m%s\x1b[0m', ...args)
}

new_console.info = (...args) => {
orig_console.warn('\x1b[94m%s\x1b[0m', ...args)
}

new_console.warn = (...args) => {
orig_console.warn('\x1b[93m%s\x1b[0m', ...args)
}

new_console.error = (...args) => {
orig_console.error('\x1b[91m%s\x1b[0m', ...args)
}

module.exports = new_console;
8 changes: 5 additions & 3 deletions src/modules/findgame.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const { app } = require("electron");
const util = require("util");
const exec = util.promisify(require("child_process").exec);

console = require("./console");

module.exports = async () => {
let gamepath = "";

Expand Down Expand Up @@ -40,10 +42,10 @@ module.exports = async () => {
let data_array = Object.values(values[i]);

if (fs.existsSync(data_array[0] + "/steamapps/common/Titanfall2/Titanfall2.exe")) {
console.log("Found game in:", data_array[0]);
console.ok("Found game in:", data_array[0]);
return data_array[0] + "/steamapps/common/Titanfall2";
} else {
console.log("Game not in:", data_array[0]);
console.error("Game not in:", data_array[0]);
}
}
}
Expand All @@ -70,7 +72,7 @@ module.exports = async () => {
// searches VDF files
for (let i = 0; i < vdf_files.length; i++) {
if (! fs.existsSync(vdf_files[i])) {continue}
console.log("Searching VDF file at:", vdf_files[i]);
console.info("Searching VDF file at:", vdf_files[i]);

let data = fs.readFileSync(vdf_files[i]);
let read_vdf = readvdf(data.toString());
Expand Down
6 changes: 4 additions & 2 deletions src/modules/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const lang = require("../lang");
const win = require("./window");
const settings = require("./settings");

console = require("./console");

// launches the game
//
// either Northstar or Vanilla. Linux support is not currently a thing,
Expand All @@ -25,11 +27,11 @@ function launch(game_version) {
// launch the requested game version
switch(game_version) {
case "vanilla":
console.log(lang("general.launching"), "Vanilla...");
console.info(lang("general.launching"), "Vanilla...");
exec("Titanfall2.exe", {cwd: settings.gamepath});
break;
default:
console.log(lang("general.launching"), "Northstar...");
console.info(lang("general.launching"), "Northstar...");
exec("NorthstarLauncher.exe", {cwd: settings.gamepath});
break;
}
Expand Down
Loading

0 comments on commit 4e870f4

Please sign in to comment.