mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
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:
12
map.c
12
map.c
@ -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)
|
||||
|
Reference in New Issue
Block a user