mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Add option to remain in menu after saving/loading states
This commit is contained in:
parent
46c80632f3
commit
248432ebcf
@ -340,6 +340,12 @@ static bool menu_show_sublabels = true;
|
||||
static unsigned menu_ticker_type = TICKER_TYPE_BOUNCE;
|
||||
static float menu_ticker_speed = 1.0f;
|
||||
|
||||
#if defined(HAVE_THREADS)
|
||||
static bool menu_savestate_resume = true;
|
||||
#else
|
||||
static bool menu_savestate_resume = false;
|
||||
#endif
|
||||
|
||||
static bool content_show_settings = true;
|
||||
static bool content_show_favorites = true;
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
|
@ -1442,6 +1442,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, true, false);
|
||||
SETTING_BOOL("dpi_override_enable", &settings->bools.menu_dpi_override_enable, true, menu_dpi_override_enable, false);
|
||||
SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false);
|
||||
SETTING_BOOL("menu_savestate_resume", &settings->bools.menu_savestate_resume, true, menu_savestate_resume, false);
|
||||
SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false);
|
||||
SETTING_BOOL("menu_pointer_enable", &settings->bools.menu_pointer_enable, true, DEFAULT_POINTER_ENABLE, false);
|
||||
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, true, false);
|
||||
|
@ -144,6 +144,7 @@ typedef struct settings
|
||||
bool menu_enable_widgets;
|
||||
bool menu_show_start_screen;
|
||||
bool menu_pause_libretro;
|
||||
bool menu_savestate_resume;
|
||||
bool menu_timedate_enable;
|
||||
bool menu_battery_level_enable;
|
||||
bool menu_core_enable;
|
||||
|
@ -855,6 +855,8 @@ MSG_HASH(MENU_ENUM_LABEL_PARENT_DIRECTORY,
|
||||
"parent_directory")
|
||||
MSG_HASH(MENU_ENUM_LABEL_PAUSE_LIBRETRO,
|
||||
"menu_pause_libretro")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MENU_SAVESTATE_RESUME,
|
||||
"menu_savestate_resume")
|
||||
MSG_HASH(MENU_ENUM_LABEL_PAUSE_NONACTIVE,
|
||||
"pause_nonactive")
|
||||
MSG_HASH(MENU_ENUM_LABEL_PERFCNT_ENABLE,
|
||||
|
@ -2132,6 +2132,14 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PAUSE_LIBRETRO,
|
||||
"Pause when menu activated"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_SAVESTATE_RESUME,
|
||||
"Resume content after using save states"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_SAVESTATE_RESUME,
|
||||
"Automatically close menu and resume current content after selecting 'Save State' or 'Load State' from the Quick Menu. Disabling this can improve save state performance on very slow devices."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE,
|
||||
"Don't run in background"
|
||||
|
@ -3315,27 +3315,37 @@ static int action_ok_file_load_detect_core(const char *path,
|
||||
static int action_ok_load_state(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool resume = true;
|
||||
|
||||
if (settings)
|
||||
resume = settings->bools.menu_savestate_resume;
|
||||
|
||||
if (generic_action_ok_command(CMD_EVENT_LOAD_STATE) == -1)
|
||||
return menu_cbs_exit();
|
||||
/* TODO/FIXME: Make this a user-configurable option */
|
||||
#if defined(HAVE_THREADS)
|
||||
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||
#else
|
||||
|
||||
if (resume)
|
||||
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int action_ok_save_state(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool resume = true;
|
||||
|
||||
if (settings)
|
||||
resume = settings->bools.menu_savestate_resume;
|
||||
|
||||
if (generic_action_ok_command(CMD_EVENT_SAVE_STATE) == -1)
|
||||
return menu_cbs_exit();
|
||||
/* TODO/FIXME: Make this a user-configurable option */
|
||||
#if defined(HAVE_THREADS)
|
||||
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||
#else
|
||||
|
||||
if (resume)
|
||||
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int action_ok_cheevos_toggle_hardcore_mode(const char *path,
|
||||
|
@ -314,6 +314,7 @@ default_sublabel_macro(action_bind_sublabel_input_remap_binds_enable, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_input_autodetect_enable, MENU_ENUM_SUBLABEL_INPUT_AUTODETECT_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_input_swap_ok_cancel, MENU_ENUM_SUBLABEL_MENU_INPUT_SWAP_OK_CANCEL)
|
||||
default_sublabel_macro(action_bind_sublabel_pause_libretro, MENU_ENUM_SUBLABEL_PAUSE_LIBRETRO)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_savestate_resume, MENU_ENUM_SUBLABEL_MENU_SAVESTATE_RESUME)
|
||||
default_sublabel_macro(action_bind_sublabel_video_driver, MENU_ENUM_SUBLABEL_VIDEO_DRIVER)
|
||||
default_sublabel_macro(action_bind_sublabel_audio_driver, MENU_ENUM_SUBLABEL_AUDIO_DRIVER)
|
||||
default_sublabel_macro(action_bind_sublabel_input_driver, MENU_ENUM_SUBLABEL_INPUT_DRIVER)
|
||||
@ -1861,6 +1862,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_PAUSE_LIBRETRO:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_pause_libretro);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_SAVESTATE_RESUME:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_savestate_resume);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_INPUT_SWAP_OK_CANCEL:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_swap_ok_cancel);
|
||||
break;
|
||||
|
@ -4064,6 +4064,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
{MENU_ENUM_LABEL_MENU_KIOSK_MODE_PASSWORD, PARSE_ONLY_STRING},
|
||||
{MENU_ENUM_LABEL_NAVIGATION_WRAPAROUND, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_PAUSE_LIBRETRO, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_MENU_SAVESTATE_RESUME, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_MOUSE_ENABLE, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_POINTER_ENABLE, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_THREADED_DATA_RUNLOOP_ENABLE, PARSE_ONLY_BOOL },
|
||||
|
@ -11086,6 +11086,22 @@ static bool setting_append_list(
|
||||
menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_MENU_PAUSE_LIBRETRO);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_savestate_resume,
|
||||
MENU_ENUM_LABEL_MENU_SAVESTATE_RESUME,
|
||||
MENU_ENUM_LABEL_VALUE_MENU_SAVESTATE_RESUME,
|
||||
menu_savestate_resume,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_ADVANCED
|
||||
);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_mouse_enable,
|
||||
|
@ -1312,6 +1312,7 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_PAUSE_TOGGLE,
|
||||
|
||||
MENU_LABEL(PAUSE_LIBRETRO),
|
||||
MENU_LABEL(MENU_SAVESTATE_RESUME),
|
||||
MENU_LABEL(DIRECTORY_NOT_FOUND),
|
||||
MENU_LABEL(NO_ITEMS),
|
||||
MENU_LABEL(NO_PLAYLISTS),
|
||||
|
Loading…
x
Reference in New Issue
Block a user