mirror of
https://github.com/dolphin-emu/dolphin
synced 2025-10-06 00:13:03 +02:00
Merge pull request #13907 from TryTwo/PR_Cheat_Refresh
Cheats: Refresh active code after editing it.
This commit is contained in:
@@ -298,6 +298,8 @@ void ARCodeWidget::OnCodeEditClicked()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const auto* const selected = items[0];
|
const auto* const selected = items[0];
|
||||||
|
const bool enabled = selected->checkState() == Qt::Checked;
|
||||||
|
|
||||||
auto& current_ar = m_ar_codes[m_code_list->row(selected)];
|
auto& current_ar = m_ar_codes[m_code_list->row(selected)];
|
||||||
|
|
||||||
if (current_ar.user_defined)
|
if (current_ar.user_defined)
|
||||||
@@ -318,6 +320,9 @@ void ARCodeWidget::OnCodeEditClicked()
|
|||||||
|
|
||||||
SaveCodes();
|
SaveCodes();
|
||||||
UpdateList();
|
UpdateList();
|
||||||
|
|
||||||
|
if (!m_restart_required && enabled)
|
||||||
|
ActionReplay::ApplyCodes(m_ar_codes, m_game_id, m_game_revision);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARCodeWidget::OnCodeRemoveClicked()
|
void ARCodeWidget::OnCodeRemoveClicked()
|
||||||
|
@@ -236,6 +236,7 @@ void GeckoCodeWidget::EditCode()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const int index = item->data(Qt::UserRole).toInt();
|
const int index = item->data(Qt::UserRole).toInt();
|
||||||
|
const bool enabled = item->checkState() == Qt::Checked;
|
||||||
|
|
||||||
m_cheat_code_editor->SetGeckoCode(&m_gecko_codes[index]);
|
m_cheat_code_editor->SetGeckoCode(&m_gecko_codes[index]);
|
||||||
if (m_cheat_code_editor->exec() == QDialog::Rejected)
|
if (m_cheat_code_editor->exec() == QDialog::Rejected)
|
||||||
@@ -243,6 +244,9 @@ void GeckoCodeWidget::EditCode()
|
|||||||
|
|
||||||
SaveCodes();
|
SaveCodes();
|
||||||
UpdateList();
|
UpdateList();
|
||||||
|
|
||||||
|
if (!m_restart_required && enabled)
|
||||||
|
Gecko::SetActiveCodes(m_gecko_codes, m_game_id, m_game_revision);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeckoCodeWidget::RemoveCode()
|
void GeckoCodeWidget::RemoveCode()
|
||||||
|
Reference in New Issue
Block a user