diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index b5288a5b6..b122d8c7d 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -1605,7 +1605,35 @@ void MainWindow::onToolsMemoryCardEditorTriggered() void MainWindow::onToolsCheatManagerTriggered() { if (!m_cheat_manager_dialog) + { + if (m_host_interface->GetBoolSettingValue("UI", "DisplayCheatWarning", true)) + { + QCheckBox* cb = new QCheckBox(tr("Do not show again")); + QMessageBox mb(this); + mb.setWindowTitle(tr("Cheat Manager")); + mb.setText( + tr("Using cheats can have unpredictable effects on games, causing crashes, graphical glitches, and corrupted " + "saves. By using the cheat manager, you agree that it is an unsupported configuration, and we will not " + "provide you with any assistance when games break.\n\nCheats persist through save states even after being " + "disabled, please remember to reset/reboot the game after turning off any codes.\n\nAre you sure you want " + "to continue?")); + mb.setIcon(QMessageBox::Warning); + mb.addButton(QMessageBox::Yes); + mb.addButton(QMessageBox::No); + mb.setDefaultButton(QMessageBox::No); + mb.setCheckBox(cb); + + connect(cb, &QCheckBox::stateChanged, [](int state) { + QtHostInterface::GetInstance()->SetBoolSettingValue("UI", "DisplayCheatWarning", + (state != Qt::CheckState::Checked)); + }); + + if (mb.exec() == QMessageBox::No) + return; + } + m_cheat_manager_dialog = new CheatManagerDialog(this); + } m_cheat_manager_dialog->setModal(false); m_cheat_manager_dialog->show(); diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 9b3b89a1b..202e9f0b8 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -3600,9 +3600,13 @@ bool CommonHostInterface::LoadCheatList(const char* filename) return false; } - AddOSDMessage(TranslateStdString("OSDMessage", "Loaded %n cheats from list.", "", cl->GetCodeCount()) + - TranslateStdString("OSDMessage", " %n cheats are enabled.", "", cl->GetEnabledCodeCount()), - 10.0f); + if (cl->GetEnabledCodeCount() > 0) + { + AddOSDMessage(TranslateStdString("OSDMessage", "%n cheats are enabled. This may result in instability.", "", + cl->GetEnabledCodeCount()), + 30.0f); + } + System::SetCheatList(std::move(cl)); return true; } @@ -3628,7 +3632,7 @@ bool CommonHostInterface::LoadCheatListFromDatabase() if (!cl->LoadFromPackage(System::GetRunningCode())) return false; - AddOSDMessage(TranslateStdString("OSDMessage", "Loaded %n cheats from database.", "", cl->GetCodeCount()), 10.0f); + Log_InfoPrintf("Loaded %u cheats from database.", cl->GetCodeCount()); System::SetCheatList(std::move(cl)); return true; }