diff --git a/menu/intl/menu_hash_us.c b/menu/intl/menu_hash_us.c index b7a7c58c37..683a711ed4 100644 --- a/menu/intl/menu_hash_us.c +++ b/menu/intl/menu_hash_us.c @@ -1036,6 +1036,8 @@ const char *menu_hash_to_str_us(uint32_t hash) return "Use per-game core options if available"; case MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE: return "Create game-options file"; + case MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_IN_USE: + return "Game-options file"; case MENU_LABEL_VALUE_AUTO_OVERRIDES_ENABLE: return "Load Override Files Automatically"; case MENU_LABEL_VALUE_CONFIG_SAVE_ON_EXIT: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index c95e577799..90135940d2 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3070,9 +3070,18 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type) if (settings->game_specific_options) { - menu_entries_push(info->list, - menu_hash_to_str(MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE), "", - MENU_SETTINGS_CORE_OPTION_CREATE, 0, 0); + if (!runloop_ctl(RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE, NULL)) + { + menu_entries_push(info->list, + menu_hash_to_str(MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE), "", + MENU_SETTINGS_CORE_OPTION_CREATE, 0, 0); + } + else + { + menu_entries_push(info->list, + menu_hash_to_str(MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_IN_USE), "", + MENU_SETTINGS_CORE_OPTION_NONE, 0, 0); + } } if (opts == 0) { diff --git a/menu/menu_hash.h b/menu/menu_hash.h index 8b930ccc1f..b693e5e7a6 100644 --- a/menu/menu_hash.h +++ b/menu/menu_hash.h @@ -307,6 +307,7 @@ extern "C" { #define MENU_LABEL_GAME_SPECIFIC_OPTIONS 0x142ec90fU #define MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS 0x6aed8a05U #define MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_CREATE 0xf8d2456cU +#define MENU_LABEL_VALUE_GAME_SPECIFIC_OPTIONS_IN_USE 0x06BF9E5F8 #define MENU_LABEL_AUTO_OVERRIDES_ENABLE 0x35ff91b6U #define MENU_LABEL_VALUE_AUTO_OVERRIDES_ENABLE 0xc21c3a11U #define MENU_LABEL_AUTO_REMAPS_ENABLE 0x98c8f98bU diff --git a/runloop.c b/runloop.c index 246dc478cd..83d037d0cb 100644 --- a/runloop.c +++ b/runloop.c @@ -477,6 +477,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) static bool runloop_core_shutdown_initiated = false; static bool runloop_perfcnt_enable = false; static bool runloop_overrides_active = false; + static bool runloop_game_options_active = false; #ifdef HAVE_THREADS static slock_t *runloop_msg_queue_lock = NULL; #endif @@ -607,6 +608,14 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) break; case RUNLOOP_CTL_IS_OVERRIDES_ACTIVE: return runloop_overrides_active; + case RUNLOOP_CTL_SET_GAME_OPTIONS_ACTIVE: + runloop_game_options_active = true; + break; + case RUNLOOP_CTL_UNSET_GAME_OPTIONS_ACTIVE: + runloop_game_options_active = false; + break; + case RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE: + return runloop_game_options_active; case RUNLOOP_CTL_IS_FRAME_TIME_LAST: return runloop_frame_time_last; case RUNLOOP_CTL_SET_FRAME_LIMIT: @@ -1095,11 +1104,15 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) if(ret) { + runloop_ctl(RUNLOOP_CTL_SET_GAME_OPTIONS_ACTIVE, NULL); runloop_system.core_options = core_option_new(game_options_path, vars); free(game_options_path); } else + { + runloop_ctl(RUNLOOP_CTL_UNSET_GAME_OPTIONS_ACTIVE, NULL); runloop_system.core_options = core_option_new(options_path, vars); + } } break; diff --git a/runloop.h b/runloop.h index 1ce9fc8e0e..455ca0c729 100644 --- a/runloop.h +++ b/runloop.h @@ -42,6 +42,9 @@ enum runloop_ctl_state RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, + RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE, + RUNLOOP_CTL_SET_GAME_OPTIONS_ACTIVE, + RUNLOOP_CTL_UNSET_GAME_OPTIONS_ACTIVE, RUNLOOP_CTL_CHECK_IDLE_STATE, RUNLOOP_CTL_GET_CONTENT_PATH, RUNLOOP_CTL_SET_CONTENT_PATH,