mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-25 08:59:58 +00:00
Start using setting_set_with_string_representation in menu_entry.c
This commit is contained in:
parent
9ecced5e56
commit
8d2aece5b9
@ -231,7 +231,11 @@ uint32_t menu_entry_get_bool_value(uint32_t i)
|
||||
void menu_entry_set_bool_value(uint32_t i, uint32_t new_val)
|
||||
{
|
||||
rarch_setting_t *setting = menu_entry_get_setting(i);
|
||||
*setting->value.boolean = new_val;
|
||||
|
||||
if (new_val == 0)
|
||||
setting_set_with_string_representation(setting, "false");
|
||||
else
|
||||
setting_set_with_string_representation(setting, "true");
|
||||
}
|
||||
|
||||
struct string_list *menu_entry_enum_values(uint32_t i)
|
||||
@ -317,8 +321,8 @@ int menu_entry_pathdir_set_value(uint32_t i, const char *s)
|
||||
return -1;
|
||||
|
||||
(void)s;
|
||||
setting_set_with_string_representation(setting, menu_path);
|
||||
|
||||
strlcpy(setting->value.string, menu_path, setting->size);
|
||||
menu_setting_generic(setting);
|
||||
|
||||
menu_list_pop_stack_by_needle(menu_list, setting->name);
|
||||
|
@ -203,6 +203,12 @@ void setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
case ST_ACTION:
|
||||
strlcpy(setting->value.string, value, setting->size);
|
||||
break;
|
||||
case ST_BOOL:
|
||||
if (!strcmp(value, "true"))
|
||||
*setting->value.boolean = true;
|
||||
else if (!strcmp(value, "false"))
|
||||
*setting->value.boolean = false;
|
||||
break;
|
||||
|
||||
/* TODO */
|
||||
case ST_HEX:
|
||||
@ -217,8 +223,6 @@ void setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
break;
|
||||
case ST_NONE:
|
||||
break;
|
||||
case ST_BOOL:
|
||||
break;
|
||||
case ST_BIND:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user