@@ -5828,79 +5828,87 @@ static int action_ok_core_options_flush(const char *path,
58285828 return 0 ;
58295829}
58305830
5831- int action_ok_close_content ( const char * path , const char * label , unsigned type , size_t idx , size_t entry_idx )
5831+ static int action_ok_dialog_init ( struct menu_state * menu_st )
58325832{
5833- int ret ;
5834- struct menu_state * menu_st = menu_state_get_ptr ();
5835- bool contentless_core = false;
5836-
5837- /* Reset navigation pointer
5838- * > If we are returning to the quick menu, want
5839- * the active entry to be 'Run' (first item in
5840- * menu list) */
5841- menu_st -> selection_ptr = 0 ;
5842-
5843- /* Check if we need to quit */
5844- if (should_quit_on_close ())
5845- return generic_action_ok_command (CMD_EVENT_QUIT );
5846-
5847- /* Otherwise, unload core */
5848- ret = generic_action_ok_command (CMD_EVENT_UNLOAD_CORE );
5849-
5850- /* If close content was selected via any means other than
5851- * 'Playlist > Quick Menu', have to flush the menu stack
5852- * (otherwise users will be presented with an empty
5853- * 'No items' quick menu, requiring needless backwards
5854- * navigation) */
5855- if (type == MENU_SETTING_ACTION_CLOSE )
5856- {
5857- const char * parent_label = NULL ;
5858- const char * flush_target = MENU_ENUM_LABEL_MAIN_MENU_STR ;
5859- file_list_t * list = NULL ;
5860- if (menu_st -> entries .list )
5861- list = MENU_LIST_GET (menu_st -> entries .list , 0 );
5862- if (list && (list -> size > 1 ))
5863- {
5864- parent_label = list -> list [list -> size - 2 ].label ;
5833+ menu_displaylist_info_t info ;
5834+ menu_list_t * menu_list = menu_st -> entries .list ;
5835+ file_list_t * menu_stack = MENU_LIST_GET (menu_list , 0 );
5836+ size_t selection = menu_st -> selection_ptr ;
5837+ settings_t * settings = config_get_ptr ();
5838+ #ifdef HAVE_AUDIOMIXER
5839+ bool audio_enable_menu = settings -> bools .audio_enable_menu ;
5840+ bool audio_enable_menu_notice = settings -> bools .audio_enable_menu_notice ;
5841+ #endif
58655842
5866- if ( string_is_equal (parent_label , MENU_ENUM_LABEL_CONTENTLESS_CORES_TAB_STR )
5867- || string_is_equal (parent_label , MENU_ENUM_LABEL_DEFERRED_CONTENTLESS_CORES_LIST_STR ))
5868- {
5869- flush_target = parent_label ;
5870- contentless_core = true;
5871- }
5872- }
5843+ menu_displaylist_info_init (& info );
5844+
5845+ info .list = menu_stack ;
5846+ info .directory_ptr = selection ;
5847+ info .enum_idx = MENU_ENUM_LABEL_INFO_SCREEN ;
5848+ info .label = strdup (MENU_ENUM_LABEL_INFO_SCREEN_STR );
5849+
5850+ if (!menu_displaylist_ctl (DISPLAYLIST_HELP , & info , settings ))
5851+ goto error ;
5852+
5853+ #ifdef HAVE_AUDIOMIXER
5854+ if (audio_enable_menu && audio_enable_menu_notice )
5855+ audio_driver_mixer_play_menu_sound (AUDIO_MIXER_SYSTEM_SLOT_NOTICE );
5856+ #endif
5857+
5858+ if (!menu_displaylist_process (& info ))
5859+ goto error ;
5860+
5861+ menu_displaylist_info_free (& info );
5862+ return 0 ;
5863+
5864+ error :
5865+ menu_displaylist_info_free (& info );
5866+ return -1 ;
5867+ }
5868+
5869+ int action_ok_quit (const char * path , const char * label , unsigned type , size_t idx , size_t entry_idx )
5870+ {
5871+ settings_t * settings = config_get_ptr ();
58735872
5874- menu_entries_flush_stack (flush_target , 0 );
5875- /* An annoyance - some menu drivers (Ozone...) set
5876- * MENU_ST_FLAG_PREVENT_POPULATE in awkward places,
5877- * which can cause breakage here when flushing
5878- * the menu stack. We therefore have to unset
5879- * MENU_ST_FLAG_PREVENT_POPULATE */
5880- menu_st -> flags &= ~MENU_ST_FLAG_PREVENT_POPULATE ;
5873+ if (settings -> bools .confirm_quit )
5874+ {
5875+ struct menu_state * menu_st = menu_state_get_ptr ();
5876+ menu_dialog_confirm_set (menu_st , MSG_PRESS_AGAIN_TO_QUIT , CMD_EVENT_QUIT );
5877+ return action_ok_dialog_init (menu_st );
58815878 }
5879+ return generic_action_ok_command (CMD_EVENT_QUIT );
5880+ }
58825881
5883- /* Single-click playlist return */
5884- if (config_get_ptr ()-> bools .input_menu_singleclick_playlists && !contentless_core )
5882+ int action_ok_restart_content (const char * path , const char * label , unsigned type , size_t idx , size_t entry_idx )
5883+ {
5884+ settings_t * settings = config_get_ptr ();
5885+
5886+ if (settings -> bools .confirm_reset )
58855887 {
5886- size_t new_selection = menu_st -> selection_ptr ;
5887- menu_entries_pop_stack (& new_selection , 0 , 0 );
5888- menu_st -> selection_ptr = new_selection ;
5889- menu_st -> flags &= ~MENU_ST_FLAG_PREVENT_POPULATE ;
5888+ struct menu_state * menu_st = menu_state_get_ptr ();
5889+ menu_dialog_confirm_set (menu_st , MSG_PRESS_AGAIN_TO_RESET , CMD_EVENT_RESET );
5890+ return action_ok_dialog_init (menu_st );
58905891 }
5892+ return generic_action_ok_command (CMD_EVENT_RESET );
5893+ }
58915894
5892- /* Try to reload last core if loaded manually */
5893- menu_st -> flags |= MENU_ST_FLAG_PENDING_RELOAD_CORE ;
5895+ int action_ok_close_content (const char * path , const char * label , unsigned type , size_t idx , size_t entry_idx )
5896+ {
5897+ settings_t * settings = config_get_ptr ();
58945898
5895- return ret ;
5899+ if (settings -> bools .confirm_close )
5900+ {
5901+ struct menu_state * menu_st = menu_state_get_ptr ();
5902+ menu_dialog_confirm_set (menu_st , MSG_PRESS_AGAIN_TO_CLOSE_CONTENT , CMD_EVENT_CLOSE_CONTENT );
5903+ return action_ok_dialog_init (menu_st );
5904+ }
5905+ return generic_action_ok_command (CMD_EVENT_CLOSE_CONTENT );
58965906}
58975907
58985908STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_cheat_apply_changes , CMD_EVENT_CHEATS_APPLY )
5899- STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_quit , CMD_EVENT_QUIT )
59005909STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_save_new_config , CMD_EVENT_MENU_SAVE_CONFIG )
59015910STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_save_main_config , CMD_EVENT_MENU_SAVE_MAIN_CONFIG )
59025911STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_resume_content , CMD_EVENT_RESUME )
5903- STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_restart_content , CMD_EVENT_RESET )
59045912STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_screenshot , CMD_EVENT_TAKE_SCREENSHOT )
59055913#if defined(HAVE_CG ) || defined(HAVE_GLSL ) || defined(HAVE_SLANG ) || defined(HAVE_HLSL )
59065914STATIC_DEFAULT_ACTION_OK_CMD_FUNC (action_ok_shader_apply_changes , CMD_EVENT_SHADERS_APPLY_CHANGES )
0 commit comments