diff --git a/.vscode/settings.json b/.vscode/settings.json index 88513c30c2..ed25459806 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,7 +12,8 @@ "files.associations": { "frontend_driver.h": "c", "*.in": "c", - "*.rh": "c" + "*.rh": "c", + "array": "c" }, "C_Cpp.dimInactiveRegions": false, } \ No newline at end of file diff --git a/command.c b/command.c index e0348ba6e1..91755ce343 100644 --- a/command.c +++ b/command.c @@ -1297,7 +1297,9 @@ static void command_event_restore_default_shader_preset(void) static void command_event_restore_remaps(void) { - if (rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_REMAPS_CORE_ACTIVE, NULL) || + rarch_ctl(RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, NULL) || + rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL)) input_remapping_set_defaults(true); } @@ -1520,6 +1522,7 @@ static void command_event_save_current_config(enum override_type type) break; case OVERRIDE_GAME: case OVERRIDE_CORE: + case OVERRIDE_CONTENT_DIR: if (config_save_overrides(type)) { strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_SAVED_SUCCESSFULLY), sizeof(msg)); @@ -2370,6 +2373,9 @@ TODO: Add a setting for these tweaks */ case CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE: command_event_save_current_config(OVERRIDE_CORE); break; + case CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR: + command_event_save_current_config(OVERRIDE_CONTENT_DIR); + break; case CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_GAME: command_event_save_current_config(OVERRIDE_GAME); break; diff --git a/command.h b/command.h index 139db92890..c59d938ee0 100644 --- a/command.h +++ b/command.h @@ -149,6 +149,7 @@ enum event_command CMD_EVENT_PAUSE_CHECKS, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE, + CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_GAME, CMD_EVENT_MENU_SAVE_CONFIG, CMD_EVENT_MENU_PAUSE_LIBRETRO, diff --git a/config.def.h b/config.def.h index f33198cd4c..43dc409f22 100644 --- a/config.def.h +++ b/config.def.h @@ -261,10 +261,12 @@ static bool quick_menu_show_options = true; static bool quick_menu_show_controls = true; static bool quick_menu_show_cheats = true; static bool quick_menu_show_shaders = true; -static bool quick_menu_show_save_core_overrides = true; -static bool quick_menu_show_save_game_overrides = true; static bool quick_menu_show_information = true; +static bool quick_menu_show_save_core_overrides = true; +static bool quick_menu_show_save_game_overrides = true; +static bool quick_menu_show_save_content_dir_overrides = true; + static bool kiosk_mode_enable = false; static bool menu_show_online_updater = true; diff --git a/configuration.c b/configuration.c index 4f1da3310b..661c2eba17 100644 --- a/configuration.c +++ b/configuration.c @@ -1299,6 +1299,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("quick_menu_show_shaders", &settings->bools.quick_menu_show_shaders, true, quick_menu_show_shaders, false); SETTING_BOOL("quick_menu_show_save_core_overrides", &settings->bools.quick_menu_show_save_core_overrides, true, quick_menu_show_save_core_overrides, false); SETTING_BOOL("quick_menu_show_save_game_overrides", &settings->bools.quick_menu_show_save_game_overrides, true, quick_menu_show_save_game_overrides, false); + SETTING_BOOL("quick_menu_show_save_content_dir_overrides", &settings->bools.quick_menu_show_save_content_dir_overrides, true, quick_menu_show_save_content_dir_overrides, false); SETTING_BOOL("quick_menu_show_information", &settings->bools.quick_menu_show_information, true, quick_menu_show_information, false); SETTING_BOOL("kiosk_mode_enable", &settings->bools.kiosk_mode_enable, true, kiosk_mode_enable, false); SETTING_BOOL("content_show_settings", &settings->bools.menu_content_show_settings, true, content_show_settings, false); @@ -2940,6 +2941,7 @@ bool config_load_override(void) char *buf = NULL; char *core_path = NULL; char *game_path = NULL; + char *content_path = NULL; char *config_directory = NULL; config_file_t *new_conf = NULL; bool should_append = false; @@ -2947,6 +2949,10 @@ bool config_load_override(void) const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; + + if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -2955,6 +2961,8 @@ bool config_load_override(void) malloc(PATH_MAX_LENGTH * sizeof(char)); core_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); + content_path = (char*) + malloc(PATH_MAX_LENGTH * sizeof(char)); buf = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); config_directory = (char*) @@ -2964,23 +2972,29 @@ bool config_load_override(void) fill_pathname_application_special(config_directory, path_size, APPLICATION_SPECIAL_DIRECTORY_CONFIG); - /* Concatenate strings into full paths for core_path, game_path */ + /* Concatenate strings into full paths for core_path, game_path, content_path */ fill_pathname_join_special_ext(game_path, config_directory, core_name, game_name, file_path_str(FILE_PATH_CONFIG_EXTENSION), path_size); + fill_pathname_join_special_ext(content_path, + config_directory, core_name, + content_dir_name, + file_path_str(FILE_PATH_CONFIG_EXTENSION), + path_size); + fill_pathname_join_special_ext(core_path, config_directory, core_name, core_name, file_path_str(FILE_PATH_CONFIG_EXTENSION), path_size); + /* per-core overrides */ /* Create a new config file from core_path */ new_conf = config_file_new(core_path); - /* If a core override exists, add its location to append_config_path */ if (new_conf) { RARCH_LOG("[overrides] core-specific overrides found at %s.\n", @@ -2995,10 +3009,45 @@ bool config_load_override(void) RARCH_LOG("[overrides] no core-specific overrides found at %s.\n", core_path); + /* per-content-dir overrides */ + /* Create a new config file from content_path */ + new_conf = config_file_new(content_path); + + if (new_conf) + { + char *temp_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); + + temp_path[0] = '\0'; + + config_file_free(new_conf); + + RARCH_LOG("[overrides] content-dir-specific overrides found at %s.\n", + game_path); + + if (should_append) + { + RARCH_LOG("[overrides] content-dir-specific overrides stacking on top of previous overrides.\n"); + strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), path_size); + strlcat(temp_path, "|", path_size); + strlcat(temp_path, content_path, path_size); + } + else + strlcpy(temp_path, content_path, path_size); + + path_set(RARCH_PATH_CONFIG_APPEND, temp_path); + + free(temp_path); + + should_append = true; + } + else + RARCH_LOG("[overrides] no content-dir-specific overrides found at %s.\n", + content_path); + + /* per-game overrides */ /* Create a new config file from game_path */ new_conf = config_file_new(game_path); - /* If a game override exists, add it's location to append_config_path */ if (new_conf) { char *temp_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); @@ -3012,6 +3061,7 @@ bool config_load_override(void) if (should_append) { + RARCH_LOG("[overrides] game-specific overrides stacking on top of previous overrides\n"); strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), path_size); strlcat(temp_path, "|", path_size); strlcat(temp_path, game_path, path_size); @@ -3062,6 +3112,7 @@ bool config_load_override(void) free(buf); free(config_directory); free(core_path); + free(content_path); free(game_path); return true; @@ -3069,6 +3120,7 @@ error: free(buf); free(config_directory); free(core_path); + free(content_path); free(game_path); return false; } @@ -3120,11 +3172,16 @@ bool config_load_remap(void) char *remap_directory = NULL; char *core_path = NULL; char *game_path = NULL; + char *content_path = NULL; config_file_t *new_conf = NULL; settings_t *settings = config_get_ptr(); rarch_system_info_t *system = runloop_get_system_info(); const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; + + if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -3143,8 +3200,12 @@ bool config_load_remap(void) /* final path for game-specific configuration (prefix+suffix) */ game_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); + /* final path for content-dir-specific configuration (prefix+suffix) */ + content_path = (char*) + malloc(PATH_MAX_LENGTH * sizeof(char)); remap_directory[0] = core_path[0] = game_path[0] = '\0'; + strlcpy(remap_directory, settings->paths.directory_input_remapping, path_size); @@ -3157,6 +3218,12 @@ bool config_load_remap(void) file_path_str(FILE_PATH_REMAP_EXTENSION), path_size); + fill_pathname_join_special_ext(content_path, + remap_directory, core_name, + content_dir_name, + file_path_str(FILE_PATH_REMAP_EXTENSION), + path_size); + fill_pathname_join_special_ext(game_path, remap_directory, core_name, game_name, @@ -3184,6 +3251,28 @@ bool config_load_remap(void) input_remapping_set_defaults(false); } + /* Create a new config file from content_path */ + new_conf = config_file_new(content_path); + + /* If a content-dir remap file exists, load it. */ + if (new_conf) + { + RARCH_LOG("Remaps: content-dir-specific remap found at %s.\n", content_path); + if (input_remapping_load_file(new_conf, content_path)) + { + runloop_msg_queue_push(msg_hash_to_str( + MSG_GAME_REMAP_FILE_LOADED), 1, 100, true); + rarch_ctl(RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE, NULL); + goto success; + } + } + else + { + RARCH_LOG("Remaps: no content-dir-specific remap found at %s.\n", content_path); + input_remapping_set_defaults(false); + } + + /* Create a new config file from core_path */ new_conf = config_file_new(core_path); @@ -3235,21 +3324,21 @@ success: bool config_load_shader_preset(void) { unsigned idx; - char parent_name[PATH_MAX_LENGTH]; size_t path_size = PATH_MAX_LENGTH * sizeof(char); config_file_t *new_conf = NULL; char *shader_directory = NULL; char *core_path = NULL; char *game_path = NULL; - char *parent_path = NULL; + char *content_path = NULL; settings_t *settings = config_get_ptr(); rarch_system_info_t *system = runloop_get_system_info(); const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) - fill_pathname_parent_dir_name(parent_name, path_get(RARCH_PATH_BASENAME), sizeof(parent_name)); + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -3269,7 +3358,7 @@ bool config_load_shader_preset(void) game_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); /* final path for parent-dir-specific configuration (prefix+suffix) */ - parent_path = (char*) + content_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); shader_directory[0] = core_path[0] = game_path[0] = '\0'; @@ -3320,26 +3409,26 @@ bool config_load_shader_preset(void) if (!check_shader_compatibility((enum file_path_enum)(idx))) continue; /* Concatenate strings into full paths for core_path, parent path */ - fill_pathname_join_special_ext(parent_path, + fill_pathname_join_special_ext(content_path, shader_directory, core_name, - parent_name, + content_dir_name, file_path_str((enum file_path_enum)(idx)), path_size); /* Create a new config file from parent path */ - new_conf = config_file_new(parent_path); + new_conf = config_file_new(content_path); if (!new_conf) { - RARCH_LOG("Shaders: no parent-dir-specific preset found at %s.\n", - parent_path); + RARCH_LOG("Shaders: no content-dir-specific preset found at %s.\n", + content_path); continue; } /* Parent-dir shader preset exists, load it. */ - RARCH_LOG("Shaders: parent-dir-specific shader preset found at %s.\n", - parent_path); - retroarch_set_shader_preset(parent_path); + RARCH_LOG("Shaders: content-dir-specific shader preset found at %s.\n", + content_path); + retroarch_set_shader_preset(content_path); goto success; } @@ -3374,14 +3463,14 @@ bool config_load_shader_preset(void) free(shader_directory); free(core_path); free(game_path); - free(parent_path); + free(content_path); return false; success: free(shader_directory); free(core_path); free(game_path); - free(parent_path); + free(content_path); config_file_free(new_conf); return true; } @@ -4036,6 +4125,7 @@ bool config_save_overrides(int override_type) char *override_directory = NULL; char *core_path = NULL; char *game_path = NULL; + char *content_path = NULL; settings_t *overrides = config_get_ptr(); int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder); int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder); @@ -4046,6 +4136,10 @@ bool config_save_overrides(int override_type) rarch_system_info_t *system = runloop_get_system_info(); const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; + + if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -4055,6 +4149,7 @@ bool config_save_overrides(int override_type) override_directory = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); core_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); game_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); + content_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); config_directory[0] = override_directory[0] = core_path[0] = game_path[0] = '\0'; @@ -4074,6 +4169,12 @@ bool config_save_overrides(int override_type) file_path_str(FILE_PATH_CONFIG_EXTENSION), path_size); + fill_pathname_join_special_ext(content_path, + config_directory, core_name, + content_dir_name, + file_path_str(FILE_PATH_CONFIG_EXTENSION), + path_size); + fill_pathname_join_special_ext(core_path, config_directory, core_name, core_name, @@ -4237,6 +4338,11 @@ bool config_save_overrides(int override_type) RARCH_LOG ("[overrides] path %s\n", game_path); ret = config_file_write(conf, game_path); break; + case OVERRIDE_CONTENT_DIR: + /* Create a new config file from content_path */ + RARCH_LOG ("[overrides] path %s\n", content_path); + ret = config_file_write(conf, content_path); + break; default: break; } diff --git a/configuration.h b/configuration.h index d55220c532..659b8a34ed 100644 --- a/configuration.h +++ b/configuration.h @@ -57,6 +57,7 @@ enum override_type { OVERRIDE_NONE = 0, OVERRIDE_CORE, + OVERRIDE_CONTENT_DIR, OVERRIDE_GAME }; @@ -177,6 +178,7 @@ typedef struct settings bool quick_menu_show_shaders; bool quick_menu_show_save_core_overrides; bool quick_menu_show_save_game_overrides; + bool quick_menu_show_save_content_dir_overrides; bool quick_menu_show_information; bool kiosk_mode_enable; diff --git a/input/input_remapping.c b/input/input_remapping.c index f92eb20d86..32e9875168 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -288,6 +288,7 @@ void input_remapping_set_defaults(bool deinit) free(global->name.remapfile); global->name.remapfile = NULL; rarch_ctl(RARCH_CTL_UNSET_REMAPS_CORE_ACTIVE, NULL); + rarch_ctl(RARCH_CTL_UNSET_REMAPS_CONTENT_DIR_ACTIVE, NULL); rarch_ctl(RARCH_CTL_UNSET_REMAPS_GAME_ACTIVE, NULL); } diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 9c4465010e..bb14f47a50 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3470,7 +3470,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index c1a4154814..f9f2698dc3 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3256,7 +3256,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 669fa55cf7..ec004b062d 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3248,7 +3248,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 293b71a5eb..5782efe320 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3362,7 +3362,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index c40ecc566f..365592d0ef 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3121,7 +3121,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 9408e50b9f..0a654abef0 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -5854,7 +5854,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index f9d6684c83..0f49a897e0 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3286,7 +3286,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 2cf2e7836a..12deade1a0 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3498,7 +3498,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SUGGEST_LOADED_CORE_FIRST, "ロードしたコアを最初に優先する") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 35de308d55..5a67c3274d 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3247,7 +3247,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 75f7e22614..34c9bbcd1d 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -897,8 +897,12 @@ MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_LOAD, "remap_file_load") MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE, "remap_file_save_core") +MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR, + "remap_file_save_content_dir") MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME, "remap_file_save_game") +MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CONTENT_DIR, + "remap_file_remove_content_dir") MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CORE, "remap_file_remove_core") MSG_HASH(MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME, @@ -955,6 +959,8 @@ MSG_HASH(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG, "save_current_config") MSG_HASH(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE, "save_current_config_override_core") +MSG_HASH(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, + "save_current_config_override_content_dir") MSG_HASH(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME, "save_current_config_override_game") MSG_HASH(MENU_ENUM_LABEL_SAVE_NEW_CONFIG, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index d189d99eb2..461633672f 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3123,7 +3123,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 67482a31ba..78dfaeff48 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3482,7 +3482,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index be121f7edf..2722b79837 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3221,7 +3221,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 18e27c79a6..0278c538b2 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3305,7 +3305,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index ecba60e6bf..3b843e4910 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1343,12 +1343,16 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_LOAD, "Load Remap File") MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CORE, "Save Core Remap File") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CONTENT_DIR, + "Save Content Directory Remap File") MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_GAME, "Save Game Remap File") MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_REMOVE_CORE, "Delete Core Remap File") MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_REMOVE_GAME, "Delete Game Remap File") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_REMOVE_CONTENT_DIR, + "Delete Game Content Directory Remap File") MSG_HASH(MENU_ENUM_LABEL_VALUE_REQUIRED, "Required") MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_CONTENT, @@ -1409,6 +1413,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG, "Save Current Configuration") MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CORE, "Save Core Overrides") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, + "Save Content Directory Overrides") MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_GAME, "Save Game Overrides") MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_NEW_CONFIG, @@ -3075,6 +3081,8 @@ MSG_HASH(MENU_ENUM_SUBLABEL_RESTART_CONTENT, "Restarts the content from the beginning.") MSG_HASH(MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE, "Saves an override configuration file which will apply for all content loaded with this core. Will take precedence over the main configuration.") +MSG_HASH(MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, + "Saves an override configuration file which will apply for all content loaded from the same directory as the current file. Will take precedence over the main configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME, "Saves an override configuration file which will apply for the current content only. Will take precedence over the main configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_CORE_CHEAT_OPTIONS, @@ -3669,7 +3677,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SUGGEST_LOADED_CORE_FIRST, "Suggest loaded core first") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 7296049ee5..e92c734a9d 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3278,7 +3278,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS, MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS, "View and/or modify audio mixer settings.") MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS, - "Configuration Override options") + "Overrides") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS, "Options for overriding the global configuration.") MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_PLAY, diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 7444c9a305..57b8da22c9 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -93,8 +93,10 @@ enum enum { ACTION_OK_REMAP_FILE_SAVE_CORE = 0, + ACTION_OK_REMAP_FILE_SAVE_CONTENT_DIR, ACTION_OK_REMAP_FILE_SAVE_GAME, ACTION_OK_REMAP_FILE_REMOVE_CORE, + ACTION_OK_REMAP_FILE_REMOVE_CONTENT_DIR, ACTION_OK_REMAP_FILE_REMOVE_GAME }; @@ -2309,6 +2311,7 @@ static int generic_action_ok_remap_file_operation(const char *path, { char directory[PATH_MAX_LENGTH]; char file[PATH_MAX_LENGTH]; + char content_dir[PATH_MAX_LENGTH]; settings_t *settings = config_get_ptr(); const char *core_name = NULL; rarch_system_info_t *info = runloop_get_system_info(); @@ -2338,6 +2341,15 @@ static int generic_action_ok_remap_file_operation(const char *path, fill_pathname_join(file, core_name, path_basename(path_get(RARCH_PATH_BASENAME)), sizeof(file)); break; + case ACTION_OK_REMAP_FILE_SAVE_CONTENT_DIR: + case ACTION_OK_REMAP_FILE_REMOVE_CONTENT_DIR: + if (!string_is_empty(core_name)) + { + fill_pathname_parent_dir_name(content_dir, path_get(RARCH_PATH_BASENAME), sizeof(content_dir)); + fill_pathname_join(file, core_name, + content_dir, sizeof(file)); + } + break; } if (!filestream_exists(directory)) @@ -2351,6 +2363,8 @@ static int generic_action_ok_remap_file_operation(const char *path, rarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL); else if (action_type == ACTION_OK_REMAP_FILE_SAVE_GAME) rarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL); + else if (action_type == ACTION_OK_REMAP_FILE_SAVE_CONTENT_DIR) + rarch_ctl(RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE, NULL); runloop_msg_queue_push( msg_hash_to_str(MSG_REMAP_FILE_SAVED_SUCCESSFULLY), @@ -2379,6 +2393,13 @@ static int generic_action_ok_remap_file_operation(const char *path, input_remapping_set_defaults(true); } + else if (action_type == ACTION_OK_REMAP_FILE_REMOVE_CONTENT_DIR && + rarch_ctl(RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, NULL)) + { + rarch_ctl(RARCH_CTL_UNSET_REMAPS_CONTENT_DIR_ACTIVE, NULL); + input_remapping_set_defaults(true); + } + runloop_msg_queue_push( msg_hash_to_str(MSG_REMAP_FILE_REMOVED_SUCCESSFULLY), 1, 100, true); @@ -2398,6 +2419,13 @@ static int action_ok_remap_file_save_core(const char *path, idx, entry_idx, ACTION_OK_REMAP_FILE_SAVE_CORE); } +static int action_ok_remap_file_save_content_dir(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + return generic_action_ok_remap_file_operation(path, label, type, + idx, entry_idx, ACTION_OK_REMAP_FILE_SAVE_CONTENT_DIR); +} + static int action_ok_remap_file_save_game(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -2412,6 +2440,13 @@ static int action_ok_remap_file_remove_core(const char *path, idx, entry_idx, ACTION_OK_REMAP_FILE_REMOVE_CORE); } +static int action_ok_remap_file_remove_content_dir(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + return generic_action_ok_remap_file_operation(path, label, type, + idx, entry_idx, ACTION_OK_REMAP_FILE_REMOVE_CONTENT_DIR); +} + static int action_ok_remap_file_remove_game(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -4522,12 +4557,18 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE: BIND_ACTION_OK(cbs, action_ok_remap_file_save_core); break; + case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR: + BIND_ACTION_OK(cbs, action_ok_remap_file_save_content_dir); + break; case MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME: BIND_ACTION_OK(cbs, action_ok_remap_file_save_game); break; case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CORE: BIND_ACTION_OK(cbs, action_ok_remap_file_remove_core); break; + case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CONTENT_DIR: + BIND_ACTION_OK(cbs, action_ok_remap_file_remove_content_dir); + break; case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME: BIND_ACTION_OK(cbs, action_ok_remap_file_remove_game); break; @@ -4744,6 +4785,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, case MENU_LABEL_REMAP_FILE_SAVE_CORE: BIND_ACTION_OK(cbs, action_ok_remap_file_save_core); break; + case MENU_LABEL_REMAP_FILE_SAVE_CONTENT_DIR: + BIND_ACTION_OK(cbs, action_ok_remap_file_save_content_dir); + break; case MENU_LABEL_REMAP_FILE_SAVE_GAME: BIND_ACTION_OK(cbs, action_ok_remap_file_save_game); break; diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index e785900ef7..6cd136b960 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -299,6 +299,8 @@ default_sublabel_macro(action_bind_sublabel_accounts_list, default_sublabel_macro(action_bind_sublabel_input_meta_rewind, MENU_ENUM_SUBLABEL_INPUT_META_REWIND) default_sublabel_macro(action_bind_sublabel_restart_content, MENU_ENUM_SUBLABEL_RESTART_CONTENT) default_sublabel_macro(action_bind_sublabel_save_current_config_override_core, MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE) +default_sublabel_macro(action_bind_sublabel_save_current_config_override_content_dir, + MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR) default_sublabel_macro(action_bind_sublabel_save_current_config_override_game, MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME) default_sublabel_macro(action_bind_sublabel_core_cheat_options, MENU_ENUM_SUBLABEL_CORE_CHEAT_OPTIONS) default_sublabel_macro(action_bind_sublabel_shader_options, MENU_ENUM_SUBLABEL_SHADER_OPTIONS) @@ -1038,6 +1040,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_save_current_config_override_core); break; + case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_save_current_config_override_content_dir); + break; case MENU_ENUM_LABEL_RESTART_CONTENT: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_restart_content); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index c4b9024823..d73bbaaa73 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2225,6 +2225,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, case MENU_ENUM_LABEL_RESUME_CONTENT: return xmb->textures.list[XMB_TEXTURE_RESUME]; case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE: + case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR: case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME: return xmb->textures.list[XMB_TEXTURE_SAVESTATE]; case MENU_ENUM_LABEL_FAVORITES: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 91451275a7..91c025cd2d 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3206,6 +3206,11 @@ static int menu_displaylist_parse_options_remappings( msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE), MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE, MENU_SETTING_ACTION, 0, 0); + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CONTENT_DIR), + msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR), + MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR, + MENU_SETTING_ACTION, 0, 0); menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_GAME), msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME), @@ -3230,6 +3235,15 @@ static int menu_displaylist_parse_options_remappings( MENU_SETTING_ACTION, 0, 0); } + if (rarch_ctl(RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, NULL)) + { + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_REMOVE_CONTENT_DIR), + msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CONTENT_DIR), + MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CONTENT_DIR, + MENU_SETTING_ACTION, 0, 0); + } + system = runloop_get_system_info(); if (system) @@ -6556,6 +6570,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) count++; } + if (settings->bools.quick_menu_show_save_content_dir_overrides + && !settings->bools.kiosk_mode_enable) + { + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR), + msg_hash_to_str(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR), + MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, + MENU_SETTING_ACTION, 0, 0); + count++; + } + if (settings->bools.quick_menu_show_save_game_overrides && !settings->bools.kiosk_mode_enable) { @@ -6566,6 +6591,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_SETTING_ACTION, 0, 0); count++; } + } if (count == 0) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index cc41f1647d..855a74d309 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2167,6 +2167,16 @@ static bool setting_append_list( menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE); settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED); + CONFIG_ACTION( + list, list_info, + MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, + MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, + &group_info, + &subgroup_info, + parent_group); + menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED); + CONFIG_ACTION( list, list_info, MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME, diff --git a/msg_hash.h b/msg_hash.h index d111f05478..b1b18f80e4 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1548,8 +1548,10 @@ enum msg_hash_enums MENU_ENUM_LABEL_OSK_ENABLE, MENU_LABEL(REMAP_FILE_SAVE_CORE), + MENU_LABEL(REMAP_FILE_SAVE_CONTENT_DIR), MENU_LABEL(REMAP_FILE_SAVE_GAME), MENU_LABEL(REMAP_FILE_REMOVE_CORE), + MENU_LABEL(REMAP_FILE_REMOVE_CONTENT_DIR), MENU_LABEL(REMAP_FILE_REMOVE_GAME), MENU_LABEL(RESTART_CONTENT), MENU_LABEL(RESUME), @@ -1741,6 +1743,7 @@ enum msg_hash_enums MENU_LABEL(SAVE_CURRENT_CONFIG), MENU_LABEL(SAVE_CURRENT_CONFIG_OVERRIDE_CORE), + MENU_LABEL(SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR), MENU_LABEL(SAVE_CURRENT_CONFIG_OVERRIDE_GAME), MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_BOXARTS, @@ -2051,6 +2054,7 @@ enum msg_hash_enums #define MENU_LABEL_CUSTOM_BIND_DEFAULTS 0xe88f7b13U #define MENU_LABEL_CONFIGURATIONS 0x3e930a50U #define MENU_LABEL_REMAP_FILE_SAVE_CORE 0x7c9d4c8fU +#define MENU_LABEL_REMAP_FILE_SAVE_CONTENT_DIR 0x7b99c1ffU #define MENU_LABEL_REMAP_FILE_SAVE_GAME 0x7c9f41e0U #define MENU_LABEL_CONTENT_COLLECTION_LIST 0x32d1df83U #define MENU_LABEL_COLLECTION 0x5fea5991U diff --git a/retroarch.c b/retroarch.c index cecf1ddbfd..e26f3128a9 100644 --- a/retroarch.c +++ b/retroarch.c @@ -236,6 +236,7 @@ static bool runloop_perfcnt_enable = false; static bool runloop_overrides_active = false; static bool runloop_remaps_core_active = false; static bool runloop_remaps_game_active = false; +static bool runloop_remaps_content_dir_active = false; static bool runloop_game_options_active = false; static bool runloop_missing_bios = false; static bool runloop_autosave = false; @@ -348,6 +349,7 @@ static void global_free(void) runloop_overrides_active = false; runloop_remaps_core_active = false; runloop_remaps_game_active = false; + runloop_remaps_content_dir_active = false; core_unset_input_descriptors(); @@ -1701,6 +1703,14 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) break; case RARCH_CTL_IS_REMAPS_GAME_ACTIVE: return runloop_remaps_game_active; + case RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE: + runloop_remaps_content_dir_active = true; + break; + case RARCH_CTL_UNSET_REMAPS_CONTENT_DIR_ACTIVE: + runloop_remaps_content_dir_active = false; + break; + case RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE: + return runloop_remaps_content_dir_active; case RARCH_CTL_SET_MISSING_BIOS: runloop_missing_bios = true; break; diff --git a/retroarch.h b/retroarch.h index 02abfae515..1635c83de8 100644 --- a/retroarch.h +++ b/retroarch.h @@ -100,6 +100,10 @@ enum rarch_ctl_state RARCH_CTL_SET_REMAPS_CORE_ACTIVE, RARCH_CTL_UNSET_REMAPS_CORE_ACTIVE, + RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, + RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE, + RARCH_CTL_UNSET_REMAPS_CONTENT_DIR_ACTIVE, + RARCH_CTL_IS_REMAPS_GAME_ACTIVE, RARCH_CTL_SET_REMAPS_GAME_ACTIVE, RARCH_CTL_UNSET_REMAPS_GAME_ACTIVE,