From c4f82bfdc30312f1500ba7a8ba010537dd3da41c Mon Sep 17 00:00:00 2001 From: fledge68 Date: Mon, 19 Aug 2013 14:02:03 +0000 Subject: [PATCH] - path manager and nand paths now start at the current path --- source/menu/menu.hpp | 2 +- source/menu/menu_explorer.cpp | 7 +++++-- source/menu/menu_nandemu.cpp | 14 ++++++++++++-- source/menu/menu_paths.cpp | 18 +++++++++++------- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index ba57c14f..e787cfb5 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -1027,7 +1027,7 @@ private: void _gameSettings(void); void _CoverBanner(void); void _Explorer(void); - const char *_FolderExplorer(void); + const char *_FolderExplorer(const char *startPath); void _Wad(const char *wad_path = NULL); void _CheatSettings(); bool _Source(); diff --git a/source/menu/menu_explorer.cpp b/source/menu/menu_explorer.cpp index ad5f33b6..280de74b 100644 --- a/source/menu/menu_explorer.cpp +++ b/source/menu/menu_explorer.cpp @@ -428,10 +428,13 @@ void CMenu::_refreshExplorer(s8 direction) m_btnMgr.show(m_explorerBtnPageP); } -const char *CMenu::_FolderExplorer(void) +const char *CMenu::_FolderExplorer(const char *startPath) { folderExplorer = true; - //path = ""; + memset(dir, 0, MAX_FAT_PATH); + strcpy(dir, startPath); + if(dir[strlen(dir) - 1] != '/') + strcat(dir, "/"); _Explorer(); folderExplorer = false; return folderPath; diff --git a/source/menu/menu_nandemu.cpp b/source/menu/menu_nandemu.cpp index 9ed4a1a2..2313389d 100644 --- a/source/menu/menu_nandemu.cpp +++ b/source/menu/menu_nandemu.cpp @@ -380,7 +380,12 @@ int CMenu::_NandEmuCfg(void) else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnNandFolder))) { _hideNandEmu(true); - const char *path = _FolderExplorer(); + u8 tmpView = m_current_view; + m_current_view = COVERFLOW_CHANNEL; + string emuPath; + _FindEmuPart(emuPath, true); + const char *path = _FolderExplorer(NandHandle.GetPath()); + m_current_view = tmpView; if(strlen(path) > 0) { if(strncmp(path, "sd:/", 4) == 0) @@ -403,7 +408,12 @@ int CMenu::_NandEmuCfg(void) else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnNandSavesFolder))) { _hideNandEmu(true); - const char *path = _FolderExplorer(); + u8 tmpView = m_current_view; + m_current_view = COVERFLOW_USB; + string emuPath; + _FindEmuPart(emuPath, true); + const char *path = _FolderExplorer(NandHandle.GetPath()); + m_current_view = tmpView; if(strlen(path) > 0) { if(strncmp(path, "sd:/", 4) == 0) diff --git a/source/menu/menu_paths.cpp b/source/menu/menu_paths.cpp index f171737a..fb1ac578 100644 --- a/source/menu/menu_paths.cpp +++ b/source/menu/menu_paths.cpp @@ -125,7 +125,7 @@ void CMenu::_Paths(void) if (m_btnMgr.selected(m_pathsBtn1)) { _hidePaths(); - path = _FolderExplorer(); + path = _FolderExplorer(m_cfg.getString("GENERAL", "dir_box_covers").c_str()); if(strlen(path) > 0) { m_cfg.setString("GENERAL", "dir_box_covers", path); @@ -137,7 +137,7 @@ void CMenu::_Paths(void) else if (m_btnMgr.selected(m_pathsBtn2)) { _hidePaths(); - path = _FolderExplorer(); + path = _FolderExplorer(m_cfg.getString("GENERAL", "dir_flat_covers").c_str()); if(strlen(path) > 0) { m_cfg.setString("GENERAL", "dir_flat_covers", path); @@ -149,7 +149,7 @@ void CMenu::_Paths(void) else if (m_btnMgr.selected(m_pathsBtn3)) { _hidePaths(); - path = _FolderExplorer(); + path = _FolderExplorer(m_cfg.getString("GENERAL", "dir_custom_banners").c_str()); if(strlen(path) > 0) { m_cfg.setString("GENERAL", "dir_custom_banners", path); @@ -160,7 +160,7 @@ void CMenu::_Paths(void) else if (m_btnMgr.selected(m_pathsBtn4)) { _hidePaths(); - path = _FolderExplorer(); + path = _FolderExplorer(m_cfg.getString("GENERAL", "dir_banner_cache").c_str()); if(strlen(path) > 0) { m_cfg.setString("GENERAL", "dir_banner_cache", path); @@ -174,7 +174,9 @@ void CMenu::_Paths(void) if (m_btnMgr.selected(m_pathsBtn1)) { _hidePaths(); - path = _FolderExplorer(); + currentPartition = m_cfg.getInt(WII_DOMAIN, "partition", USB1); + string gameDir(fmt(wii_games_dir, DeviceName[currentPartition])); + path = _FolderExplorer(gameDir.c_str()); if(strlen(path) > 0) { if(strncmp(path, "sd:/", 4) == 0) @@ -199,7 +201,9 @@ void CMenu::_Paths(void) else if (m_btnMgr.selected(m_pathsBtn2)) { _hidePaths(); - path = _FolderExplorer(); + currentPartition = m_cfg.getInt(GC_DOMAIN, "partition", USB1); + string gameDir(fmt(currentPartition == SD ? DML_DIR : m_DMLgameDir.c_str(), DeviceName[currentPartition])); + path = _FolderExplorer(gameDir.c_str()); if(strlen(path) > 0) { if(strncmp(path, "sd:/", 4) == 0) @@ -222,7 +226,7 @@ void CMenu::_Paths(void) else if (m_btnMgr.selected(m_pathsBtn3)) { _hidePaths(); - path = _FolderExplorer(); + path = _FolderExplorer(m_cfg.getString("GENERAL", "dir_music").c_str()); if(strlen(path) > 0) { m_cfg.setString("GENERAL", "dir_music", path);