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;
|
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());
|
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;
|
log_cheat.fatal("Failed to retrieve cheat selected from internal cheat_engine");
|
||||||
bool success;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
u32 final_offset;
|
u32 final_offset;
|
||||||
if (!cheat->red_script.empty())
|
if (!cheat->red_script.empty())
|
||||||
|
@ -593,6 +594,7 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
|
||||||
{
|
{
|
||||||
btn_apply->setEnabled(false);
|
btn_apply->setEnabled(false);
|
||||||
edt_value_final->setText(tr("Failed to resolve redirection script"));
|
edt_value_final->setText(tr("Failed to resolve redirection script"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -600,7 +602,16 @@ cheat_manager_dialog::cheat_manager_dialog(QWidget* parent)
|
||||||
final_offset = cheat->offset;
|
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;
|
u64 result_value;
|
||||||
|
|
||||||
switch (cheat->type)
|
switch (cheat->type)
|
||||||
{
|
{
|
||||||
case cheat_type::unsigned_8_cheat: result_value = cheat_engine::get_value<u8>(final_offset, success); break;
|
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 (success)
|
||||||
{
|
{
|
||||||
if (cheat->type >= cheat_type::signed_8_cheat && cheat->type <= cheat_type::signed_64_cheat)
|
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
|
else
|
||||||
cur_value = tr("%1").arg(result_value);
|
edt_value_final->setText(tr("%1").arg(result_value));
|
||||||
|
|
||||||
btn_apply->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cur_value = tr("Failed to get the value from memory");
|
edt_value_final->setText(tr("Failed to get the value from memory"));
|
||||||
btn_apply->setEnabled(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
edt_value_final->setText(cur_value);
|
btn_apply->setEnabled(success);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log_cheat.fatal("Failed to retrieve cheat selected from internal cheat_engine");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(tbl_cheats, &QTableWidget::cellChanged, [this](int row, int column)
|
connect(tbl_cheats, &QTableWidget::cellChanged, [this](int row, int column)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue