ui->dx = COORD(ui->cx) + TILE_SIZE/2;
ui->dy = COORD(ui->cy) + TILE_SIZE/2;
}
- return "";
+ return UI_UPDATE;
} else if (IS_CURSOR_SELECT(button)) {
if (!ui->cshow)
ui->cshow = 1;
else if (ui->dragging) {
ui->dragging = FALSE;
- if (ui->sx == ui->cx && ui->sy == ui->cy) return "";
+ if (ui->sx == ui->cx && ui->sy == ui->cy) return UI_UPDATE;
if (ui->drag_is_from) {
- if (!isvalidmove(state, 0, ui->sx, ui->sy, ui->cx, ui->cy)) return "";
+ if (!isvalidmove(state, 0, ui->sx, ui->sy, ui->cx, ui->cy))
+ return UI_UPDATE;
sprintf(buf, "L%d,%d-%d,%d", ui->sx, ui->sy, ui->cx, ui->cy);
} else {
- if (!isvalidmove(state, 0, ui->cx, ui->cy, ui->sx, ui->sy)) return "";
+ if (!isvalidmove(state, 0, ui->cx, ui->cy, ui->sx, ui->sy))
+ return UI_UPDATE;
sprintf(buf, "L%d,%d-%d,%d", ui->cx, ui->cy, ui->sx, ui->sy);
}
return dupstr(buf);
ui->dy = COORD(ui->cy) + TILE_SIZE/2;
ui->drag_is_from = (button == CURSOR_SELECT) ? 1 : 0;
}
- return "";
+ return UI_UPDATE;
}
if (IS_MOUSE_DOWN(button)) {
if (ui->cshow) {
ui->dx = mx;
ui->dy = my;
ui->cshow = 0;
- return "";
+ return UI_UPDATE;
} else if (IS_MOUSE_DRAG(button) && ui->dragging) {
ui->dx = mx;
ui->dy = my;
- return "";
+ return UI_UPDATE;
} else if (IS_MOUSE_RELEASE(button) && ui->dragging) {
ui->dragging = FALSE;
- if (ui->sx == x && ui->sy == y) return ""; /* single click */
+ if (ui->sx == x && ui->sy == y) return UI_UPDATE; /* single click */
if (!INGRID(state, x, y)) {
int si = ui->sy*w+ui->sx;
if (state->prev[si] == -1 && state->next[si] == -1)
- return "";
+ return UI_UPDATE;
sprintf(buf, "%c%d,%d",
(int)(ui->drag_is_from ? 'C' : 'X'), ui->sx, ui->sy);
return dupstr(buf);
}
if (ui->drag_is_from) {
- if (!isvalidmove(state, 0, ui->sx, ui->sy, x, y)) return "";
+ if (!isvalidmove(state, 0, ui->sx, ui->sy, x, y))
+ return UI_UPDATE;
sprintf(buf, "L%d,%d-%d,%d", ui->sx, ui->sy, x, y);
} else {
- if (!isvalidmove(state, 0, x, y, ui->sx, ui->sy)) return "";
+ if (!isvalidmove(state, 0, x, y, ui->sx, ui->sy))
+ return UI_UPDATE;
sprintf(buf, "L%d,%d-%d,%d", x, y, ui->sx, ui->sy);
}
return dupstr(buf);
else if ((button == 'x' || button == 'X') && ui->cshow) {
int si = ui->cy*w + ui->cx;
if (state->prev[si] == -1 && state->next[si] == -1)
- return "";
+ return UI_UPDATE;
sprintf(buf, "%c%d,%d",
(int)((button == 'x') ? 'C' : 'X'), ui->cx, ui->cy);
return dupstr(buf);