diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-08-09 23:24:39 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-08-13 16:44:24 +0100 |
| commit | 995bcef981c0495df3e43d1025339dc5991f92d9 (patch) | |
| tree | 0bb5ff068f8998abc37fad71a85d45e8c81d43b5 | |
| parent | 4e724b25c276ec84ce5c95041c0cb3c0256fa388 (diff) | |
| download | puzzles-995bcef981c0495df3e43d1025339dc5991f92d9.zip puzzles-995bcef981c0495df3e43d1025339dc5991f92d9.tar.gz puzzles-995bcef981c0495df3e43d1025339dc5991f92d9.tar.bz2 puzzles-995bcef981c0495df3e43d1025339dc5991f92d9.tar.xz | |
Galaxies: use new move_cursor() features
| -rw-r--r-- | galaxies.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -3021,16 +3021,15 @@ static char *interpret_move(const game_state *state, game_ui *ui, else return MOVE_UI_UPDATE; } else if (IS_CURSOR_MOVE(button)) { - move_cursor(button, &ui->cur_x, &ui->cur_y, state->sx-1, state->sy-1, - false, NULL); - if (ui->cur_x < 1) ui->cur_x = 1; - if (ui->cur_y < 1) ui->cur_y = 1; - ui->cur_visible = true; + int cx = ui->cur_x - 1, cy = ui->cur_y - 1; + char *ret = move_cursor(button, &cx, &cy, state->sx-2, state->sy-2, + false, &ui->cur_visible); + ui->cur_x = cx + 1, ui->cur_y = cy + 1; if (ui->dragging) { ui->dx = SCOORD(ui->cur_x); ui->dy = SCOORD(ui->cur_y); } - return MOVE_UI_UPDATE; + return ret; } else if (IS_CURSOR_SELECT(button)) { if (!ui->cur_visible) { ui->cur_visible = true; |