diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 61f3732b9c..5640fd622b 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -541,14 +541,18 @@ UI::EventReturn GameBrowser::StorageClick(UI::EventParams &e) { } UI::EventReturn GameBrowser::HomeClick(UI::EventParams &e) { -#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(SWITCH) || defined(USING_WIN_UI) || PPSSPP_PLATFORM(UWP) - SetPath(g_Config.memStickDirectory); -#else - SetPath(Path(getenv("HOME"))); -#endif + SetPath(HomePath()); return UI::EVENT_DONE; } +Path GameBrowser::HomePath() { +#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(SWITCH) || defined(USING_WIN_UI) || PPSSPP_PLATFORM(UWP) + return g_Config.memStickDirectory; +#else + return Path(getenv("HOME")); +#endif +} + UI::EventReturn GameBrowser::PinToggleClick(UI::EventParams &e) { auto &pinnedPaths = g_Config.vPinnedPaths; const std::string path = File::ResolvePath(path_.GetPath().ToString()); diff --git a/UI/MainScreen.h b/UI/MainScreen.h index 51d500b798..9a19321755 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -57,6 +57,7 @@ public: protected: virtual bool DisplayTopBar(); virtual bool HasSpecialFiles(std::vector &filenames); + virtual Path HomePath(); void Refresh(); diff --git a/UI/RemoteISOScreen.cpp b/UI/RemoteISOScreen.cpp index eb14a3e023..b5d80bf76d 100644 --- a/UI/RemoteISOScreen.cpp +++ b/UI/RemoteISOScreen.cpp @@ -251,7 +251,7 @@ static bool LoadGameList(const Path &url, std::vector &games) { return false; } for (auto &file : files) { - if (RemoteISOFileSupported(file.name)) { + if (file.isDirectory || RemoteISOFileSupported(file.name)) { games.push_back(file.fullName); } } @@ -498,28 +498,19 @@ void RemoteISOConnectScreen::ExecuteLoad() { class RemoteGameBrowser : public GameBrowser { public: - RemoteGameBrowser(const Path &url, const std::vector &games, BrowseFlags browseFlags, bool *gridStyle_, ScreenManager* screenManager, std::string lastText, std::string lastLink, UI::LayoutParams *layoutParams = nullptr) + RemoteGameBrowser(const Path &url, BrowseFlags browseFlags, bool *gridStyle_, ScreenManager *screenManager, std::string lastText, std::string lastLink, UI::LayoutParams *layoutParams = nullptr) : GameBrowser(url, browseFlags, gridStyle_, screenManager, lastText, lastLink, layoutParams) { - games_ = games; - Refresh(); + initialPath_ = url; } protected: - bool DisplayTopBar() override { - return false; + Path HomePath() override { + return initialPath_; } - bool HasSpecialFiles(std::vector &filenames) override; - - std::string url_; - std::vector games_; + Path initialPath_; }; -bool RemoteGameBrowser::HasSpecialFiles(std::vector &filenames) { - filenames = games_; - return true; -} - RemoteISOBrowseScreen::RemoteISOBrowseScreen(const std::string &url, const std::vector &games) : url_(url), games_(games) { } @@ -541,8 +532,8 @@ void RemoteISOBrowseScreen::CreateViews() { ScrollView *scrollRecentGames = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)); scrollRecentGames->SetTag("RemoteGamesTab"); - RemoteGameBrowser *tabRemoteGames = new RemoteGameBrowser( - Path(url_), games_, BrowseFlags::PIN, &g_Config.bGridView1, screenManager(), "", "", + GameBrowser *tabRemoteGames = new RemoteGameBrowser( + Path(url_), BrowseFlags::PIN | BrowseFlags::NAVIGATE, &g_Config.bGridView1, screenManager(), "", "", new LinearLayoutParams(FILL_PARENT, FILL_PARENT)); scrollRecentGames->Add(tabRemoteGames); gameBrowsers_.push_back(tabRemoteGames);