From e6ee237dbfd7f023b91a27c1ec007e7bf8e68d38 Mon Sep 17 00:00:00 2001 From: Correl Date: Tue, 2 May 2023 16:28:44 -0400 Subject: [PATCH] Display commander damage --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index c6e0ecb..1ac5119 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -580,6 +580,16 @@ protected: canvas.setFont(&fonts::Orbitron_Light_32); canvas.setTextSize(3); canvas.drawCenterString(String(lifeTotal, DEC), rect->width / 2, (rect->height / 2) - (canvas.fontHeight() / 2)); + if (mode == Playing) { + canvas.setTextSize(1); + canvas.setTextColor(TFT_DARKGREY); + int rotate = rect->rotation == 0 ? 1 : -1; + int offset = 60 * rotate; + canvas.drawCenterString(String(players[player].commanderDamage[0], DEC), rect->width / 2 - offset, (rect->height / 2) - (canvas.fontHeight() / 2) - offset, &fonts::Orbitron_Light_24); + canvas.drawCenterString(String(players[player].commanderDamage[1], DEC), rect->width / 2 + offset, (rect->height / 2) - (canvas.fontHeight() / 2) - offset, &fonts::Orbitron_Light_24); + canvas.drawCenterString(String(players[player].commanderDamage[2], DEC), rect->width / 2 - offset, (rect->height / 2) - (canvas.fontHeight() / 2) + offset, &fonts::Orbitron_Light_24); + canvas.drawCenterString(String(players[player].commanderDamage[3], DEC), rect->width / 2 + offset, (rect->height / 2) - (canvas.fontHeight() / 2) + offset, &fonts::Orbitron_Light_24); + } canvas.pushSprite(rect->x, rect->y); }