mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Pearl
This commit is contained in:
16
pearl.c
16
pearl.c
@ -2175,7 +2175,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
|
|
||||||
if (!INGRID(state, gx, gy)) {
|
if (!INGRID(state, gx, gy)) {
|
||||||
ui->ndragcoords = -1;
|
ui->ndragcoords = -1;
|
||||||
return NULL;
|
return MOVE_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->clickx = x; ui->clicky = y;
|
ui->clickx = x; ui->clicky = y;
|
||||||
@ -2197,7 +2197,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
ui->cursor_active = true;
|
ui->cursor_active = true;
|
||||||
} else if (control || shift) {
|
} else if (control || shift) {
|
||||||
char *move;
|
char *move;
|
||||||
if (ui->ndragcoords > 0) return NULL;
|
if (ui->ndragcoords > 0) return MOVE_NO_EFFECT;
|
||||||
ui->ndragcoords = -1;
|
ui->ndragcoords = -1;
|
||||||
move = mark_in_direction(state, ui->curx, ui->cury,
|
move = mark_in_direction(state, ui->curx, ui->cury,
|
||||||
KEY_DIRECTION(button), control, tmpbuf);
|
KEY_DIRECTION(button), control, tmpbuf);
|
||||||
@ -2224,16 +2224,22 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
ui->clicky = CENTERED_COORD(ui->cury);
|
ui->clicky = CENTERED_COORD(ui->cury);
|
||||||
return MOVE_UI_UPDATE;
|
return MOVE_UI_UPDATE;
|
||||||
} else release = true;
|
} else release = true;
|
||||||
} else if (button == CURSOR_SELECT2 && ui->ndragcoords >= 0) {
|
} else if (button == CURSOR_SELECT2) {
|
||||||
|
if (ui->ndragcoords >= 0) {
|
||||||
ui->ndragcoords = -1;
|
ui->ndragcoords = -1;
|
||||||
return MOVE_UI_UPDATE;
|
return MOVE_UI_UPDATE;
|
||||||
}
|
}
|
||||||
|
return MOVE_NO_EFFECT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((button == 27 || button == '\b') && ui->ndragcoords >= 0) {
|
if (button == 27 || button == '\b') {
|
||||||
|
if (ui->ndragcoords >= 0) {
|
||||||
ui->ndragcoords = -1;
|
ui->ndragcoords = -1;
|
||||||
return MOVE_UI_UPDATE;
|
return MOVE_UI_UPDATE;
|
||||||
}
|
}
|
||||||
|
return MOVE_NO_EFFECT;
|
||||||
|
}
|
||||||
|
|
||||||
if (release) {
|
if (release) {
|
||||||
if (ui->ndragcoords > 0) {
|
if (ui->ndragcoords > 0) {
|
||||||
@ -2309,7 +2315,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
if (button == 'H' || button == 'h')
|
if (button == 'H' || button == 'h')
|
||||||
return dupstr("H");
|
return dupstr("H");
|
||||||
|
|
||||||
return NULL;
|
return MOVE_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static game_state *execute_move(const game_state *state, const char *move)
|
static game_state *execute_move(const game_state *state, const char *move)
|
||||||
|
Reference in New Issue
Block a user