-fixed languages not selectable when wiiflow folder is on ntfs (issue 171)

-better way to get wii game installation back to work
This commit is contained in:
fix94.1 2013-02-22 21:18:34 +00:00
parent 689833db39
commit f96d478fcb
5 changed files with 8 additions and 11 deletions

View File

@ -215,7 +215,6 @@ s32 WBFS_Init(wbfs_t * handle, u32 part_fs, u32 part_idx, u32 part_lba, const ch
hdd = handle;
wbfsDev = strncasecmp(partition, "sd", 2) == 0 ? WBFS_DEVICE_SDHC : WBFS_DEVICE_USB;
strcpy(wbfs_fs_drive, partition);
strcat(wbfs_fs_drive, ":");
wbfs_part_fs = part_fs;
wbfs_part_lba = part_lba;

View File

@ -29,7 +29,6 @@
#define TITLE_LEN 64
char wbfs_drive_tmp[16];
char wbfs_fs_drive[16];
char invalid_path[] = "/\\:|<>?*\"'";
@ -102,7 +101,7 @@ s32 WBFS_Ext_DiskSpace(f32 *used, f32 *free)
// statvfs is slow, so cache values
if (!wbfs_ext_vfs_have || wbfs_ext_vfs_lba != (s32)wbfs_part_lba || wbfs_ext_vfs_dev != wbfsDev )
{
if(statvfs(wbfs_fs_drive, &wbfs_ext_vfs))
if(statvfs(fmt("%s:", wbfs_fs_drive), &wbfs_ext_vfs))
return 0;
wbfs_ext_vfs_have = 1;
@ -187,8 +186,7 @@ s32 WBFS_Ext_AddGame(progress_callback_t spinner, void *spinner_data)
asprintf(&cleantitle, header.title);
for(cp = strpbrk(cleantitle, illegal); cp; cp = strpbrk(cp, illegal))
*cp = '_';
strncpy(wbfs_drive_tmp, wbfs_fs_drive, strlen(wbfs_fs_drive) - 1);
strncpy(folder, fmt(wii_games_dir, wbfs_drive_tmp), sizeof(folder));
strncpy(folder, fmt(wii_games_dir, wbfs_fs_drive), sizeof(folder));
fsop_MakeFolder(folder);
strncpy(folder, fmt("%s/%s [%s]", folder, cleantitle, header.id), sizeof(folder));
fsop_MakeFolder(folder);

View File

@ -419,11 +419,11 @@ void CMenu::init()
defaultMenuLanguage = 2; //Brazilian
m_curLanguage = CMenu::_translations[m_cfg.getInt("GENERAL", "language", defaultMenuLanguage)];
if (!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())))
if (!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str())))
{
m_cfg.setInt("GENERAL", "language", 0);
m_curLanguage = CMenu::_translations[0];
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()));
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str()));
}
m_tempView = false;

View File

@ -111,7 +111,7 @@ void CMenu::_textAbout(void)
{
m_btnMgr.setText(m_aboutLblTitle, _t("about10", L"Help Guide"));
wstringEx help_text;
FILE *f = fopen(fmt("%s/%s.txt", m_helpDir.c_str(), m_curLanguage.c_str()), "r");
FILE *f = fopen(fmt("%s/%s.txt", m_helpDir.c_str(), lowerCase(m_curLanguage).c_str()), "r");
if(f)
{
fseek(f, 0, SEEK_END);

View File

@ -136,7 +136,7 @@ int CMenu::_configAdv(void)
s8 direction = m_btnMgr.selected(m_configAdvBtnCurLanguageP) ? 1 : -1;
int lang = (int)loopNum((u32)m_cfg.getInt("GENERAL", "language", 0) + direction, ARRAY_SIZE(CMenu::_translations));
m_curLanguage = CMenu::_translations[lang];
if (m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())))
if (m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str())))
{
m_cfg.setInt("GENERAL", "language", lang);
lang_changed = true;
@ -148,13 +148,13 @@ int CMenu::_configAdv(void)
lang = (int)loopNum((u32)lang + direction, ARRAY_SIZE(CMenu::_translations));
m_curLanguage = CMenu::_translations[lang];
struct stat langs;
if (stat(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()), &langs) == 0)
if (stat(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str()), &langs) == 0)
break;
}
m_cfg.setInt("GENERAL", "language", lang);
lang_changed = true;
m_curLanguage = CMenu::_translations[lang];
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()));
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str()));
}
_updateText();
_showConfigAdv();