mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Qt: Implement Cheats Manager
This commit is contained in:
@ -14,14 +14,15 @@
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
|
||||
CheatWarningWidget::CheatWarningWidget(const std::string& game_id) : m_game_id(game_id)
|
||||
CheatWarningWidget::CheatWarningWidget(const std::string& game_id, bool restart_required)
|
||||
: m_game_id(game_id), m_restart_required(restart_required)
|
||||
{
|
||||
CreateWidgets();
|
||||
ConnectWidgets();
|
||||
|
||||
connect(&Settings::Instance(), &Settings::EnableCheatsChanged,
|
||||
connect(&Settings::Instance(), &Settings::EnableCheatsChanged, this,
|
||||
[this] { Update(Core::IsRunning()); });
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged,
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||
[this](Core::State state) { Update(state == Core::State::Running); });
|
||||
|
||||
Update(Core::IsRunning());
|
||||
@ -58,7 +59,7 @@ void CheatWarningWidget::Update(bool running)
|
||||
bool hide_widget = true;
|
||||
bool hide_config_button = true;
|
||||
|
||||
if (running && SConfig::GetInstance().GetGameID() == m_game_id)
|
||||
if (running && SConfig::GetInstance().GetGameID() == m_game_id && m_restart_required)
|
||||
{
|
||||
hide_widget = false;
|
||||
m_text->setText(tr("Changing cheats will only take effect when the game is restarted."));
|
||||
|
Reference in New Issue
Block a user