mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-27 21:54:15 +01:00
-updated the file explorer filetype handling, you can now boot ".elf" and ".dol" files and read text files with the extensions ".txt", ".ini", ".cfg", ".nfo", ".conf" and ".xml"
This commit is contained in:
parent
c8673083f9
commit
45400dd879
@ -127,6 +127,9 @@ CMenu::CMenu()
|
||||
m_use_source = true;
|
||||
m_clearCats = true;
|
||||
m_catStartPage = 1;
|
||||
/* Explorer stuff */
|
||||
m_txt_view = false;
|
||||
m_txt_path = NULL;
|
||||
}
|
||||
|
||||
void CMenu::init()
|
||||
|
@ -116,6 +116,10 @@ private:
|
||||
string m_DMLgameDir;
|
||||
string m_helpDir;
|
||||
|
||||
/* Explorer stuff */
|
||||
bool m_txt_view;
|
||||
const char *m_txt_path;
|
||||
|
||||
/* Updates */
|
||||
char m_app_update_drive[6];
|
||||
const char* m_app_update_url;
|
||||
|
@ -81,6 +81,7 @@ void CMenu::_showAbout(void)
|
||||
{
|
||||
_setBg(m_aboutBg, m_aboutBg);
|
||||
m_btnMgr.show(m_aboutLblTitle);
|
||||
if(m_txt_view == false)
|
||||
m_btnMgr.show(m_aboutLblIOS);
|
||||
m_btnMgr.show(m_aboutLblInfo,false);
|
||||
for(u8 i = 0; i < ARRAY_SIZE(m_aboutLblUser); ++i)
|
||||
@ -107,7 +108,24 @@ void CMenu::_initAboutMenu()
|
||||
|
||||
void CMenu::_textAbout(void)
|
||||
{
|
||||
if(showHelp)
|
||||
if(m_txt_view)
|
||||
{
|
||||
wstringEx txt_file_name;
|
||||
txt_file_name.fromUTF8(strrchr(m_txt_path, '/') + 1);
|
||||
m_btnMgr.setText(m_aboutLblTitle, txt_file_name);
|
||||
wstringEx txt_file_content;
|
||||
u32 txt_size = 0;
|
||||
char *txt_mem = (char*)fsop_ReadFile(m_txt_path, &txt_size);
|
||||
if(txt_mem != NULL)
|
||||
{
|
||||
txt_file_content.fromUTF8(txt_mem);
|
||||
m_btnMgr.setText(m_aboutLblInfo, txt_file_content);
|
||||
free(txt_mem);
|
||||
}
|
||||
txt_mem = NULL;
|
||||
return; /* no need for ios checks */
|
||||
}
|
||||
else if(showHelp)
|
||||
{
|
||||
m_btnMgr.setText(m_aboutLblTitle, _t("about10", L"Help Guide"));
|
||||
wstringEx help_text;
|
||||
|
@ -228,6 +228,24 @@ void CMenu::_Explorer(void)
|
||||
}
|
||||
_showExplorer();
|
||||
}
|
||||
else if(strcasestr(file, ".dol") != NULL || strcasestr(file, ".elf") != NULL)
|
||||
{
|
||||
_hideExplorer();
|
||||
_launchHomebrew(file, m_homebrewArgs);
|
||||
_showExplorer();
|
||||
}
|
||||
else if(strcasestr(file, ".txt") != NULL || strcasestr(file, ".nfo") != NULL
|
||||
|| strcasestr(file, ".ini") != NULL || strcasestr(file, ".conf") != NULL
|
||||
|| strcasestr(file, ".cfg") != NULL || strcasestr(file, ".xml") != NULL)
|
||||
{
|
||||
_hideExplorer();
|
||||
m_txt_view = true;
|
||||
m_txt_path = file;
|
||||
_about(false);
|
||||
m_txt_view = false;
|
||||
m_txt_path = NULL;
|
||||
_showExplorer();
|
||||
}
|
||||
else if(strcasestr(file, ".wad") != NULL)
|
||||
{
|
||||
_hideExplorer();
|
||||
|
Loading…
Reference in New Issue
Block a user