diff --git a/Source/Core/DolphinQt/CheatSearchWidget.cpp b/Source/Core/DolphinQt/CheatSearchWidget.cpp index 07409c6ad5..ccbd90f131 100644 --- a/Source/Core/DolphinQt/CheatSearchWidget.cpp +++ b/Source/Core/DolphinQt/CheatSearchWidget.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,7 @@ #include "DolphinQt/Config/CheatCodeEditor.h" #include "DolphinQt/Config/CheatWarningWidget.h" +#include "DolphinQt/Settings.h" #include "UICommon/GameFile.h" @@ -61,7 +63,17 @@ CheatSearchWidget::CheatSearchWidget(std::unique_ptrisChecked()); + if (m_session->IsIntegerType()) + { + settings.setValue(QStringLiteral("cheatsearchwidget/parsehex"), + m_parse_values_as_hex_checkbox->isChecked()); + } +} Q_DECLARE_METATYPE(Cheats::CompareType); Q_DECLARE_METATYPE(Cheats::FilterType); @@ -193,8 +205,14 @@ void CheatSearchWidget::CreateWidgets() m_given_value_text = new QLineEdit(); value_layout->addWidget(m_given_value_text); + auto& settings = Settings::GetQSettings(); m_parse_values_as_hex_checkbox = new QCheckBox(tr("Parse as Hex")); - value_layout->addWidget(m_parse_values_as_hex_checkbox); + if (m_session->IsIntegerType()) + { + m_parse_values_as_hex_checkbox->setChecked( + settings.value(QStringLiteral("cheatsearchwidget/parsehex")).toBool()); + value_layout->addWidget(m_parse_values_as_hex_checkbox); + } auto* button_layout = new QHBoxLayout(); m_next_scan_button = new QPushButton(tr("Search and Filter")); @@ -211,6 +229,8 @@ void CheatSearchWidget::CreateWidgets() m_info_label_2 = new QLabel(); m_display_values_in_hex_checkbox = new QCheckBox(tr("Display values in Hex")); + m_display_values_in_hex_checkbox->setChecked( + settings.value(QStringLiteral("cheatsearchwidget/displayhex")).toBool()); QVBoxLayout* layout = new QVBoxLayout(); layout->addWidget(session_info_label);