summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kilies <MarioKilies@GMX.net>2011-01-25 14:03:48 +0100
committerMario Kilies <MarioKilies@GMX.net>2011-01-25 14:03:48 +0100
commitffef04a78f6985e9fcff5454a608de24bd25388e (patch)
treecd58f75e9dd7faa3de29237ec918e88ed9708053
parent13700c410ba4177be89f8543d2cf585779aa8132 (diff)
Implemented the message window.
-rw-r--r--src/ui.c18
-rw-r--r--src/ui.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/src/ui.c b/src/ui.c
index 661219a..f64fe21 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -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
}
diff --git a/src/ui.h b/src/ui.h
index 048aca6..4532ab3 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -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);