mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Add user preference for Bridges' "G" key (show_hints)
I missed this in my previous addition of preferences for UI controls (4227ac1fd5dc25c247e7526526079b85e1890766) because it wasn't documented. Now it is documented and it has a preference. I've phrased it as showing possible bridge locations, which doesn't really make clear that "possible" relates only to the locations of islands and not to anything already placed. Improvements welcome!
This commit is contained in:
30
bridges.c
30
bridges.c
@ -2132,13 +2132,37 @@ static game_ui *new_ui(const game_state *state)
|
|||||||
{
|
{
|
||||||
game_ui *ui = snew(game_ui);
|
game_ui *ui = snew(game_ui);
|
||||||
ui_cancel_drag(ui);
|
ui_cancel_drag(ui);
|
||||||
ui->cur_x = state->islands[0].x;
|
if (state != NULL) {
|
||||||
ui->cur_y = state->islands[0].y;
|
ui->cur_x = state->islands[0].x;
|
||||||
|
ui->cur_y = state->islands[0].y;
|
||||||
|
}
|
||||||
ui->cur_visible = getenv_bool("PUZZLES_SHOW_CURSOR", false);
|
ui->cur_visible = getenv_bool("PUZZLES_SHOW_CURSOR", false);
|
||||||
ui->show_hints = false;
|
ui->show_hints = false;
|
||||||
return ui;
|
return ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static config_item *get_prefs(game_ui *ui)
|
||||||
|
{
|
||||||
|
config_item *ret;
|
||||||
|
|
||||||
|
ret = snewn(2, config_item);
|
||||||
|
|
||||||
|
ret[0].name = "Show possible bridge locations";
|
||||||
|
ret[0].kw = "show-hints";
|
||||||
|
ret[0].type = C_BOOLEAN;
|
||||||
|
ret[0].u.boolean.bval = ui->show_hints;
|
||||||
|
|
||||||
|
ret[1].name = NULL;
|
||||||
|
ret[1].type = C_END;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void set_prefs(game_ui *ui, const config_item *cfg)
|
||||||
|
{
|
||||||
|
ui->show_hints = cfg[0].u.boolean.bval;
|
||||||
|
}
|
||||||
|
|
||||||
static void free_ui(game_ui *ui)
|
static void free_ui(game_ui *ui)
|
||||||
{
|
{
|
||||||
sfree(ui);
|
sfree(ui);
|
||||||
@ -3288,7 +3312,7 @@ const struct game thegame = {
|
|||||||
free_game,
|
free_game,
|
||||||
true, solve_game,
|
true, solve_game,
|
||||||
true, game_can_format_as_text_now, game_text_format,
|
true, game_can_format_as_text_now, game_text_format,
|
||||||
NULL, NULL, /* get_prefs, set_prefs */
|
get_prefs, set_prefs,
|
||||||
new_ui,
|
new_ui,
|
||||||
free_ui,
|
free_ui,
|
||||||
NULL, /* encode_ui */
|
NULL, /* encode_ui */
|
||||||
|
10
puzzles.but
10
puzzles.but
@ -2316,6 +2316,9 @@ By pressing a number key, you can jump to the nearest island with that
|
|||||||
number. Letters \q{a}, ..., \q{f} count as 10, ..., 15 and \q{0} as
|
number. Letters \q{a}, ..., \q{f} count as 10, ..., 15 and \q{0} as
|
||||||
16.
|
16.
|
||||||
|
|
||||||
|
The \q{G} key will draw a grey line between each pair of islands that
|
||||||
|
could be connected with a bridge or non-bridge but are currently not.
|
||||||
|
|
||||||
Violations of the puzzle rules will be marked in red:
|
Violations of the puzzle rules will be marked in red:
|
||||||
|
|
||||||
\b An island with too many bridges will be highlighted in red.
|
\b An island with too many bridges will be highlighted in red.
|
||||||
@ -2387,6 +2390,13 @@ tightly-packed islands.
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\H{bridges-prefs} \I{preferences, for Bridges}Bridges user preferences
|
||||||
|
|
||||||
|
On platforms that support user preferences, the \q{Preferences} option
|
||||||
|
on the \q{Game} menu will let you configure whether possible bridge
|
||||||
|
locations are shown. Unlike the \q{G} key, this will persist between
|
||||||
|
games.
|
||||||
|
|
||||||
|
|
||||||
\C{unequal} \i{Unequal}
|
\C{unequal} \i{Unequal}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user