Warn about updates for affected games
Some games suck with updates on Yuzu, this lets the user know about it. Currently, only Tears of the Kingdom is known to be affected, but this can easily be expanded to include more games. Signed-off-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
609f5e48e0
commit
e8ad10350e
2 changed files with 469 additions and 413 deletions
|
@ -88,6 +88,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
||||||
#include <QtConcurrent/QtConcurrent>
|
#include <QtConcurrent/QtConcurrent>
|
||||||
|
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
|
#include <QCheckBox>
|
||||||
#include <SDL.h> // For SDL ScreenSaver functions
|
#include <SDL.h> // For SDL ScreenSaver functions
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -199,6 +200,14 @@ enum class CalloutFlag : uint32_t {
|
||||||
DRDDeprecation = 0x2,
|
DRDDeprecation = 0x2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some games perform worse or straight-up don't work with updates,
|
||||||
|
* so this tracks which games are bad in this regard.
|
||||||
|
*/
|
||||||
|
static const QList<u64> bad_update_games{
|
||||||
|
72324500776771584 // Tears of the Kingdom
|
||||||
|
};
|
||||||
|
|
||||||
const int GMainWindow::max_recent_files_item;
|
const int GMainWindow::max_recent_files_item;
|
||||||
|
|
||||||
static void RemoveCachedContents() {
|
static void RemoveCachedContents() {
|
||||||
|
@ -1778,6 +1787,53 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
|
||||||
std::make_unique<QtWebBrowser>(*this), // Web Browser
|
std::make_unique<QtWebBrowser>(*this), // Web Browser
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// yuzu's configuration doesn't actually support lists so this is a bit hacky
|
||||||
|
QSettings settings;
|
||||||
|
QStringList currentIgnored = settings.value("ignoredBadUpdates", {}).toStringList();
|
||||||
|
|
||||||
|
for (const u64 id : bad_update_games) {
|
||||||
|
const bool ignored = currentIgnored.contains(QString::number(id));
|
||||||
|
|
||||||
|
if (params.program_id == id && !ignored) {
|
||||||
|
QMessageBox *msg = new QMessageBox(this);
|
||||||
|
msg->setWindowTitle(tr("Game Updates Warning"));
|
||||||
|
msg->setIcon(QMessageBox::Warning);
|
||||||
|
msg->setText(tr("The game you are trying to launch is known to have performance or booting "
|
||||||
|
"issues when updates are applied. It's recommended to disable any updates "
|
||||||
|
"to this game before attempting to launch, or switch to an earlier update. "
|
||||||
|
"If you don't have any updates installed or enabled, you can safely ignore "
|
||||||
|
"this message.<br><br>Press \"OK\" to continue launching, or \"Cancel\" to "
|
||||||
|
"cancel the launch."));
|
||||||
|
|
||||||
|
msg->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
|
|
||||||
|
QCheckBox *dontShowAgain = new QCheckBox(msg);
|
||||||
|
dontShowAgain->setText(tr("Don't show again for this game"));
|
||||||
|
msg->setCheckBox(dontShowAgain);
|
||||||
|
|
||||||
|
int result = msg->exec();
|
||||||
|
|
||||||
|
// wtf
|
||||||
|
QMessageBox::ButtonRole role = msg->buttonRole(msg->button((QMessageBox::StandardButton) result));
|
||||||
|
|
||||||
|
switch (role) {
|
||||||
|
|
||||||
|
case QMessageBox::RejectRole:
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case QMessageBox::AcceptRole:
|
||||||
|
default:
|
||||||
|
if (dontShowAgain->isChecked()) {
|
||||||
|
currentIgnored << QString::number(params.program_id);
|
||||||
|
|
||||||
|
settings.setValue("ignoredBadUpdates", currentIgnored);
|
||||||
|
settings.sync();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const Core::SystemResultStatus result{
|
const Core::SystemResultStatus result{
|
||||||
system->Load(*render_window, filename.toStdString(), params)};
|
system->Load(*render_window, filename.toStdString(), params)};
|
||||||
|
|
||||||
|
@ -5259,7 +5315,7 @@ int main(int argc, char* argv[]) {
|
||||||
Common::ConfigureNvidiaEnvironmentFlags();
|
Common::ConfigureNvidiaEnvironmentFlags();
|
||||||
|
|
||||||
// Init settings params
|
// Init settings params
|
||||||
QCoreApplication::setOrganizationName(QStringLiteral("yuzu team"));
|
QCoreApplication::setOrganizationName(QStringLiteral("yuzu"));
|
||||||
QCoreApplication::setApplicationName(QStringLiteral("eden"));
|
QCoreApplication::setApplicationName(QStringLiteral("eden"));
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue