Hold to reset, tap to redraw
This commit is contained in:
parent
5fe1d93b7d
commit
c68f548fe3
1 changed files with 8 additions and 4 deletions
12
src/main.cpp
12
src/main.cpp
|
@ -464,8 +464,7 @@ public:
|
||||||
case Playing:
|
case Playing:
|
||||||
case CommanderDamage:
|
case CommanderDamage:
|
||||||
if (sidebarRect.contains(t.x, t.y)) {
|
if (sidebarRect.contains(t.x, t.y)) {
|
||||||
showConfirm();
|
for (int i = 0; i < 4; i++) drawPlayer(i);
|
||||||
mode = ConfirmReset;
|
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < 4; i++) clickPlayer(i, t.x, t.y);
|
for (int i = 0; i < 4; i++) clickPlayer(i, t.x, t.y);
|
||||||
}
|
}
|
||||||
|
@ -494,7 +493,12 @@ public:
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case Playing:
|
case Playing:
|
||||||
case CommanderDamage:
|
case CommanderDamage:
|
||||||
for (int i = 0; i < 4; i++) holdPlayer(i, t.x, t.y);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -715,7 +719,7 @@ protected:
|
||||||
canvas.setTextColor(TFT_WHITE);
|
canvas.setTextColor(TFT_WHITE);
|
||||||
canvas.setFont(&fonts::Orbitron_Light_32);
|
canvas.setFont(&fonts::Orbitron_Light_32);
|
||||||
canvas.setTextSize(1);
|
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.drawCenterString("RESET", canvas.width() / 2, (canvas.height() / 2));
|
||||||
canvas.pushSprite(sidebarRect.x, sidebarRect.y);
|
canvas.pushSprite(sidebarRect.x, sidebarRect.y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue