From 137d900672cf15df2d5f3cf5988aff20d33620f7 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 25 Jan 2008 11:13:18 +0000 Subject: [1801838] Use a menu to show mutation list so long lists don't scroll off the end of the terminal. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3331 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/format.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crawl-ref/source/format.cc') diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc index 33bb2a47d1..7d529315a3 100644 --- a/crawl-ref/source/format.cc +++ b/crawl-ref/source/format.cc @@ -31,6 +31,12 @@ int formatted_string::get_colour(const std::string &tag) return (colour != -1? colour : LIGHTGREY); } +// Parses a formatted string in much the same way as parse_string, but +// handles EOL by moving the cursor down to the next line instead of +// using a literal EOL. This is important if the text is not supposed +// to clobber existing text to the right of the lines being displayed +// (some of the tutorial messages need this). +// formatted_string formatted_string::parse_block( const std::string &s, bool eol_ends_format, @@ -208,6 +214,11 @@ std::string formatted_string::html_dump() const return s; } +bool formatted_string::operator < (const formatted_string &other) const +{ + return std::string(*this) < std::string(other); +} + const formatted_string & formatted_string::operator += (const formatted_string &other) { -- cgit v1.2.3-54-g00ecf