mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -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:
32
undead.c
32
undead.c
@ -1774,7 +1774,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
|
||||
if (button == 'a' || button == 'A') {
|
||||
ui->ascii = !ui->ascii;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
|
||||
if (button == 'm' || button == 'M') {
|
||||
@ -1787,21 +1787,21 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
if (button == 'g' || button == 'G' || button == '1') {
|
||||
if (!ui->hcursor) ui->hshow = false;
|
||||
if (state->guess[xi] == 1)
|
||||
return ui->hcursor ? NULL : UI_UPDATE;
|
||||
return ui->hcursor ? NULL : MOVE_UI_UPDATE;
|
||||
sprintf(buf,"G%d",xi);
|
||||
return dupstr(buf);
|
||||
}
|
||||
if (button == 'v' || button == 'V' || button == '2') {
|
||||
if (!ui->hcursor) ui->hshow = false;
|
||||
if (state->guess[xi] == 2)
|
||||
return ui->hcursor ? NULL : UI_UPDATE;
|
||||
return ui->hcursor ? NULL : MOVE_UI_UPDATE;
|
||||
sprintf(buf,"V%d",xi);
|
||||
return dupstr(buf);
|
||||
}
|
||||
if (button == 'z' || button == 'Z' || button == '3') {
|
||||
if (!ui->hcursor) ui->hshow = false;
|
||||
if (state->guess[xi] == 4)
|
||||
return ui->hcursor ? NULL : UI_UPDATE;
|
||||
return ui->hcursor ? NULL : MOVE_UI_UPDATE;
|
||||
sprintf(buf,"Z%d",xi);
|
||||
return dupstr(buf);
|
||||
}
|
||||
@ -1809,7 +1809,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
button == '0' || button == '\b' ) {
|
||||
if (!ui->hcursor) ui->hshow = false;
|
||||
if (state->guess[xi] == 7 && state->pencils[xi] == 0)
|
||||
return ui->hcursor ? NULL : UI_UPDATE;
|
||||
return ui->hcursor ? NULL : MOVE_UI_UPDATE;
|
||||
sprintf(buf,"E%d",xi);
|
||||
return dupstr(buf);
|
||||
}
|
||||
@ -1829,12 +1829,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
}
|
||||
ui->hshow = true;
|
||||
ui->hcursor = true;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
if (ui->hshow && button == CURSOR_SELECT) {
|
||||
ui->hpencil = !ui->hpencil;
|
||||
ui->hcursor = true;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
|
||||
if (ui->hshow && ui->hpencil) {
|
||||
@ -1871,7 +1871,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->hshow = false;
|
||||
}
|
||||
if (state->pencils[xi] == 0)
|
||||
return ui->hcursor ? NULL : UI_UPDATE;
|
||||
return ui->hcursor ? NULL : MOVE_UI_UPDATE;
|
||||
sprintf(buf,"E%d",xi);
|
||||
return dupstr(buf);
|
||||
}
|
||||
@ -1888,14 +1888,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->hpencil = false;
|
||||
ui->hcursor = false;
|
||||
ui->hx = gx; ui->hy = gy;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
else if (button == RIGHT_BUTTON && g == 7) {
|
||||
ui->hshow = true;
|
||||
ui->hpencil = true;
|
||||
ui->hcursor = false;
|
||||
ui->hx = gx; ui->hy = gy;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
}
|
||||
else if (ui->hshow) {
|
||||
@ -1906,14 +1906,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->hpencil = false;
|
||||
ui->hcursor = false;
|
||||
ui->hx = 0; ui->hy = 0;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
else {
|
||||
ui->hshow = true;
|
||||
ui->hpencil = false;
|
||||
ui->hcursor = false;
|
||||
ui->hx = gx; ui->hy = gy;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -1921,7 +1921,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->hpencil = false;
|
||||
ui->hcursor = false;
|
||||
ui->hx = gx; ui->hy = gy;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
}
|
||||
else if (button == RIGHT_BUTTON) {
|
||||
@ -1930,7 +1930,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->hpencil = true;
|
||||
ui->hcursor = false;
|
||||
ui->hx = gx; ui->hy = gy;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
else {
|
||||
if (gx == ui->hx && gy == ui->hy) {
|
||||
@ -1938,14 +1938,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
ui->hpencil = false;
|
||||
ui->hcursor = false;
|
||||
ui->hx = 0; ui->hy = 0;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
else if (g == 7) {
|
||||
ui->hshow = true;
|
||||
ui->hpencil = true;
|
||||
ui->hcursor = false;
|
||||
ui->hx = gx; ui->hy = gy;
|
||||
return UI_UPDATE;
|
||||
return MOVE_UI_UPDATE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user