Change the label when per-game options are in use

This commit is contained in:
radius 2015-12-17 17:24:40 -05:00
parent b8bbdc6f4c
commit 4024c9a8c6
5 changed files with 31 additions and 3 deletions

View File

@ -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:

View File

@ -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)
{

View File

@ -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

View File

@ -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;

View File

@ -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,