mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
cheatopt: move global cheat enable to the bottom
This commit is contained in:
parent
10fed39261
commit
bf7fdcfdac
@ -130,17 +130,14 @@ void menu_cheat::menu_activated()
|
|||||||
|
|
||||||
void menu_cheat::populate()
|
void menu_cheat::populate()
|
||||||
{
|
{
|
||||||
|
const bool empty = mame_machine_manager::instance()->cheat().entries().empty();
|
||||||
|
|
||||||
// iterate over cheats
|
// iterate over cheats
|
||||||
std::string text;
|
if (!empty)
|
||||||
std::string subtext;
|
|
||||||
|
|
||||||
// add global enable toggle
|
|
||||||
item_append_on_off(_("Cheat Engine"), mame_machine_manager::instance()->cheat().enabled(), 0, (void *)ITEMREF_CHEATS_ENABLE);
|
|
||||||
item_append(menu_item_type::SEPARATOR);
|
|
||||||
|
|
||||||
// add cheats
|
|
||||||
if (!mame_machine_manager::instance()->cheat().entries().empty())
|
|
||||||
{
|
{
|
||||||
|
std::string text;
|
||||||
|
std::string subtext;
|
||||||
|
|
||||||
for (auto &curcheat : mame_machine_manager::instance()->cheat().entries())
|
for (auto &curcheat : mame_machine_manager::instance()->cheat().entries())
|
||||||
{
|
{
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
@ -150,17 +147,23 @@ void menu_cheat::populate()
|
|||||||
else
|
else
|
||||||
item_append(text, subtext, flags, curcheat.get());
|
item_append(text, subtext, flags, curcheat.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
item_append(menu_item_type::SEPARATOR);
|
|
||||||
|
|
||||||
// add a reset all option
|
|
||||||
item_append(_("Reset All"), 0, (void *)ITEMREF_CHEATS_RESET_ALL);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// indicate that none were found
|
// indicate that none were found
|
||||||
item_append(_("[no cheats found]"), FLAG_DISABLE, nullptr);
|
item_append(_("[no cheats found]"), FLAG_DISABLE, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
item_append(menu_item_type::SEPARATOR);
|
||||||
|
|
||||||
|
if (!empty)
|
||||||
|
{
|
||||||
|
// add global enable toggle
|
||||||
|
item_append_on_off(_("Enable Cheats"), mame_machine_manager::instance()->cheat().enabled(), 0, (void *)ITEMREF_CHEATS_ENABLE);
|
||||||
item_append(menu_item_type::SEPARATOR);
|
item_append(menu_item_type::SEPARATOR);
|
||||||
|
|
||||||
|
// add a reset all option
|
||||||
|
item_append(_("Reset All"), 0, (void *)ITEMREF_CHEATS_RESET_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a reload all cheats option
|
// add a reload all cheats option
|
||||||
|
Loading…
Reference in New Issue
Block a user