summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/ui.c b/src/ui.c
index b878f61..990e235 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -173,7 +173,7 @@ void ui_display_wnd_table_cards(const table_stacks_t *ts, const bool highlight,
draw_card_stack(w_table_cards, 1 + i*5, 0, false, &ts->stacks[i]);
}
- wrefresh(w_table_cards);
+ wnoutrefresh(w_table_cards);
}
/**
@@ -203,7 +203,7 @@ void ui_display_wnd_stack_points(const table_stacks_t *ts, const bool highlight,
mvwprintw(w_stack_points, 3 + i*5, 1, "%2d", card_stack_get_points(&ts->stacks[i]));
}
- wrefresh(w_stack_points);
+ wnoutrefresh(w_stack_points);
}
/**
@@ -259,7 +259,7 @@ void ui_display_wnd_current_state(const player_list_t *pl, const uint8_t num_pla
pos++;
}
- wrefresh(w_current_state);
+ wnoutrefresh(w_current_state);
}
/**
@@ -279,7 +279,7 @@ void ui_display_wnd_messages(const char *message, const bool highlight)
if (highlight)
wattroff(w_messages, COLOR_PAIR(CP_YELLOW_ON_BLACK));
- wrefresh(w_messages);
+ wnoutrefresh(w_messages);
}
/**
@@ -331,7 +331,7 @@ void ui_display_wnd_hand_cards(const hand_t *h, const bool highlight, const uint
draw_card(w_hand_cards, 6, (i - num_zero_cards - 5) * 8, false, h->cards[i]);
}
- wrefresh(w_hand_cards);
+ wnoutrefresh(w_hand_cards);
}
uint8_t ui_choose_card(hand_t *h)
@@ -353,7 +353,9 @@ uint8_t ui_choose_card(hand_t *h)
chosen_card_idx = i;
}
+ ui_display_wnd_messages("Please choose the card you want to play", true);
ui_display_wnd_hand_cards(h, true, chosen_card_idx);
+ ui_update();
while (KEY_RETURN != (key = wgetch(w_hand_cards)))
{
@@ -384,6 +386,7 @@ uint8_t ui_choose_card(hand_t *h)
}
ui_display_wnd_hand_cards(h, true, chosen_card_idx);
+ ui_update();
}
return chosen_card_idx;
@@ -396,8 +399,10 @@ uint8_t ui_choose_stack(const table_stacks_t *ts)
int key;
uint8_t chosen_stack_idx = 0;
+ ui_display_wnd_messages("Please choose a stack", true);
ui_display_wnd_table_cards(ts, true, chosen_stack_idx);
ui_display_wnd_stack_points(ts, true, chosen_stack_idx);
+ ui_update();
while (KEY_RETURN != (key = wgetch(w_table_cards)))
{
@@ -432,11 +437,17 @@ uint8_t ui_choose_stack(const table_stacks_t *ts)
ui_display_wnd_table_cards(ts, true, chosen_stack_idx);
ui_display_wnd_stack_points(ts, true, chosen_stack_idx);
+ ui_update();
}
return chosen_stack_idx;
}
+void ui_update(void)
+{
+ doupdate();
+}
+
/**
* Initializes ncurses.
*/