Prevent null representation entries

This commit is contained in:
twinaphex 2016-10-27 02:23:21 +02:00
parent 5fc6519328
commit eb416ce478
3 changed files with 7 additions and 1 deletions

View File

@ -442,7 +442,8 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
if (path && !use_representation)
strlcpy(entry->path, path, sizeof(entry->path));
if (cbs && cbs->setting && cbs->setting->enum_value_idx != MSG_UNKNOWN)
if (cbs && cbs->setting && cbs->setting->enum_value_idx != MSG_UNKNOWN
&& !cbs->setting->dont_use_enum_idx_representation)
strlcpy(entry->path, msg_hash_to_str(cbs->setting->enum_value_idx), sizeof(entry->path));
if (entry_label)

View File

@ -1458,6 +1458,7 @@ bool CONFIG_BOOL_ALT(
(*list)[list_info->index++] = value;
if (flags != SD_FLAG_NONE)
settings_data_list_current_add_flags(list, list_info, flags);
(*list)[list_info->index - 1].dont_use_enum_idx_representation = true;
return true;
}
@ -1545,6 +1546,7 @@ bool CONFIG_UINT_ALT(
if (value.name)
value.name_hash = msg_hash_calculate(value.name);
(*list)[list_info->index++] = value;
(*list)[list_info->index - 1].dont_use_enum_idx_representation = true;
return true;
}
@ -1790,6 +1792,7 @@ bool CONFIG_ACTION_ALT(
if (value.name)
value.name_hash = msg_hash_calculate(value.name);
(*list)[list_info->index++] = value;
(*list)[list_info->index - 1].dont_use_enum_idx_representation = true;
return true;
}

View File

@ -93,6 +93,8 @@ struct rarch_setting
enum msg_hash_enums enum_value_idx;
enum setting_type type;
bool dont_use_enum_idx_representation;
uint32_t size;
const char *name;