Added room occupants panel

This commit is contained in:
James Booth
2014-10-07 16:37:14 +01:00
parent 0e18b10b8e
commit 0c24b53bfa
5 changed files with 100 additions and 3 deletions

View File

@@ -58,8 +58,21 @@ win_create(const char * const title, int cols, win_type_t type)
{
ProfWin *new_win = malloc(sizeof(struct prof_win_t));
new_win->from = strdup(title);
new_win->win = newpad(PAD_SIZE, cols);
wbkgd(new_win->win, COLOUR_TEXT);
if (type == WIN_MUC) {
new_win->win = newpad(PAD_SIZE, (cols/4) * 3);
wbkgd(new_win->win, COLOUR_TEXT);
new_win->subwin = newpad(PAD_SIZE, cols/4);
wvline(new_win->subwin, 0, 0);
wbkgd(new_win->subwin, COLOUR_TEXT);
} else {
new_win->win = newpad(PAD_SIZE, (cols));
wbkgd(new_win->win, COLOUR_TEXT);
new_win->subwin = NULL;
}
new_win->buffer = buffer_create();
new_win->y_pos = 0;
new_win->paged = 0;
@@ -89,7 +102,14 @@ win_update_virtual(ProfWin *window)
{
int rows, cols;
getmaxyx(stdscr, rows, cols);
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, cols-1);
if (window->type == WIN_MUC) {
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, ((cols/4) * 3) -1);
pnoutrefresh(window->subwin, 0, 0, 1, (cols/4) * 3, rows-3, cols-1);
} else {
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, cols-1);
}
}
void