| 655 | and text attributes */ |
| 656 | |
| 657 | void |
| 658 | curses_puts(winid wid, int attr, const char *text) |
| 659 | { |
| 660 | anything Id; |
| 661 | WINDOW *win = NULL; |
| 662 | |
| 663 | if (is_main_window(wid)) { |
| 664 | win = curses_get_nhwin(wid); |
| 665 | } |
| 666 | |
| 667 | if (wid == MESSAGE_WIN) { |
| 668 | /* if a no-history message is being shown, remove it */ |
| 669 | if (counting) |
| 670 | curses_count_window((char *) 0); |
| 671 | |
| 672 | curses_message_win_puts(text, FALSE); |
| 673 | return; |
| 674 | } |
| 675 | |
| 676 | #if 0 |
| 677 | if (wid == STATUS_WIN) { |
| 678 | curses_update_stats(); /* We will do the write ourselves */ |
| 679 | return; |
| 680 | } |
| 681 | #endif |
| 682 | |
| 683 | if (curses_is_menu(wid) || curses_is_text(wid)) { |
| 684 | if (!curses_menu_exists(wid)) { |
| 685 | impossible( |
| 686 | "curses_puts: Attempted write to nonexistent window %d!", |
| 687 | wid); |
| 688 | return; |
| 689 | } |
| 690 | Id = cg.zeroany; |
| 691 | curses_add_nhmenu_item(wid, &nul_glyphinfo, &Id, 0, 0, |
| 692 | attr, NO_COLOR, text, MENU_ITEMFLAGS_NONE); |
| 693 | } else { |
| 694 | curses_set_wid_colors(wid, NULL); |
| 695 | waddstr(win, text); |
| 696 | wnoutrefresh(win); |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | |
| 701 | /* Clear the contents of a window via the given NetHack winid */ |
no test coverage detected