I've been working with VLF lib for a long time, and i have a lot of experience with it. I am creating an interface for a new homebrew of mine...
This is the first time that I create a mult-lang HB, then, i decided to use RCO importing, which is working like a charm...
But today, I remembered to create the error handler in case of not finding my custom RCO...
Then, I wrote this down:
Code: Select all
#include <psputility.h>
Code: Select all
int lang;
lang = vlfGuiGetLanguage();
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_JAPANESE))
{
resources_error = "Unable to load resources!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH))
{
resources_error = "Unable to load resources!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_FRENCH))
{
resources_error = "Impossible de charger des ressources!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_SPANISH))
{
resources_error = "No se puede cargar los recursos!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_GERMAN))
{
resources_error = "Nicht in der Lage, Ressourcen zu laden!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_ITALIAN))
{
resources_error = "Impossibile caricare le risorse!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_DUTCH))
{
resources_error = "Kan middelen laden!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE))
{
resources_error = "Nao e possível carregar os recursos!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN))
{
resources_error = "Unable to load resources!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_KOREAN))
{
resources_error = "Unable to load resources!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_CHINESE_TRADITIONAL))
{
resources_error = "Unable to load resources!";
resource_error_handler();
}
else {
if ((lang = PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED))
{
resources_error = "Unable to load resources!";
resource_error_handler();
}
}}}}}}}}}}}
Code: Select all
int resource_error_handler()
{
int err;
err = vlfGuiMessageDialog(resources_error, VLF_MD_TYPE_ERROR | VLF_MD_BUTTONS_NONE);
if ((err = VLF_MD_BACK))
{
sceKernelExitGame();
}
return 0;
}
As soon as the documents of the VLF Lib tells that vlfGuiGetLanguage(); must return the language...
But, for some strange reason, it is choosing the 2nd option all the time! No matter of what language it is, it does not identifies the PSP language and uses the message writen in the second option...
The only way to avoid this is giving an invalid lang ID as 1st option, in this case this option is choosed by the system...
Is anything wrong with my code?
Is anything wrong with the VLF lib?
Is there any solution/workaround?
PS: Tested in PSP 3000 with GEN-C (which also gives me that annoying "black-waves" bug...)