Skip to content

Commit

Permalink
Update Gecko Codes tab for MGTT
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleCoaks committed Jul 30, 2023
1 parent 2efbe60 commit bdca6a6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
11 changes: 8 additions & 3 deletions Source/Core/Core/GeckoCodeConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ std::vector<GeckoCode> 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.
Expand Down
12 changes: 9 additions & 3 deletions Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
13 changes: 8 additions & 5 deletions Source/Core/DolphinQt/Config/PropertiesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bdca6a6

Please sign in to comment.