displayed on screen. Still is a bit messy to use, and you must initialise the formatted_string with a base colour before using add_glyph(), or the formatted_string will reset to lightgrey after the glyph.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@897 c06c8d41-db1a-0410-9941-cceddc491573
X3RDT655FEYO6XEVPIUAPEPJZAFE55KZBH2AZOLK3NGHINMVIGFQC
GCIZIUXO5TYROKDUYB3HAY7H7MRDTJNM7HR7DGSH7KXDIZC2LCDAC
ID2OZJTHFXL74RVUCS3JCMDQEUHAXCQFZU7235VU6IEVAAUWD2FAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
ODNAIEJW732NG7USKQKCIP4R4DAEYXXJQX6LY7TIN32NKE75454QC
env.show_col[ex][ey] = monster->colour;
if (mons_friendly(monster))
{
env.show_col[ex][ey] |= COLFLAG_FRIENDLY_MONSTER;
}
else if (Options.stab_brand != CHATTR_NORMAL
&& mons_looks_stabbable(monster))
{
env.show_col[ex][ey] |= COLFLAG_WILLSTAB;
}
else if (Options.may_stab_brand != CHATTR_NORMAL
&& mons_looks_distracted(monster))
{
env.show_col[ex][ey] |= COLFLAG_MAYSTAB;
}
env.show_col[ex][ey] = get_mons_colour( monster );
void formatted_string::add_glyph(const item_def *item)
{
const int last_col = find_last_colour();
unsigned short ch, col;
get_item_glyph(item, &ch, &col);
this->textcolor(col);
this->cprintf("%c", ch);
this->textcolor(last_col);
}
void formatted_string::add_glyph(const monsters *mons)
{
const int last_col = find_last_colour();
unsigned short ch, col;
get_mons_glyph(mons, &ch, &col);
this->textcolor(col);
this->cprintf("%c", ch);
this->textcolor(last_col);
}