From 4227ac1fd5dc25c247e7526526079b85e1890766 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 30 May 2023 19:57:15 +0200 Subject: 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) --- map.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'map.c') diff --git a/map.c b/map.c index 966ab75..127db04 100644 --- a/map.c +++ b/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) -- cgit v1.1