diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 468ec46614..51d92f8729 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1090,7 +1090,7 @@ void MainScreen::CreateViews() { // Scrolling action menu to the right. using namespace UI; - bool vertical = UseVerticalLayout(); + const bool vertical = UseVerticalLayout(); auto mm = GetI18NCategory(I18NCat::MAINMENU); @@ -1309,7 +1309,11 @@ void MainScreen::CreateViews() { rightColumnChoices->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg); if (!System_GetPropertyBool(SYSPROP_APP_GOLD) && (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) != DEVICE_TYPE_VR)) { Choice *gold = rightColumnChoices->Add(new Choice(mm->T("Buy PPSSPP Gold"))); - gold->OnClick.Handle(this, &MainScreen::OnSupport); + ScreenManager *sm = screenManager(); + gold->OnClick.Add([sm](UI::EventParams &) { + LaunchBuyGold(sm); + return UI::EVENT_DONE; + }); gold->SetIcon(ImageID("I_ICONGOLD"), 0.5f); } } @@ -1575,7 +1579,7 @@ UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) { return UI::EVENT_DONE; } -UI::EventReturn MainScreen::OnSupport(UI::EventParams &e) { +void LaunchBuyGold(ScreenManager *screenManager) { #if PPSSPP_PLATFORM(IOS_APP_STORE) System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://apps.apple.com/us/app/ppsspp-gold-psp-emulator/id6502287918"); #elif PPSSPP_PLATFORM(ANDROID) @@ -1583,7 +1587,6 @@ UI::EventReturn MainScreen::OnSupport(UI::EventParams &e) { #else System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/buygold"); #endif - return UI::EVENT_DONE; } UI::EventReturn MainScreen::OnPPSSPPOrg(UI::EventParams &e) { diff --git a/UI/MainScreen.h b/UI/MainScreen.h index a4fdbb8b06..8b99e3fc12 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -146,7 +146,6 @@ protected: UI::EventReturn OnLoadFile(UI::EventParams &e); UI::EventReturn OnGameSettings(UI::EventParams &e); UI::EventReturn OnCredits(UI::EventParams &e); - UI::EventReturn OnSupport(UI::EventParams &e); UI::EventReturn OnPPSSPPOrg(UI::EventParams &e); UI::EventReturn OnForums(UI::EventParams &e); UI::EventReturn OnExit(UI::EventParams &e); @@ -206,3 +205,5 @@ private: const float MAX_GAME_GRID_SCALE = 3.0f; const float MIN_GAME_GRID_SCALE = 0.8f; }; + +void LaunchBuyGold(ScreenManager *screenManager); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 52373f6fe3..d9294ed988 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -943,15 +943,6 @@ void CreditsScreen::CreateViews() { } } -UI::EventReturn CreditsScreen::OnSupport(UI::EventParams &e) { -#ifdef __ANDROID__ - System_LaunchUrl(LaunchUrlType::BROWSER_URL, "market://details?id=org.ppsspp.ppssppgold"); -#else - System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/buygold"); -#endif - return UI::EVENT_DONE; -} - UI::EventReturn CreditsScreen::OnX(UI::EventParams &e) { // Not sure we should change to x.com here, given various platform URL handlers etc. We can probably change it soon. System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://twitter.com/PPSSPP_emu"); diff --git a/UI/MiscScreens.h b/UI/MiscScreens.h index 09c5c2d16c..6199580ee9 100644 --- a/UI/MiscScreens.h +++ b/UI/MiscScreens.h @@ -167,7 +167,6 @@ public: const char *tag() const override { return "Credits"; } private: - UI::EventReturn OnSupport(UI::EventParams &e); UI::EventReturn OnPPSSPPOrg(UI::EventParams &e); UI::EventReturn OnPrivacy(UI::EventParams &e); UI::EventReturn OnForums(UI::EventParams &e);