curses msg_window:f

Simplify.  Support routine was already prepared to do what's wanted
without jumping throuhg any hoops.
This commit is contained in:
PatR
2019-03-25 12:04:14 -07:00
parent 59ab965863
commit 2960042a9f
+5 -6
View File
@@ -284,7 +284,7 @@ curses_teardown_messages(void)
void void
curses_prev_mesg() curses_prev_mesg()
{ {
int count, fifo_count; int count;
winid wid; winid wid;
long turn = 0; long turn = 0;
anything Id; anything Id;
@@ -296,9 +296,8 @@ curses_prev_mesg()
curses_create_nhmenu(wid); curses_create_nhmenu(wid);
Id = zeroany; Id = zeroany;
for (count = 0, fifo_count = num_messages - 1; count < num_messages; for (count = 0; count < num_messages; ++count) {
++count, --fifo_count) { mesg = get_msg_line(do_lifo, count);
mesg = get_msg_line(TRUE, do_lifo ? count : fifo_count);
if (turn != mesg->turn && count != 0) { if (turn != mesg->turn && count != 0) {
curses_add_menu(wid, NO_GLYPH, &Id, 0, 0, A_NORMAL, "---", FALSE); curses_add_menu(wid, NO_GLYPH, &Id, 0, 0, A_NORMAL, "---", FALSE);
} }
@@ -323,13 +322,13 @@ curses_prev_mesg()
void void
curses_count_window(const char *count_text) curses_count_window(const char *count_text)
{ {
static WINDOW *countwin = NULL;
int startx, starty, winx, winy; int startx, starty, winx, winy;
int messageh, messagew; int messageh, messagew;
static WINDOW *countwin = NULL;
if (!count_text) { if (!count_text) {
if (countwin) if (countwin)
delwin(countwin), countwin = NULL; delwin(countwin), countwin = NULL;
counting = FALSE; counting = FALSE;
return; return;
} }