diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-28 14:22:11 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-28 14:22:11 +0000 |
commit | 14855516c12f34ae5d289631a665d61837563a7a (patch) | |
tree | fe926753c926a5f4cb3365a2c8e02f88ea84c905 /crawl-ref/source/menu.h | |
parent | 1bbfa550c2f3a16c1a4964771e4905c90461442d (diff) | |
download | crawl-ref-14855516c12f34ae5d289631a665d61837563a7a.tar.gz crawl-ref-14855516c12f34ae5d289631a665d61837563a7a.zip |
Added add_glyph methods to formatted string to show a monster or item glyph as
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
Diffstat (limited to 'crawl-ref/source/menu.h')
-rw-r--r-- | crawl-ref/source/menu.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h index 2fe96eda3a..29b3d6351b 100644 --- a/crawl-ref/source/menu.h +++ b/crawl-ref/source/menu.h @@ -54,7 +54,7 @@ enum fs_op_type class formatted_string { public: - formatted_string() : ops() { } + formatted_string(int init_colour = 0); formatted_string(const std::string &s, int init_colour = 0); operator std::string() const; @@ -65,6 +65,8 @@ public: void cprintf(const std::string &s); void gotoxy(int x, int y); void movexy(int delta_x, int delta_y); + void add_glyph(const monsters *mons); + void add_glyph(const item_def *item); void textcolor(int color); void clear(); @@ -79,9 +81,11 @@ public: bool eol_ends_format = true, bool (*process_tag)(const std::string &tag) = NULL ); -public: static int get_colour(const std::string &tag); +private: + int find_last_colour() const; + public: struct fs_op { |