Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/android/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
cd /vanilla/android
cd ../../android
./gradlew -PbuildDir=/build assembleRelease
zipalign -v -p 4 /build/outputs/apk/release/app-release-unsigned.apk /build/outputs/apk/release/app-release-unsigned-aligned.apk
apksigner sign --ks /vanilla/docker/android/vanilla.jks --out /install/app-release.apk --ks-pass pass:$ANDROID_SIGNING_KEY /build/outputs/apk/release/app-release-unsigned-aligned.apk
Binary file modified gui/assets/font/system.ttf
Binary file not shown.
Binary file added gui/assets/font/system_a.ttf
Binary file not shown.
93 changes: 38 additions & 55 deletions gui/lang.c
Original file line number Diff line number Diff line change
@@ -1,60 +1,43 @@
#include <string.h>
#include "lang.h"

static const char *lang_str[__VPI_LANG_T_COUNT] = {
"Sync",
"Connect",
"Edit",
"Settings",
"OK",
"Cancel",
"Touch the symbols in the order they are displayed on the TV screen from left to right.",
"If the symbols are not displayed on the TV screen, press the SYNC Button on the Wii U console.",
"Connecting to the Wii U console...",
"Sync Failed",
"Vanilla needs root permission to configure the wireless interface for connection.",
"Please enter your \"sudo\" password here.",
"Error",
"No consoles synced",
"Connecting to \"%s\"...",
"Are you sure you want to delete \"%s\"?",
"Successfully deleted \"%s\"",
"Rename",
"Delete",
"Back",
"More",
"Controls",
"Audio",
"Connection",
"Webcam",
"Region",
"Local",
"Via Server",
"Set up how Vanilla connects to the Wii U",
"Choose 'Local' to connect directly with the hardware on your system. Otherwise, you may need a compatible 'server' to relay the necessary packets.",
"Select the wireless interface to use for the connection.",
"Enter the IP address of the server you wish to connect through.",
"Screenshot saved to \"%s\"",
"Recording started to \"%s\"",
"Recording finished",
"Connection lost, attempting to re-connect...",
"Your platform is not capable of \"Local\" connection, and must connect via a server.",
"Failed to save screenshot (%i)",
"Select gamepad region",
"Gamepad region must match the console region or else the console will throw an error. This has no other effect on usage.",
"Japan",
"America",
"Europe",
"Quit",
"Authentication failed. Please try again.",
"Don't ask again",
"WARNING",
"This option will install a Polkit rule that will allow Vanilla's backend to run as root without password entry.\n\nThere are inherent risks to bypassing security systems. Only enable this if you are willing to accept those risks.\n\nNOTE: If you are using the Steam Deck, this will also disable read-only access to your system partition.",
"I acknowledge",
"Enable Root Password Skip",
"Disable Root Password Skip",
"Swap AB/XY buttons",
"Full Screen",
#include "langs/english_en/english_en.h"
#include "langs/french_fr/french_fr.h"
static char *langs_order[2] = {
"en",
"fr",
};
static const int lang_c = sizeof(langs_order) / sizeof(langs_order[0]);
static const char *lang_str[__VPI_LANG_T_COUNT];
char lang_history[3];

int lang_choice(char *curr_lang){
if (strcmp(curr_lang, "en") == 0) {
memcpy(lang_str, lang_str_en, sizeof(lang_str));
}
else if (strcmp(curr_lang, "fr") == 0) {
memcpy(lang_str, lang_str_fr, sizeof(lang_str));
}
else {
return 0;
}
memcpy(lang_history, curr_lang, sizeof(lang_history));
return 1;
}

char *switch_lang(const char *curr_lang){
for(int i = 0; i < lang_c; i++){
if(strcmp(langs_order[i], curr_lang) == 0) {
int next = (i + 1) % lang_c;
lang_choice(langs_order[next]);
return langs_order[next];
}
}
return NULL;
}

const char *get_lang(){
return lang_history;
}

const char *lang(vpi_lang_t id)
{
Expand Down
4 changes: 4 additions & 0 deletions gui/lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ typedef enum {
VPI_LANG_DISABLE_PASSWORD_SKIP,
VPI_LANG_SWAP_ABXY_BUTTONS,
VPI_LANG_FULLSCREEN,
VPI_LANG_LANG_CHOICE,
__VPI_LANG_T_COUNT
} vpi_lang_t;

int lang_choice(char *curr_lang);
char *switch_lang(const char *curr_lang);
const char *lang(vpi_lang_t id);
const char *get_lang();

#endif // VANILLA_PI_LANG_H
63 changes: 63 additions & 0 deletions gui/langs/english_en/english_en.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#ifndef ENGLISH_EN_H
#define ENGLISH_EN_H

#include "lang.h"

static const char *lang_str_en[__VPI_LANG_T_COUNT] = {
"Sync",
"Connect",
"Edit",
"Settings",
"OK",
"Cancel",
"Touch the symbols in the order they are displayed on the TV screen from left to right.",
"If the symbols are not displayed on the TV screen, press the SYNC Button on the Wii U console.",
"Connecting to the Wii U console...",
"Sync Failed",
"Vanilla needs root permission to configure the wireless interface for connection.",
"Please enter your \"sudo\" password here.",
"Error",
"No consoles synced",
"Connecting to \"%s\"...",
"Are you sure you want to delete \"%s\"?",
"Successfully deleted \"%s\"",
"Rename",
"Delete",
"Back",
"More",
"Controls",
"Audio",
"Connection",
"Webcam",
"Region",
"Local",
"Via Server",
"Set up how Vanilla connects to the Wii U",
"Choose 'Local' to connect directly with the hardware on your system. Otherwise, you may need a compatible 'server' to relay the necessary packets.",
"Select the wireless interface to use for the connection.",
"Enter the IP address of the server you wish to connect through.",
"Screenshot saved to \"%s\"",
"Recording started to \"%s\"",
"Recording finished",
"Connection lost, attempting to re-connect...",
"Your platform is not capable of \"Local\" connection, and must connect via a server.",
"Failed to save screenshot (%i)",
"Select gamepad region",
"Gamepad region must match the console region or else the console will throw an error. This has no other effect on usage.",
"Japan",
"America",
"Europe",
"Quit",
"Authentication failed. Please try again.",
"Don't ask again",
"WARNING",
"This option will install a Polkit rule that will allow Vanilla's backend to run as root without password entry.\n\nThere are inherent risks to bypassing security systems. Only enable this if you are willing to accept those risks.\n\nNOTE: If you are using the Steam Deck, this will also disable read-only access to your system partition.",
"I acknowledge",
"Enable Root Password Skip",
"Disable Root Password Skip",
"Swap AB/XY buttons",
"Full Screen",
"Language: English",
};

#endif
63 changes: 63 additions & 0 deletions gui/langs/french_fr/french_fr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#ifndef FRENCH_FR_H
#define FRENCH_FR_H

#include "lang.h"

static const char *lang_str_fr[__VPI_LANG_T_COUNT] = {
"Synchroniser",
"Connecte",
"Modifier",
"Paramétres",
"OK",
"Annuler",
"Cliquez sur les symboles dans l'ordre affiché dans l'écran TV de gauche à droite.",
"Si les symboles ne sont pas affichés dans l'écran TV, appuyez sur le bouton SYNC sur la console Wii U.",
"Connexion à la console Wii U...",
"Synchronisation échouée",
"Vanilla a besoin de la permission root pour configurer l'interface sans fils pour la connexion.",
"Entrez votre \"sudo\" mot de passe ici.",
"Erreur",
"Aucune consoles synchronisée",
"Connexion à \"%s\" en cours...",
"Êtes-vous sûre que vous voulez supprimer \"%s\"?",
"\"%s\" Supprimé avec Succès",
"Renommer",
"Supprimer",
"Retour",
"Plus",
"Controlles",
"Audio",
"Connexion",
"Caméra",
"Région",
"Local",
"Via Serveur",
"Mettre en place comment Vanilla se connecte à la Wii U",
"Choisissez 'Local' pour vous connecter directement avec la matériel sur votre système. Sinon, vous aurez peut-être besoin d'un serveur compatible pour relayer les paquets nécessaires.",
"Choisissez l'interface sans fil à utiliser pour la connexion.",
"Entrez l'adresse IP du serveur auquel vous voulez vous connecter",
"Capture d'écran enregistrée à \"%s\"",
"L'enregistrement a commencé à \"%s\"",
"Enregistrement terminé",
"Connexion perdu, tenter de re-connecter...",
"Votre plateforme n'est pas capable de \"Local\" connexion, et doit être connectée via un serveur.",
"Impossible d'enregistrer la capture d'écran (%i)",
"Choisissez la région du gamepad",
"La région du gamepad doit être la même que celle de la console ,sinon la console donnera une erreur. Ça n'a pas d'autre effet sur l'usage.",
"Japan",
"Amérique",
"Europe",
"Quitter",
"L'authentification a échoué. Veuillez réessayer.",
"Ne pas demander encore",
"AVERTISSEMENT",
"Cette option va installer une règle Polkit qui va permettre au backend de Vanilla d'éxecuter en root sans entrée de mot de passe.\n\nIl n'y a pas de risques inhérents de contourner les systèmes de sécurité. Activez cette option si vous acceptez cez risques.\n\nNOTE: Si vous utilisez le Steam Deck, ça va aussi déactiver read-only access de votre partition système.",
"Je comprend",
"Activer le Skip de Mot de Passe Root",
"Désactiver le Skip du Mot de Passe Root",
"Inverser les boutons AB/XY",
"Plein Écran",
"Language: Français"
};

#endif
24 changes: 20 additions & 4 deletions gui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "platform.h"
#include "ui/ui.h"
#include "ui/ui_sdl.h"
#include "lang.h"
char curr_lang[3] = "en";

#define SCREEN_WIDTH 854
#define SCREEN_HEIGHT 480
Expand Down Expand Up @@ -34,14 +36,27 @@ int SDL_main(int argc, const char **argv)
} else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
display_cli_help(argv);
return 0;
}
} else if (!strcmp(argv[i], "--lang")){
if (!((i + 1) < argc)) {
vpilog("Error: No language specified!\n");
display_cli_help(argv);
return 1;
}
consumed = 2;
strcpy(curr_lang, argv[i+1]);
}
if (consumed <= 0) {
vpilog("Invalid argument(s): %s\n\n", argv[i]);
display_cli_help(argv);
return 1;
}
}

