summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ui.c b/src/ui.c
index 5dd7196..661219a 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -207,15 +207,15 @@ void ui_display_wnd_stack_points(const table_stacks_t *ts, const bool highlight,
/**
* Displays the current state window, showing all player names and their open cards and the client player's score.
- * @param[in] pnoc Array of (player name, open card) tuples. Array has to be sorted by open card, lowest open card first
+ * @param[in] pl Player list. List has to be sorted by open card, in ascending order
* @param[in] num_players The number of players to show a player name and open card for
* @param[in] highlight If true, a player in the player table will be highlighted
* @param[in] highlighted_player The player to highlight
* @param[in] score The players score
*/
-void ui_display_wnd_current_state(const pnoc_t pnoc[], const uint8_t num_players, const bool highlight, const uint8_t highlighted_player, const uint32_t score)
+void ui_display_wnd_current_state(const player_list_t *pl, const uint8_t num_players, const bool highlight, const uint8_t highlighted_player, const uint32_t score)
{
- assert(pnoc != NULL);
+ assert(pl != NULL);
uint8_t pos = 0;
wattron(w_current_state, A_BOLD);
@@ -228,7 +228,7 @@ void ui_display_wnd_current_state(const pnoc_t pnoc[], const uint8_t num_players
for (uint8_t i = 0; i < num_players; i++)
{
- if (pnoc[i].player_id == 0) // invalid player
+ if (pl->players[i].player_id == 0) // invalid player
continue;
if (highlight && i == highlighted_player)
@@ -236,19 +236,19 @@ void ui_display_wnd_current_state(const pnoc_t pnoc[], const uint8_t num_players
if (pos < 5)
{
- mvwprintw(w_current_state, 2+pos, 1, "%-s", pnoc[i].player_name);
- if (0 == pnoc[i].open_card)
+ mvwprintw(w_current_state, 2+pos, 1, "%-s", pl->players[i].player_name);
+ if (0 == pl->players[i].open_card)
mvwprintw(w_current_state, 2+pos, 15, "-");
else
- mvwprintw(w_current_state, 2+pos, 13, "%3d", pnoc[i].open_card);
+ mvwprintw(w_current_state, 2+pos, 13, "%3d", pl->players[i].open_card);
}
else
{
- mvwprintw(w_current_state, 2+(pos-5), 22, "%-s", pnoc[i].player_name);
- if (0 == pnoc[i].open_card)
+ mvwprintw(w_current_state, 2+(pos-5), 22, "%-s", pl->players[i].player_name);
+ if (0 == pl->players[i].open_card)
mvwprintw(w_current_state, 2+(pos-5), 36, "-");
else
- mvwprintw(w_current_state, 2+(pos-5), 34, "%3d", pnoc[i].open_card);
+ mvwprintw(w_current_state, 2+(pos-5), 34, "%3d", pl->players[i].open_card);
}
if (highlight && i == highlighted_player)