Added /roster size and /occupants size settings

This commit is contained in:
James Booth
2014-11-15 23:47:27 +00:00
parent 3a778cc974
commit 1479a5e134
6 changed files with 93 additions and 9 deletions

View File

@@ -883,6 +883,9 @@ _cons_occupants_setting(void)
cons_show("Occupants (/occupants) : show");
else
cons_show("Occupants (/occupants) : hide");
int size = prefs_get_occupants_size();
cons_show("Occupants size (/occupants) : %d", size);
}
static void
@@ -958,6 +961,9 @@ _cons_roster_setting(void)
cons_show("Roster resource (/roster) : show");
else
cons_show("Roster resource (/roster) : hide");
int size = prefs_get_roster_size();
cons_show("Roster size (/roster) : %d", size);
}
static void

View File

@@ -53,9 +53,6 @@
#define CEILING(X) (X-(int)(X) > 0 ? (int)(X+1) : (int)(X))
static int roster_win_percent = 20;
static int occupants_win_percent = 20;
static void _win_print(ProfWin *window, const char show_char, const char * const date_fmt,
int flags, int attrs, const char * const from, const char * const message);
static void _win_print_wrapped(WINDOW *win, const char * const message);
@@ -63,6 +60,7 @@ static void _win_print_wrapped(WINDOW *win, const char * const message);
int
win_roster_cols(void)
{
int roster_win_percent = prefs_get_roster_size();
int cols = getmaxx(stdscr);
return CEILING( (((double)cols) / 100) * roster_win_percent);
}
@@ -70,6 +68,7 @@ win_roster_cols(void)
int
win_occpuants_cols(void)
{
int occupants_win_percent = prefs_get_occupants_size();
int cols = getmaxx(stdscr);
return CEILING( (((double)cols) / 100) * occupants_win_percent);
}