From 42873654117579a057b8741b203c17a71d09a9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 29 Jan 2023 00:25:00 +0100 Subject: [PATCH] Update URLs, fix feedback from #16851 --- Common/UI/View.h | 5 ++--- Core/Config.h | 8 +------- Core/ConfigValues.h | 8 ++++++++ Qt/mainwindow.cpp | 2 +- UI/EmuScreen.cpp | 6 +++--- UI/GameSettingsScreen.cpp | 8 ++++---- UI/MainScreen.cpp | 8 ++++---- UI/MemStickScreen.cpp | 2 ++ UI/MiscScreens.cpp | 4 ++-- Windows/MainWindowMenu.cpp | 2 +- 10 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Common/UI/View.h b/Common/UI/View.h index 837192ba7b..7caa8ef0ba 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -871,9 +871,8 @@ public: : CheckBox(nullptr, text, smallText, layoutParams), bitfield_(bitfield), bit_(bit) { } - BitCheckBox(int *bitfield, int bit, const std::string &text, const std::string &smallText = "", LayoutParams *layoutParams = nullptr) : BitCheckBox((uint32_t *)bitfield, (uint32_t)bit, text, smallText, layoutParams) { - } - + BitCheckBox(int *bitfield, int bit, const std::string &text, const std::string &smallText = "", LayoutParams *layoutParams = nullptr) : BitCheckBox((uint32_t *)bitfield, (uint32_t)bit, text, smallText, layoutParams) {} + void Toggle() override; bool Toggled() const override; diff --git a/Core/Config.h b/Core/Config.h index ad81d40aa8..6ce10c4ee1 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -31,12 +31,6 @@ extern const char *PPSSPP_GIT_VERSION; extern bool jitForcedOff; -// should this be here?! -// for Config.iShowStatusFlags -#define STATUS_SHOW_FPS_COUNTER (1 << 1) -#define STATUS_SHOW_SPEED_COUNTER (1 << 2) -#define STATUS_SHOW_BATTERY_PERCENT (1 << 3) - enum ChatPositions { BOTTOM_LEFT = 0, BOTTOM_CENTER = 1, @@ -276,7 +270,7 @@ public: // UI bool bShowDebuggerOnLoad; - int iShowStatusFlags; // Should we rename this now? + int iShowStatusFlags; bool bShowRegionOnGameIcon; bool bShowIDOnGameIcon; float fGameGridScale; diff --git a/Core/ConfigValues.h b/Core/ConfigValues.h index f8e88be931..b202747087 100644 --- a/Core/ConfigValues.h +++ b/Core/ConfigValues.h @@ -22,6 +22,7 @@ #ifndef _MSC_VER #include #endif +#include "Common/Common.h" #include "Common/CommonFuncs.h" const int PSP_MODEL_FAT = 0; @@ -129,3 +130,10 @@ enum class AnalogFpsMode { MAPPED_DIRECTION = 1, MAPPED_DIR_TO_OPPOSITE_DIR = 2, }; + +// for Config.iShowStatusFlags +enum class ShowStatusFlags { + FPS_COUNTER = 1 << 1, + SPEED_COUNTER = 1 << 2, + BATTERY_PERCENT = 1 << 3, +}; diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index c0452468da..3ab5f4ac37 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -423,7 +423,7 @@ void MainWindow::forumAct() void MainWindow::goldAct() { - QDesktopServices::openUrl(QUrl("https://central.ppsspp.org/buygold")); + QDesktopServices::openUrl(QUrl("https://www.ppsspp.org/buygold")); } void MainWindow::gitAct() diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 8d8ec63124..27f20ac4d2 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1310,16 +1310,16 @@ static void DrawFPS(UIContext *ctx, const Bounds &bounds) { float vps, fps, actual_fps; __DisplayGetFPS(&vps, &fps, &actual_fps); char fpsbuf[256] = {""}; - if (g_Config.iShowStatusFlags & STATUS_SHOW_FPS_COUNTER) { + if (g_Config.iShowStatusFlags & (int)ShowStatusFlags::FPS_COUNTER) { snprintf(fpsbuf, sizeof(fpsbuf), "%s FPS: %0.1f", fpsbuf, actual_fps); } - if (g_Config.iShowStatusFlags & STATUS_SHOW_SPEED_COUNTER) { + if (g_Config.iShowStatusFlags & (int)ShowStatusFlags::SPEED_COUNTER) { snprintf(fpsbuf, sizeof(fpsbuf), "%s Speed: %0.1f%%", fpsbuf, vps / (59.94f / 100.0f)); } #ifdef CAN_DISPLAY_CURRENT_BATTERY_CAPACITY - if (g_Config.iShowStatusFlags & STATUS_SHOW_BATTERY_PERCENT) { + if (g_Config.iShowStatusFlags & (int)ShowStatusFlags::BATTERY_PERCENT) { snprintf(fpsbuf, sizeof(fpsbuf), "%s Battery: %d%%", fpsbuf, getCurrentBatteryCapacity()); } #endif diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 0da0062041..44d019a9af 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -564,12 +564,12 @@ void GameSettingsScreen::CreateViews() { }); graphicsSettings->Add(new ItemHeader(gr->T("Overlay Information"))); - graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, STATUS_SHOW_FPS_COUNTER, gr->T("Show FPS Counter"))); - graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, STATUS_SHOW_SPEED_COUNTER, gr->T("Show Speed"))); + graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, (int)ShowStatusFlags::FPS_COUNTER, gr->T("Show FPS Counter"))); + graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, (int)ShowStatusFlags::SPEED_COUNTER, gr->T("Show Speed"))); #ifdef CAN_DISPLAY_CURRENT_BATTERY_CAPACITY - graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, STATUS_SHOW_BATTERY_PERCENT, gr->T("Show Battery %"))); + graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, (int)ShowStatusFlags::BATTERY_PERCENT, gr->T("Show Battery %"))); #endif - + graphicsSettings->Add(new CheckBox(&g_Config.bShowDebugStats, gr->T("Show Debug Statistics")))->OnClick.Handle(this, &GameSettingsScreen::OnJitAffectingSetting); // Audio diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 4d4cdfb6f3..3a9bfa515d 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1024,10 +1024,10 @@ void MainScreen::CreateViews() { scrollHomebrew->SetTag("MainScreenHomebrew"); GameBrowser *tabAllGames = new GameBrowser(Path(g_Config.currentDirectory), BrowseFlags::STANDARD, &g_Config.bGridView2, screenManager(), - mm->T("How to get games"), "https://www.ppsspp.org/getgames.html", + mm->T("How to get games"), "https://www.ppsspp.org/getgames", new LinearLayoutParams(FILL_PARENT, FILL_PARENT)); GameBrowser *tabHomebrew = new GameBrowser(GetSysDirectory(DIRECTORY_GAME), BrowseFlags::HOMEBREW_STORE, &g_Config.bGridView3, screenManager(), - mm->T("How to get homebrew & demos", "How to get homebrew && demos"), "https://www.ppsspp.org/gethomebrew.html", + mm->T("How to get homebrew & demos", "How to get homebrew && demos"), "https://www.ppsspp.org/gethomebrew", new LinearLayoutParams(FILL_PARENT, FILL_PARENT)); scrollAllGames_->Add(tabAllGames); @@ -1221,7 +1221,7 @@ UI::EventReturn MainScreen::OnDownloadUpgrade(UI::EventParams &e) { LaunchBrowser("market://details?id=org.ppsspp.ppsspp"); } #elif PPSSPP_PLATFORM(WINDOWS) - LaunchBrowser("https://www.ppsspp.org/downloads.html"); + LaunchBrowser("https://www.ppsspp.org/download"); #else // Go directly to ppsspp.org and let the user sort it out // (for details and in case downloads doesn't have their platform.) @@ -1406,7 +1406,7 @@ UI::EventReturn MainScreen::OnSupport(UI::EventParams &e) { #ifdef __ANDROID__ LaunchBrowser("market://details?id=org.ppsspp.ppssppgold"); #else - LaunchBrowser("https://central.ppsspp.org/buygold"); + LaunchBrowser("https://www.ppsspp.org/buygold"); #endif return UI::EVENT_DONE; } diff --git a/UI/MemStickScreen.cpp b/UI/MemStickScreen.cpp index 374c4683a0..53030fd9d0 100644 --- a/UI/MemStickScreen.cpp +++ b/UI/MemStickScreen.cpp @@ -302,6 +302,8 @@ void MemStickScreen::CreateViews() { } UI::EventReturn MemStickScreen::OnHelp(UI::EventParams ¶ms) { + // I'm letting the old redirect handle this one, as the target is within /docs on the website, + // and that structure may change a bit. LaunchBrowser("https://www.ppsspp.org/guide_storage.html"); return UI::EVENT_DONE; diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 492c6e88e2..c1bb989b01 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -842,7 +842,7 @@ UI::EventReturn CreditsScreen::OnSupport(UI::EventParams &e) { #ifdef __ANDROID__ LaunchBrowser("market://details?id=org.ppsspp.ppssppgold"); #else - LaunchBrowser("https://central.ppsspp.org/buygold"); + LaunchBrowser("https://www.ppsspp.org/buygold"); #endif return UI::EVENT_DONE; } @@ -862,7 +862,7 @@ UI::EventReturn CreditsScreen::OnPPSSPPOrg(UI::EventParams &e) { } UI::EventReturn CreditsScreen::OnPrivacy(UI::EventParams &e) { - LaunchBrowser("https://www.ppsspp.org/privacy.html"); + LaunchBrowser("https://www.ppsspp.org/privacy"); return UI::EVENT_DONE; } diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index 70c08296ee..1bb9ab9b91 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -919,7 +919,7 @@ namespace MainWindow { break; case ID_HELP_BUYGOLD: - ShellExecute(NULL, L"open", L"https://central.ppsspp.org/buygold", NULL, NULL, SW_SHOWNORMAL); + ShellExecute(NULL, L"open", L"https://www.ppsspp.org/buygold", NULL, NULL, SW_SHOWNORMAL); break; case ID_HELP_OPENFORUM: