mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 03:25:36 +00:00
Qt: Note when patches are not allowed for achievements
This commit is contained in:
parent
871323f4e1
commit
21aaec99f1
@ -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<bool>(value).value_or(false);
|
||||
}
|
||||
else if (key == "Ignore")
|
||||
{
|
||||
ignore_this_code = StringUtil::FromChars<bool>(value).value_or(false);
|
||||
|
@ -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;
|
||||
|
@ -15,7 +15,8 @@
|
||||
#include <algorithm>
|
||||
|
||||
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("<strong>Author: </strong>%1<br>%2")
|
||||
tr("<strong>Author: </strong>%1%2<br>%3")
|
||||
.arg(author.empty() ? tr("Unknown") : QString::fromStdString(author))
|
||||
.arg(disallowed_for_achievements ? tr("<br><strong>Not permitted in RetroAchievements hardcore mode.</strong>") :
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user