mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Core: Allow overriding the enabling of a code
If we want to enable codes in the default game INIs, we should have some way for users to disable them. This commit accomplishes that by adding a *_Disabled section corresponding to each *_Enabled section.
This commit is contained in:
@ -89,7 +89,7 @@ void ARCodeWidget::ConnectWidgets()
|
||||
|
||||
void ARCodeWidget::OnItemChanged(QListWidgetItem* item)
|
||||
{
|
||||
m_ar_codes[m_code_list->row(item)].active = (item->checkState() == Qt::Checked);
|
||||
m_ar_codes[m_code_list->row(item)].enabled = (item->checkState() == Qt::Checked);
|
||||
|
||||
if (!m_restart_required)
|
||||
ActionReplay::ApplyCodes(m_ar_codes);
|
||||
@ -159,7 +159,7 @@ void ARCodeWidget::UpdateList()
|
||||
|
||||
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable |
|
||||
Qt::ItemIsDragEnabled);
|
||||
item->setCheckState(ar.active ? Qt::Checked : Qt::Unchecked);
|
||||
item->setCheckState(ar.enabled ? Qt::Checked : Qt::Unchecked);
|
||||
item->setData(Qt::UserRole, static_cast<int>(i));
|
||||
|
||||
m_code_list->addItem(item);
|
||||
@ -190,7 +190,7 @@ void ARCodeWidget::AddCode(ActionReplay::ARCode code)
|
||||
void ARCodeWidget::OnCodeAddClicked()
|
||||
{
|
||||
ActionReplay::ARCode ar;
|
||||
ar.active = true;
|
||||
ar.enabled = true;
|
||||
|
||||
CheatCodeEditor ed(this);
|
||||
ed.SetARCode(&ar);
|
||||
|
@ -34,7 +34,7 @@ NewPatchDialog::NewPatchDialog(QWidget* parent, PatchEngine::Patch& patch)
|
||||
if (m_patch.entries.empty())
|
||||
{
|
||||
AddEntry();
|
||||
m_patch.active = true;
|
||||
m_patch.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ void PatchesWidget::ConnectWidgets()
|
||||
|
||||
void PatchesWidget::OnItemChanged(QListWidgetItem* item)
|
||||
{
|
||||
m_patches[m_list->row(item)].active = (item->checkState() == Qt::Checked);
|
||||
m_patches[m_list->row(item)].enabled = (item->checkState() == Qt::Checked);
|
||||
SavePatches();
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ void PatchesWidget::SavePatches()
|
||||
|
||||
for (const auto& patch : m_patches)
|
||||
{
|
||||
if (patch.active)
|
||||
if (patch.enabled)
|
||||
lines_enabled.push_back("$" + patch.name);
|
||||
|
||||
if (!patch.user_defined)
|
||||
@ -164,7 +164,7 @@ void PatchesWidget::Update()
|
||||
{
|
||||
auto* item = new QListWidgetItem(QString::fromStdString(patch.name));
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
item->setCheckState(patch.active ? Qt::Checked : Qt::Unchecked);
|
||||
item->setCheckState(patch.enabled ? Qt::Checked : Qt::Unchecked);
|
||||
item->setData(Qt::UserRole, patch.user_defined);
|
||||
|
||||
m_list->addItem(item);
|
||||
|
Reference in New Issue
Block a user