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:
JosJuice
2020-12-10 12:58:27 +01:00
parent 3328eb4523
commit 366cfd0f8c
14 changed files with 68 additions and 69 deletions

View File

@ -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);