mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
cheat_manager: notify if no game is running
This commit is contained in:
parent
4315363f4b
commit
ebf832214e
1 changed files with 49 additions and 46 deletions
|
@ -580,10 +580,11 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
|
|||
return;
|
||||
|
||||
cheat_info* cheat = g_cheat.get(tbl_cheats->item(row, cheat_table_columns::title)->text().toStdString(), tbl_cheats->item(row, cheat_table_columns::offset)->data(Qt::UserRole).toUInt());
|
||||
if (cheat)
|
||||
if (!cheat)
|
||||
{
|
||||
QString cur_value;
|
||||
bool success;
|
||||
log_cheat.fatal("Failed to retrieve cheat selected from internal cheat_engine");
|
||||
return;
|
||||
}
|
||||
|
||||
u32 final_offset;
|
||||
if (!cheat->red_script.empty())
|
||||
|
@ -593,6 +594,7 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
|
|||
{
|
||||
btn_apply->setEnabled(false);
|
||||
edt_value_final->setText(tr("Failed to resolve redirection script"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -600,7 +602,16 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
|
|||
final_offset = cheat->offset;
|
||||
}
|
||||
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
btn_apply->setEnabled(false);
|
||||
edt_value_final->setText(tr("This Application is not running"));
|
||||
return;
|
||||
}
|
||||
|
||||
bool success;
|
||||
u64 result_value;
|
||||
|
||||
switch (cheat->type)
|
||||
{
|
||||
case cheat_type::unsigned_8_cheat: result_value = cheat_engine::get_value<u8>(final_offset, success); break;
|
||||
|
@ -617,24 +628,16 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
|
|||
if (success)
|
||||
{
|
||||
if (cheat->type >= cheat_type::signed_8_cheat && cheat->type <= cheat_type::signed_64_cheat)
|
||||
cur_value = tr("%1").arg(static_cast<s64>(result_value));
|
||||
edt_value_final->setText(tr("%1").arg(static_cast<s64>(result_value)));
|
||||
else
|
||||
cur_value = tr("%1").arg(result_value);
|
||||
|
||||
btn_apply->setEnabled(true);
|
||||
edt_value_final->setText(tr("%1").arg(result_value));
|
||||
}
|
||||
else
|
||||
{
|
||||
cur_value = tr("Failed to get the value from memory");
|
||||
btn_apply->setEnabled(false);
|
||||
edt_value_final->setText(tr("Failed to get the value from memory"));
|
||||
}
|
||||
|
||||
edt_value_final->setText(cur_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
log_cheat.fatal("Failed to retrieve cheat selected from internal cheat_engine");
|
||||
}
|
||||
btn_apply->setEnabled(success);
|
||||
});
|
||||
|
||||
connect(tbl_cheats, &QTableWidget::cellChanged, [this](int row, int column)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue