Exemplo n.º 1
0
/*
 * Display the features in a group.
 */
static void display_feature(int col, int row, bool cursor, int oid)
{
	/* Get the feature index */
	int f_idx = oid;

	/* Access the feature */
	feature_type *f_ptr = &f_info[f_idx];

	/* Choose a color */
	byte attr = curs_attrs[CURS_KNOWN][(int) cursor];

	/* Display the name */
	c_prt(attr, f_ptr->name, row, col);

	if (tile_height == 1) {
		/* Display symbols */
		col = 65;
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_DARK],
					   f_ptr->x_char[FEAT_LIGHTING_DARK]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LIT],
					   f_ptr->x_char[FEAT_LIGHTING_LIT]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_TORCH],
				f_ptr->x_char[FEAT_LIGHTING_TORCH]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LOS],
				f_ptr->x_char[FEAT_LIGHTING_LOS]);
	}

}
Exemplo n.º 2
0
/*
 * Display tiles.
 */
static void display_tiles(int col, int row, int height, int width,
						  byte attr_top, byte char_left)
{
	int i, j;

	/* Clear the display lines */
	for (i = 0; i < height; i++)
		Term_erase(col, row + i, width);

	width = logical_width(width);
	height = logical_height(height);

	/* Display lines until done */
	for (i = 0; i < height; i++) {
		/* Display columns until done */
		for (j = 0; j < width; j++) {
			byte a;
			unsigned char c;
			int x = col + actual_width(j);
			int y = row + actual_height(i);
			int ia, ic;

			ia = attr_top + i;
			ic = char_left + j;

			a = (byte) ia;
			c = (unsigned char) ic;

			/* Display symbol */
			big_pad(x, y, a, c);
		}
	}
}
Exemplo n.º 3
0
/*
 * Display a monster
 */
static void display_monster(int col, int row, bool cursor, int oid)
{
    /* HACK Get the race index. (Should be a wrapper function) */
    int r_idx = default_join[oid].oid;

    /* Access the race */
    monster_race *r_ptr = &r_info[r_idx];
    monster_lore *l_ptr = &l_list[r_idx];

    /* Choose colors */
    byte attr = curs_attrs[CURS_KNOWN][(int) cursor];
    byte a = r_ptr->x_attr;
    byte c = r_ptr->x_char;

    /* Display the name */
    c_prt(attr, r_ptr->name, row, col);

    if ((tile_width > 1) || (tile_height > 1))
	return;

    /* Display symbol */
    big_pad(66, row, a, c);

    /* Display kills */
    if (rf_has(r_ptr->flags, RF_UNIQUE))
	put_str(format("%s", (r_ptr->max_num == 0) ? " dead" : "alive"), row,
		70);
    else
	put_str(format("%5d", l_ptr->pkills), row, 70);
}
Exemplo n.º 4
0
/*
 * Display the features in a group.
 */
static void display_feature(int col, int row, bool cursor, int oid )
{
	feature_type *f_ptr = &f_info[oid];
	byte attr = curs_attrs[CURS_KNOWN][(int)cursor];

	c_prt(attr, f_ptr->name, row, col);

	if (tile_height == 1) {
		/* Display symbols */
		col = 66;
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_DARK],
				f_ptr->x_char[FEAT_LIGHTING_DARK]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LIT],
				f_ptr->x_char[FEAT_LIGHTING_LIT]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_BRIGHT],
				f_ptr->x_char[FEAT_LIGHTING_BRIGHT]);
	}
}
Exemplo n.º 5
0
/*
 * Display the objects in a group.
 */
static void display_object(int col, int row, bool cursor, int oid)
{
    int k_idx = oid;

    object_kind *k_ptr = &k_info[k_idx];
    const char *inscrip = get_autoinscription(oid);

    char o_name[80];

    /* Choose a color */
    bool aware = (!k_ptr->flavor || k_ptr->aware);
    byte attr = curs_attrs[(int) aware][(int) cursor];

    /* Find graphics bits -- versions of the object_char and object_attr
     * defines */
    bool use_flavour = (k_ptr->flavor) && !(aware && k_ptr->tval == TV_SCROLL);

    byte a = use_flavour ? flavor_info[k_ptr->flavor].x_attr : k_ptr->x_attr;
    byte c = use_flavour ? flavor_info[k_ptr->flavor].x_char : k_ptr->x_char;

    /* Display known artifacts differently */
    if (kf_has(k_ptr->flags_kind, KF_INSTA_ART)
	&& artifact_is_known(get_artifact_from_kind(k_ptr))) {
	get_artifact_display_name(o_name, sizeof(o_name),
				  get_artifact_from_kind(k_ptr));
    } else {
	object_kind_name(o_name, sizeof(o_name), k_idx, OPT(cheat_know));
    }

    /* If the type is "tried", display that */
    if (k_ptr->tried && !aware)
	my_strcat(o_name, " {tried}", sizeof(o_name));

    /* Display the name */
    c_prt(attr, o_name, row, col);

    /* Show autoinscription if around */
    if (aware && inscrip)
	c_put_str(TERM_YELLOW, inscrip, row, 55);

    /* Hack - don't use if double tile */
    if ((tile_width > 1) || (tile_height > 1))
	return;

    /* Display symbol */
    big_pad(76, row, a, c);
}
Exemplo n.º 6
0
/*
 * Display the objects in a group.
 */
static void display_object(int col, int row, bool cursor, int oid)
{
	object_kind *kind = &k_info[oid];
	const char *inscrip = get_autoinscription(kind);

	char o_name[80];

	/* Choose a color */
	bool aware = (!kind->flavor || kind->aware);
	byte attr = curs_attrs[(int)aware][(int)cursor];

	/* Find graphics bits -- versions of the object_char and object_attr defines */
	bool use_flavour = (kind->flavor) && !(aware && kind->tval == TV_SCROLL);

	byte a = use_flavour ? kind->flavor->x_attr : kind->x_attr;
	byte c = use_flavour ? kind->flavor->x_char : kind->x_char;

	/* Display known artifacts differently */
	if (of_has(kind->flags, OF_INSTA_ART) && artifact_is_known(get_artifact_from_kind(kind)))
		get_artifact_display_name(o_name, sizeof(o_name), get_artifact_from_kind(kind));
	else
 		object_kind_name(o_name, sizeof(o_name), kind, OPT(cheat_know));

	/* If the type is "tried", display that */
	if (kind->tried && !aware)
		my_strcat(o_name, " {tried}", sizeof(o_name));

	/* Display the name */
	c_prt(attr, o_name, row, col);

	/* Show squelch status */
	if ((aware && kind_is_squelched_aware(kind)) ||
		(!aware && kind_is_squelched_unaware(kind)))
		c_put_str(attr, "Yes", row, 46);


	/* Show autoinscription if around */
	if (aware && inscrip)
		c_put_str(TERM_YELLOW, inscrip, row, 55);

	if (tile_height == 1) {
		big_pad(76, row, a, c);
	}
}
Exemplo n.º 7
0
/*
 * Display a monster
 */
static void display_monster(int col, int row, bool cursor, int oid)
{
	/* HACK Get the race index. (Should be a wrapper function) */
	int r_idx = default_join[oid].oid;

	/* Access the race */
	monster_race *r_ptr = &r_info[r_idx];
	monster_lore *l_ptr = &l_list[r_idx];

	/* Choose colors */
	byte attr = curs_attrs[CURS_KNOWN][(int) cursor];
	byte a = r_ptr->x_attr;
	wchar_t c = r_ptr->x_char;

	if ((tile_height != 1) && (a & 0x80)) {
		a = r_ptr->d_attr;
		c = r_ptr->d_char;
	}

	/* Display the name */
	c_prt(attr, r_ptr->name, row, col);

	/* Monster recall window */
	if (cursor) {
		character_icky--;
		character_icky--;
		p_ptr->monster_race_idx = r_idx;
		p_ptr->redraw |= PR_MONSTER;
		handle_stuff(p_ptr);
		character_icky++;
		character_icky++;
	}

	/* Display symbol */
	big_pad(66, row, a, c);

	/* Display kills */
	if (rf_has(r_ptr->flags, RF_UNIQUE))
		put_str(format("%s", (r_ptr->max_num == 0) ? " dead" : "alive"),
				row, 70);
	else
		put_str(format("%5d", l_ptr->pkills), row, 70);
}
Exemplo n.º 8
0
/*
 * Display glyph and colours
 */
static void display_glyphs(int col, int row, int height, int width, byte a,
						   wchar_t c)
{
	int i;
	int x, y;

	/* Clear the display lines */
	for (i = 0; i < height; i++)
		Term_erase(col, row + i, width);

	/* Prompt */
	prt("Choose colour:", row + height / 2, col);
	Term_locate(&x, &y);
	for (i = 0; i < MAX_COLORS; i++)
		big_pad(x + i, y, i, c);

	/* Place the cursor */
	Term_gotoxy(x + a, y);
}
Exemplo n.º 9
0
static void gf_display(menu_type *m, int type, bool cursor,
		int row, int col, int wid)
{
	size_t i;

	byte attr = curs_attrs[CURS_KNOWN][(int)cursor];
	const char *gf_name = gf_idx_to_name(type);

	if (type % 2)
		c_prt(attr, ".........................", row, col);
	c_put_str(attr, gf_name, row, col);

	col += 25;

	if (tile_height == 1) {
		for (i = 0; i < BOLT_MAX; i++) {
			col += big_pad(col, row, gf_to_attr[type][i], gf_to_char[type][i]);
		}
	} else {
		prt("Change tile_height to 1 to see graphics.", row, col);
	}
}
Exemplo n.º 10
0
/*
 * Display the features in a group.
 */
static void display_feature(int col, int row, bool cursor, int oid)
{
    /* Get the feature index */
    int f_idx = oid;

    /* Access the feature */
    feature_type *f_ptr = &f_info[f_idx];

    /* Choose a color */
    byte attr = curs_attrs[CURS_KNOWN][(int) cursor];

    /* Display the name */
    c_prt(attr, f_ptr->name, row, col);

    if ((tile_width > 1) || (tile_height > 1))
	return;

    /* Display symbol */
    big_pad(68, row, f_ptr->x_attr, f_ptr->x_char);

    /* ILLUMINATION AND DARKNESS GO HERE */

}
Exemplo n.º 11
0
/*
 * Display a monster
 */
static void display_monster(int col, int row, bool cursor, int oid)
{
	/* HACK Get the race index. (Should be a wrapper function) */
	int r_idx = default_join[oid].oid;

	/* Access the race */
	monster_race *r_ptr = &r_info[r_idx];
	monster_lore *l_ptr = &l_list[r_idx];

	/* Choose colors */
	byte attr = curs_attrs[CURS_KNOWN][(int)cursor];
	byte a = r_ptr->x_attr;
	byte c = r_ptr->x_char;

	if ((tile_height != 1) && (a & 0x80)) {
		a = r_ptr->d_attr;
		c = r_ptr->d_char;
		/* If uniques are purple, make it so */
		if (OPT(purple_uniques) && rf_has(r_ptr->flags, RF_UNIQUE))
			a = TERM_VIOLET;
	}
	/* If uniques are purple, make it so */
	else if (OPT(purple_uniques) && !(a & 0x80) && rf_has(r_ptr->flags, RF_UNIQUE))
		a = TERM_VIOLET;

	/* Display the name */
	c_prt(attr, r_ptr->name, row, col);

	/* Display symbol */
	big_pad(66, row, a, c);

	/* Display kills */
	if (rf_has(r_ptr->flags, RF_UNIQUE))
		put_str(format("%s", (r_ptr->max_num == 0)?  " dead" : "alive"), row, 70);
	else
		put_str(format("%5d", l_ptr->pkills), row, 70);
}