aboutsummaryrefslogtreecommitdiff
path: root/guess.c
diff options
context:
space:
mode:
Diffstat (limited to 'guess.c')
-rw-r--r--guess.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/guess.c b/guess.c
index 8f05863..b3d4a9a 100644
--- a/guess.c
+++ b/guess.c
@@ -779,7 +779,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
*/
if (button == 'l' || button == 'L') {
ui->show_labels = !ui->show_labels;
- return "";
+ return UI_UPDATE;
}
if (from->solved) return NULL;
@@ -836,13 +836,13 @@ static char *interpret_move(const game_state *from, game_ui *ui,
ui->drag_y = y;
debug(("Start dragging, col = %d, (%d,%d)",
ui->drag_col, ui->drag_x, ui->drag_y));
- ret = "";
+ ret = UI_UPDATE;
}
} else if (button == LEFT_DRAG && ui->drag_col) {
ui->drag_x = x;
ui->drag_y = y;
debug(("Keep dragging, (%d,%d)", ui->drag_x, ui->drag_y));
- ret = "";
+ ret = UI_UPDATE;
} else if (button == LEFT_RELEASE && ui->drag_col) {
if (over_guess > -1) {
debug(("Dropping colour %d onto guess peg %d",
@@ -859,13 +859,13 @@ static char *interpret_move(const game_state *from, game_ui *ui,
ui->drag_opeg = -1;
ui->display_cur = 0;
debug(("Stop dragging."));
- ret = "";
+ ret = UI_UPDATE;
} else if (button == RIGHT_BUTTON) {
if (over_guess > -1) {
/* we use ths feedback in the game_ui to signify
* 'carry this peg to the next guess as well'. */
ui->holds[over_guess] = 1 - ui->holds[over_guess];
- ret = "";
+ ret = UI_UPDATE;
}
} else if (button == LEFT_RELEASE && over_hint && ui->markable) {
/* NB this won't trigger if on the end of a drag; that's on
@@ -880,10 +880,10 @@ static char *interpret_move(const game_state *from, game_ui *ui,
ui->colour_cur++;
if (button == CURSOR_UP && ui->colour_cur > 0)
ui->colour_cur--;
- ret = "";
+ ret = UI_UPDATE;
} else if (button == 'h' || button == 'H' || button == '?') {
compute_hint(from, ui);
- ret = "";
+ ret = UI_UPDATE;
} else if (button == CURSOR_LEFT || button == CURSOR_RIGHT) {
int maxcur = from->params.npegs;
if (ui->markable) maxcur++;
@@ -893,25 +893,25 @@ static char *interpret_move(const game_state *from, game_ui *ui,
ui->peg_cur++;
if (button == CURSOR_LEFT && ui->peg_cur > 0)
ui->peg_cur--;
- ret = "";
+ ret = UI_UPDATE;
} else if (IS_CURSOR_SELECT(button)) {
ui->display_cur = 1;
if (ui->peg_cur == from->params.npegs) {
ret = encode_move(from, ui);
} else {
set_peg(&from->params, ui, ui->peg_cur, ui->colour_cur+1);
- ret = "";
+ ret = UI_UPDATE;
}
} else if (button == 'D' || button == 'd' || button == '\b') {
ui->display_cur = 1;
set_peg(&from->params, ui, ui->peg_cur, 0);
- ret = "";
+ ret = UI_UPDATE;
} else if (button == CURSOR_SELECT2) {
if (ui->peg_cur == from->params.npegs)
return NULL;
ui->display_cur = 1;
ui->holds[ui->peg_cur] = 1 - ui->holds[ui->peg_cur];
- ret = "";
+ ret = UI_UPDATE;
}
return ret;
}