Add preferences for existing UI style controls

Some puzzles have keys that make changes to the display style in ways
that would probably have been user preferences if they had existed.
I've added a user preference for each of these.  The keys still work,
and unlike the preferences can be changed without saving any state.

The affected settings are:
 * Labelling colours with numbers in Guess ("L" key)
 * Labelling regions with numbers in Map ("L" key)
 * Whether monsters are shown as letters or pictures in Undead ("A" key)
This commit is contained in:
Ben Harris
2023-05-30 19:57:15 +02:00
parent 5acce15ed9
commit 4227ac1fd5
4 changed files with 80 additions and 11 deletions

12
map.c
View File

@ -2337,7 +2337,7 @@ static config_item *get_prefs(game_ui *ui)
{
config_item *ret;
ret = snewn(2, config_item);
ret = snewn(3, config_item);
ret[0].name = "Victory flash effect";
ret[0].kw = "flash-type";
@ -2346,8 +2346,13 @@ static config_item *get_prefs(game_ui *ui)
ret[0].u.choices.choicekws = ":cyclic:each-white:all-white";
ret[0].u.choices.selected = ui->flash_type;
ret[1].name = NULL;
ret[1].type = C_END;
ret[1].name = "Number regions";
ret[1].kw = "show-numbers";
ret[1].type = C_BOOLEAN;
ret[1].u.boolean.bval = ui->show_numbers;
ret[2].name = NULL;
ret[2].type = C_END;
return ret;
}
@ -2355,6 +2360,7 @@ static config_item *get_prefs(game_ui *ui)
static void set_prefs(game_ui *ui, const config_item *cfg)
{
ui->flash_type = cfg[0].u.choices.selected;
ui->show_numbers = cfg[1].u.boolean.bval;
}
static void free_ui(game_ui *ui)