Integrate thematic sprites and improve Monopoly UI

This commit is contained in:
Adolfo Reyna
2026-02-02 23:14:14 -05:00
parent 3bdbfb1811
commit eb86c3fc0e
8 changed files with 722 additions and 79 deletions

View File

@@ -21,7 +21,13 @@ public:
if (owner_id != -1) break;
}
bool isInverted = (index == currentPlayerPos) || (observer_idx != -1 && owner_id == observer_idx);
bool isInverted = false;
if (observer_idx != -1) {
isInverted = (owner_id == observer_idx);
} else {
isInverted = (index == currentPlayerPos);
}
if (isInverted) {
renderer->draw_filled_rectangle(x, y, w, h, true, 1);
renderer->set_text_color(false); // Black text on white background
@@ -67,8 +73,11 @@ public:
else renderer->set_text_color(true);
}
char short_name[8] = {0};
char short_name[10] = {0};
int s_ptr = 0;
bool isCurrentPos = (index == currentPlayerPos && observer_idx != -1);
if (isCurrentPos) short_name[s_ptr++] = '-';
// Add * if owned by someone else
if (owner_id != -1 && observer_idx != -1 && owner_id != observer_idx) {
@@ -86,6 +95,9 @@ public:
if (space && space[1] != '\0') short_name[s_ptr++] = space[1];
}
if (isCurrentPos) short_name[s_ptr++] = '-';
short_name[s_ptr] = '\0';
for (int i = 0; short_name[i]; i++) if(short_name[i] >= 'a' && short_name[i] <= 'z') short_name[i] -= 32;
renderer->draw_string_scaled(content_x + (content_w - (int)strlen(short_name) * 6) / 2, content_y + (content_h - 8) / 2, short_name, 1);