Add an environment variable to control initial cursor visibility

If you define PUZZLES_INITIAL_CURSOR=y, puzzles that have a keyboard
cursor will default to making it visible rather than invisible at the
start of a new game.  Behaviour is otherwise the same, so mouse actions
will cause the cursor to vanish and keyboard actions will cause it to
appear.  It's just the default that has changed.

The purpose of this is for use on devices and platforms where the
primary or only means of interaction is keyboard-based.  In those cases,
starting with the keyboard cursor invisible is weird and a bit
confusing.
This commit is contained in:
Ben Harris
2023-03-22 16:58:22 +00:00
parent 09c15f206e
commit 6dac51795e
35 changed files with 36 additions and 40 deletions

View File

@ -775,7 +775,7 @@ struct game_ui {
static game_ui *new_ui(const game_state *state)
{
struct game_ui *ui = snew(struct game_ui);
ui->cursor_visible = false;
ui->cursor_visible = getenv_bool("PUZZLES_SHOW_CURSOR", false);
ui->cx = FILLX;
ui->cy = FILLY;
return ui;