mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 15:41:30 -07:00
Rename UI_UPDATE as MOVE_UI_UPDATE
All the other constants named UI_* are special key names that can be passed to midend_process_key(), but UI_UPDATE is a special return value from the back-end interpret_move() function instead. This renaming makes the distinction clear and provides a naming convention for future special return values from interpret_move().
This commit is contained in:
20
map.c
20
map.c
@ -2481,7 +2481,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
*/
|
||||
if (button == 'l' || button == 'L') {
|
||||
ui->show_numbers = !ui->show_numbers;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
|
||||
if (IS_CURSOR_MOVE(button)) {
|
||||
@ -2490,12 +2490,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->cur_visible = true;
|
||||
ui->cur_moved = true;
|
||||
ui->cur_lastmove = button;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
if (IS_CURSOR_SELECT(button)) {
|
||||
if (!ui->cur_visible) {
|
||||
ui->cur_visible = true;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
if (ui->drag_colour == -2) { /* not currently cursor-dragging, start. */
|
||||
int r = region_from_ui_cursor(state, ui);
|
||||
@ -2507,7 +2507,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->drag_pencil = 0;
|
||||
}
|
||||
ui->cur_moved = false;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
} else { /* currently cursor-dragging; drop the colour in the new region. */
|
||||
alt_button = (button == CURSOR_SELECT2);
|
||||
/* Double-select removes current colour. */
|
||||
@ -2532,14 +2532,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->dragx = x;
|
||||
ui->dragy = y;
|
||||
ui->cur_visible = false;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
|
||||
if ((button == LEFT_DRAG || button == RIGHT_DRAG) &&
|
||||
ui->drag_colour > -2) {
|
||||
ui->dragx = x;
|
||||
ui->dragy = y;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
|
||||
if ((button == LEFT_RELEASE || button == RIGHT_RELEASE) &&
|
||||
@ -2564,18 +2564,18 @@ drag_dropped:
|
||||
ui->drag_colour = -2;
|
||||
|
||||
if (r < 0)
|
||||
return UI_UPDATE; /* drag into border; do nothing else */
|
||||
return MOVE_UI_UPDATE; /* drag into border; do nothing else */
|
||||
|
||||
if (state->map->immutable[r])
|
||||
return UI_UPDATE; /* can't change this region */
|
||||
return MOVE_UI_UPDATE; /* can't change this region */
|
||||
|
||||
if (state->colouring[r] == c && state->pencil[r] == p)
|
||||
return UI_UPDATE; /* don't _need_ to change this region */
|
||||
return MOVE_UI_UPDATE; /* don't _need_ to change this region */
|
||||
|
||||
if (alt_button) {
|
||||
if (state->colouring[r] >= 0) {
|
||||
/* Can't pencil on a coloured region */
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
} else if (c >= 0) {
|
||||
/* Right-dragging from colour to blank toggles one pencil */
|
||||
p = state->pencil[r] ^ (1 << c);
|
||||
|
Reference in New Issue
Block a user