diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui.c | 18 | ||||
| -rw-r--r-- | src/ui.h | 1 |
2 files changed, 18 insertions, 1 deletions
@@ -21,6 +21,7 @@ static bool colors = false; static WINDOW *w_table_cards; static WINDOW *w_stack_points; static WINDOW *w_current_state; +static WINDOW *w_messages; static WINDOW *w_hand_cards; static void draw_card(WINDOW *w, const uint8_t row, const uint8_t col, const bool highlight, const card c) @@ -261,6 +262,19 @@ void ui_display_wnd_current_state(const player_list_t *pl, const uint8_t num_pla } /** + * Displays the message window. + * @param[in] message The message to display +*/ +void ui_display_wnd_messages(const char *message) +{ + wclear(w_messages); + + mvwprintw(w_messages, 0, 0, "%s", message); + + wrefresh(w_messages); +} + +/** * Displays the hand cards window. * @param[in] h The hand that will be displayed. h must be sorted in ascending order * @param[in] highlight If true, a card will be highlighted @@ -443,7 +457,8 @@ void ui_init(void) // Window positions and sizes w_table_cards = newwin(21, 15, 0, 0); w_stack_points = newwin(19, 4, 0, 17); - w_current_state = newwin(10, 38, 0, 24); + w_current_state = newwin(8, 38, 0, 24); + w_messages = newwin(2, 39, 7, 24); w_hand_cards = newwin(11, 39, 10, 24); // Set input settings for windows @@ -463,6 +478,7 @@ void ui_fini(void) delwin(w_table_cards); delwin(w_stack_points); delwin(w_current_state); + delwin(w_messages); delwin(w_hand_cards); endwin(); // End curses mode } @@ -10,6 +10,7 @@ void ui_display_wnd_table_cards(const table_stacks_t *ts, const bool highlight, const uint8_t highlighted_stack); void ui_display_wnd_stack_points(const table_stacks_t *ts, const bool highlight, const uint8_t highlighted_points); 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); +void ui_display_wnd_messages(const char *message); void ui_display_wnd_hand_cards(const hand_t *h, const bool highlight, const uint8_t highlighted_card); uint8_t ui_choose_card(hand_t *h); uint8_t ui_choose_stack(const table_stacks_t *ts); |
