From bdca6a6bfc71d19ab9d52af33bd286774b09d8d6 Mon Sep 17 00:00:00 2001 From: LittleCoaks Date: Sat, 29 Jul 2023 22:30:42 -0400 Subject: [PATCH] Update Gecko Codes tab for MGTT --- Source/Core/Core/GeckoCodeConfig.cpp | 11 ++++++++--- Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp | 12 +++++++++--- Source/Core/DolphinQt/Config/PropertiesDialog.cpp | 13 ++++++++----- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/GeckoCodeConfig.cpp b/Source/Core/Core/GeckoCodeConfig.cpp index 2fbae89df028..a321b5c54907 100644 --- a/Source/Core/Core/GeckoCodeConfig.cpp +++ b/Source/Core/Core/GeckoCodeConfig.cpp @@ -23,9 +23,14 @@ std::vector DownloadCodes(std::string gametdb_id, bool* succeeded, bo const std::string protocol = use_https ? "https://" : "http://"; // codes.rc24.xyz is a mirror of the now defunct geckocodes.org. - std::string endpoint = (gametdb_id == "GYQE01") ? - "https://pastebin.com/raw/cPBAFkKf" : - "https://codes.rc24.xyz/txt.php?txt=" + gametdb_id; + std::string endpoint; + if (gametdb_id == "GYQE01") + endpoint = "https://pastebin.com/raw/cPBAFkKf"; + else if (gametdb_id == "GFTE01") + endpoint = "https://pastebin.com/raw/N1aupMyU"; + else + endpoint = "https://codes.rc24.xyz/txt.php?txt=" + gametdb_id; + Common::HttpRequest http; // The server always redirects once to the same location. diff --git a/Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp b/Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp index ad75794846b5..efe9d667edb7 100644 --- a/Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp +++ b/Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp @@ -87,9 +87,15 @@ void GeckoCodeWidget::CreateWidgets() m_remove_code = new NonDefaultQPushButton(tr("&Remove Code")); m_download_codes = new NonDefaultQPushButton(tr("Download Codes")); - m_download_codes->setToolTip(tr(m_game_id == "GYQE01" ? - "Download Mario Superstar Baseball Codes" : - "Download Codes from WiiRD Database")); + std::string download_codes_tooltip; + if (m_game_id == "GYQE01") { + download_codes_tooltip = "Download Mario Superstar Baseball Codes"; + } else if (m_game_id == "GFTE01") { + download_codes_tooltip = "Download Mario Golf Toadstool Tour Codes"; + } else { + "Download Codes from WiiRD Database"; + } + m_download_codes->setToolTip(QString::fromStdString(download_codes_tooltip)); m_code_list->setEnabled(!m_game_id.empty()); m_name_label->setEnabled(!m_game_id.empty()); diff --git a/Source/Core/DolphinQt/Config/PropertiesDialog.cpp b/Source/Core/DolphinQt/Config/PropertiesDialog.cpp index b79e9b6f22db..5feae7f7526a 100644 --- a/Source/Core/DolphinQt/Config/PropertiesDialog.cpp +++ b/Source/Core/DolphinQt/Config/PropertiesDialog.cpp @@ -102,20 +102,23 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& ga GeckoDialog::GeckoDialog(QWidget* parent) : QDialog(parent) { - setWindowTitle(QStringLiteral("%1 - %2") - .arg(QString::fromStdString("Gecko Codes"), QString::fromStdString("(Game ID: GYQE01)"))); + setWindowTitle(QStringLiteral("%1") + .arg(QString::fromStdString("Gecko Codes"))); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); QVBoxLayout* layout = new QVBoxLayout(); QTabWidget* tab_widget = new QTabWidget(this); - GeckoCodeWidget* gecko = new GeckoCodeWidget("GYQE01", "GYQE01", 0); + GeckoCodeWidget* mssb_gecko = new GeckoCodeWidget("GYQE01", "GYQE01", 0); + GeckoCodeWidget* mgtt_gecko = new GeckoCodeWidget("GFTE01", "GFTE01", 0); - connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this, &GeckoDialog::OpenGeneralSettings); + connect(mssb_gecko, &GeckoCodeWidget::OpenGeneralSettings, this, &GeckoDialog::OpenGeneralSettings); + connect(mgtt_gecko, &GeckoCodeWidget::OpenGeneralSettings, this, &GeckoDialog::OpenGeneralSettings); const int padding_width = 120; const int padding_height = 200; - tab_widget->addTab(GetWrappedWidget(gecko, this, padding_width, padding_height),tr("Mario Superstar Baseball")); + tab_widget->addTab(GetWrappedWidget(mssb_gecko, this, padding_width, padding_height),tr("Mario Superstar Baseball")); + tab_widget->addTab(GetWrappedWidget(mgtt_gecko, this, padding_width, padding_height),tr("Mario Golf Toadstool Tour")); layout->addWidget(tab_widget);