if (!lang_choice(curr_lang)) {
vpilog("Invalid language: %s\n\n", curr_lang);
return 1;
}

vanilla_install_logger(vpilog_va);

// Load config
Expand Down Expand Up @@ -90,7 +105,8 @@ int SDL_main(int argc, const char **argv)
void display_cli_help(const char **argv) {
vpilog("Usage: %s [options]\n\n", argv[0]);
vpilog("Options:\n");
vpilog(" -w, --window Run Vanilla in a window (overrides config)\n");
vpilog(" -f, --fullscreen Run Vanilla full screen (overrides config)\n");
vpilog(" -h, --help Show this help message\n");
vpilog(" -w --window Run Vanilla in a window (overrides config)\n");
vpilog(" -f --fullscreen Run Vanilla full screen (overrides config)\n");
vpilog(" -h --help Show this help message\n");
vpilog(" --lang <code> Override the default language\n");
}
12 changes: 10 additions & 2 deletions gui/menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
#include "menu_common.h"
#include "menu_game.h"
#include "menu_main.h"
#include "menu_settings.h"
#include "platform.h"

#include "ui/ui_anim.h"

void vpi_mic_callback(void *userdata, const uint8_t *data, size_t len)
{
vanilla_send_audio(data, len);
Expand Down Expand Up @@ -66,8 +69,13 @@ void vpi_menu_action(vui_context_t *vui, vpi_extra_action_t action)
// Send shutdown signal
vpi_game_shutdown();
} else {
// Quit Vanilla entirely
vpi_menu_quit_vanilla(vui);
// Quit Vanilla entirely or go back to menu
if(IsSettings == 1){
vui_transition_fade_layer_out(vui, 0, vpi_menu_main, (void *) (intptr_t) 1);
}
else{
vpi_menu_quit_vanilla(vui);
}
}
break;
}
Expand Down
1 change: 1 addition & 0 deletions gui/menu/menu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,5 @@ void vpi_menu_main(vui_context_t *vui, void *v)
} else {
vui_transition_fade_layer_in(vui, layer, NULL, NULL);
}
IsSettings = 0;
}
Loading