Add a CHOICE type to the settings system.

This is useful to let the user choose an option between a finite set of
valid alternatives.
This commit is contained in:
LemonBoy 2016-06-12 15:26:07 +02:00
commit bf9d9494db
4 changed files with 113 additions and 18 deletions

View file

@ -142,6 +142,11 @@ static void cmd_set(char *data)
else
set_int(key, value);
break;
case SETTING_TYPE_CHOICE:
settings_set_choice(key, clear ? "" :
set_default ? rec->choices[rec->default_value.v_int] :
value);
break;
case SETTING_TYPE_STRING:
settings_set_str(key, clear ? "" :
set_default ? rec->default_value.v_string :