Hold to reset, tap to redraw

This commit is contained in:
Correl Roush 2023-10-10 17:17:48 -04:00
parent 5fe1d93b7d
commit c68f548fe3

View file

@ -464,8 +464,7 @@ public:
case Playing:
case CommanderDamage:
if (sidebarRect.contains(t.x, t.y)) {
showConfirm();
mode = ConfirmReset;
for (int i = 0; i < 4; i++) drawPlayer(i);
} else {
for (int i = 0; i < 4; i++) clickPlayer(i, t.x, t.y);
}
@ -494,7 +493,12 @@ public:
switch (mode) {
case Playing:
case CommanderDamage:
if (sidebarRect.contains(t.x, t.y)) {
showConfirm();
mode = ConfirmReset;
} else {
for (int i = 0; i < 4; i++) holdPlayer(i, t.x, t.y);
}
break;
}
}
@ -715,7 +719,7 @@ protected:
canvas.setTextColor(TFT_WHITE);
canvas.setFont(&fonts::Orbitron_Light_32);
canvas.setTextSize(1);
canvas.drawCenterString("TAP TO", canvas.width() / 2, (canvas.height() / 2) - canvas.fontHeight());
canvas.drawCenterString("HOLD TO", canvas.width() / 2, (canvas.height() / 2) - canvas.fontHeight());
canvas.drawCenterString("RESET", canvas.width() / 2, (canvas.height() / 2));
canvas.pushSprite(sidebarRect.x, sidebarRect.y);
}