(Menu) Quick Menu - Cheats - Delete All no longer requires five

right button presses - this should fix this functionality for mobile
touch users too
This commit is contained in:
twinaphex 2019-12-24 05:13:24 +01:00
parent 45db2122c9
commit f47b07e35a
2 changed files with 13 additions and 30 deletions

View File

@ -3469,11 +3469,21 @@ static int action_ok_cheat_add_bottom(const char *path,
static int action_ok_cheat_delete_all(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
char msg[256] ;
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_DELETE_ALL_INSTRUCTIONS), sizeof(msg));
bool refresh = false;
char msg[256];
msg[0] = '\0';
cheat_manager_state.delete_state = 0 ;
cheat_manager_realloc(0, CHEAT_HANDLER_TYPE_EMU) ;
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
strlcpy(msg,
msg_hash_to_str(MSG_CHEAT_DELETE_ALL_SUCCESS), sizeof(msg));
msg[sizeof(msg) - 1] = 0;
runloop_msg_queue_push(msg, 1, 240, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
return 0 ;
}

View File

@ -285,30 +285,6 @@ static int action_right_mainmenu(unsigned type, const char *label,
return 0;
}
static int action_right_cheat_delete_all(unsigned type, const char *label,
bool wraparound)
{
bool refresh = false ;
char msg[256];
if ( ++cheat_manager_state.delete_state >= 5 )
{
msg[0] = '\0';
cheat_manager_state.delete_state = 0 ;
cheat_manager_realloc(0, CHEAT_HANDLER_TYPE_EMU) ;
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
strlcpy(msg,
msg_hash_to_str(MSG_CHEAT_DELETE_ALL_SUCCESS), sizeof(msg));
msg[sizeof(msg) - 1] = 0;
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
}
return 0;
}
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
static int action_right_shader_scale_pass(unsigned type, const char *label,
bool wraparound)
@ -965,9 +941,6 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM:
BIND_ACTION_RIGHT(cbs, action_right_mainmenu);
break;
case MENU_ENUM_LABEL_CHEAT_DELETE_ALL:
BIND_ACTION_RIGHT(cbs, action_right_cheat_delete_all);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_SCALE_PASS:
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
BIND_ACTION_RIGHT(cbs, action_right_shader_scale_pass);