Example #1
0
void init_options(void)
{
    int i;

    find_option("name")->s.maxlen = PL_NSIZ;
    find_option("dungeon_name")->e = dungeon_name_spec;
    find_option("menu_headings")->e = menu_headings_spec;
    find_option("msgheight")->i.min = 0;
    find_option("msgheight")->i.max = MAX_MSGLINES;
    find_option("msghistory")->i.min = 20;   /* arbitrary min/max values */
    find_option("msghistory")->i.max = 20000;
    find_option("graphics")->e = graphics_spec;
    find_option("optstyle")->e = optstyle_spec;
    find_option("scores_top")->i.max = 10000;
    find_option("scores_around")->i.max = 100;
#if defined(PDCURSES) && defined(WIN32)
    find_option("win_width")->i.min = COLNO; /* can never be narrower than COLNO */
    find_option("win_width")->i.max = 100 + COLNO; /* 100 chars wide sidebar already looks pretty silly */
    find_option("win_height")->i.min = ROWNO + 3;
    find_option("win_height")->i.max = 70; /* ROWNO + max msgheight + extra for status and frame */
#endif
    nh_setup_ui_options(curses_options, boolopt_map, option_change_callback);
    
    /* set up option defaults; this is necessary for options that are not
     * specified in the config file */
    for (i = 0; curses_options[i].name; i++)
	nh_set_option(curses_options[i].name, curses_options[i].value, FALSE);
    
    read_ui_config();
}
Example #2
0
void
init_options(void)
{
    int i;

    find_option("border")->e = frame_spec;
    find_option("comment")->s.maxlen = BUFSZ;
    find_option("tileset")->s.maxlen = BUFSZ;
    find_option("tileset")->value.s = malloc(sizeof "textunicode");
    strcpy(find_option("tileset")->value.s, "textunicode");
    find_option("menu_headings")->e = menu_headings_spec;
    find_option("msgheight")->i.min = 1;
    find_option("msgheight")->i.max = 40;
    find_option("msghistory")->i.min = 20;      /* arbitrary min/max values */
    find_option("msghistory")->i.max = 20000;
    find_option("animation")->e = animation_spec;
    find_option("networkmotd")->e = networkmotd_spec;
    find_option("optstyle")->e = optstyle_spec;
    find_option("menupaging")->e = menupaging_spec;
    find_option("palette")->e = palette_spec;
    find_option("scores_top")->i.max = 10000;
    find_option("scores_around")->i.max = 100;
    find_option("sidebar")->e = autoable_boolean_spec;

    /* set up option defaults; this is necessary for options that are not
       specified in the config file */
    for (i = 0; curses_options[i].name; i++)
        curses_set_option(curses_options[i].name, curses_options[i].value);

    read_ui_config();
}