diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index 8e4f21dc0..bf63780bd 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -1320,6 +1320,10 @@ bool Cheats::ExtractCodeInfo(CodeInfoList* dst, std::string_view file_data, bool } } } + else if (key == "DisallowForAchievements") + { + current_code.disallow_for_achievements = StringUtil::FromChars(value).value_or(false); + } else if (key == "Ignore") { ignore_this_code = StringUtil::FromChars(value).value_or(false); diff --git a/src/core/cheats.h b/src/core/cheats.h index 08ced2210..2cd927bc2 100644 --- a/src/core/cheats.h +++ b/src/core/cheats.h @@ -60,6 +60,7 @@ struct CodeInfo CodeType type = CodeType::Gameshark; CodeActivation activation = CodeActivation::EndFrame; bool from_database = false; + bool disallow_for_achievements = false; std::string_view GetNamePart() const; std::string_view GetNameParentPart() const; diff --git a/src/duckstation-qt/gamepatchsettingswidget.cpp b/src/duckstation-qt/gamepatchsettingswidget.cpp index 82df426d0..53d2e48cc 100644 --- a/src/duckstation-qt/gamepatchsettingswidget.cpp +++ b/src/duckstation-qt/gamepatchsettingswidget.cpp @@ -15,7 +15,8 @@ #include GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::string& author, - const std::string& description, bool enabled, SettingsWindow* dialog, + const std::string& description, bool enabled, + bool disallowed_for_achievements, SettingsWindow* dialog, QWidget* parent) : QWidget(parent), m_dialog(dialog), m_name(name) { @@ -23,8 +24,10 @@ GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::stri m_ui.name->setText(QString::fromStdString(name)); m_ui.description->setText( - tr("Author: %1
%2") + tr("Author: %1%2
%3") .arg(author.empty() ? tr("Unknown") : QString::fromStdString(author)) + .arg(disallowed_for_achievements ? tr("
Not permitted in RetroAchievements hardcore mode.") : + QString()) .arg(description.empty() ? tr("No description provided.") : QString::fromStdString(description))); DebugAssert(dialog->getSettingsInterface()); @@ -108,8 +111,8 @@ void GamePatchSettingsWidget::reloadList() } const bool enabled = (std::find(enabled_list.begin(), enabled_list.end(), pi.name) != enabled_list.end()); - GamePatchDetailsWidget* it = - new GamePatchDetailsWidget(std::move(pi.name), pi.author, pi.description, enabled, m_dialog, container); + GamePatchDetailsWidget* it = new GamePatchDetailsWidget( + std::move(pi.name), pi.author, pi.description, pi.disallow_for_achievements, enabled, m_dialog, container); layout->addWidget(it); } } diff --git a/src/duckstation-qt/gamepatchsettingswidget.h b/src/duckstation-qt/gamepatchsettingswidget.h index 7f2e118c7..d093bdf02 100644 --- a/src/duckstation-qt/gamepatchsettingswidget.h +++ b/src/duckstation-qt/gamepatchsettingswidget.h @@ -20,7 +20,7 @@ class GamePatchDetailsWidget : public QWidget public: GamePatchDetailsWidget(std::string name, const std::string& author, const std::string& description, bool enabled, - SettingsWindow* dialog, QWidget* parent); + bool disallowed_for_achievements, SettingsWindow* dialog, QWidget* parent); ~GamePatchDetailsWidget(); private Q_SLOTS: