diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-04 20:47:43 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-04 20:47:43 +0000 |
commit | 22e8777cd20d3bf9a9bce64901c4838f99fe9326 (patch) | |
tree | 70880152136ee9d5d0156c5df0555912ad73a449 /crawl-ref/source | |
parent | 013e0c0e9f3d7f35d9a9f8565622f4d7f3d17dee (diff) | |
download | crawl-ref-22e8777cd20d3bf9a9bce64901c4838f99fe9326.tar.gz crawl-ref-22e8777cd20d3bf9a9bce64901c4838f99fe9326.zip |
Don't pass number of columns to print_formatted_paragraph(), since it always
uses the width of the screen anyway. Have print_formatted_paragraph() respect
delay_message_clear. Fixes [2492045].
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8894 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/acr.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/delay.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/directn.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/menu.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/menu.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/state.cc | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d1eb144496..60c93c8774 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1753,7 +1753,7 @@ void process_command( command_type cmd ) // exists, give a message to explain what's going on. std::string str = "Move the cursor to view the level map, or " "type <w>?</w> for a list of commands."; - print_formatted_paragraph(str, get_number_of_cols()); + print_formatted_paragraph(str); #endif show_map(pos, true); @@ -1952,7 +1952,7 @@ void process_command( command_type cmd ) { std::string msg = "Unknown command. (For a list of commands type " "<w>?\?<lightgrey>.)"; - print_formatted_paragraph(msg, get_number_of_cols()); + print_formatted_paragraph(msg); } else // well, not examine, but... mpr("Unknown command.", MSGCH_EXAMINE_FILTER); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 276ee762e4..08a7e92d9f 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1828,9 +1828,7 @@ inline static bool _monster_warning(activity_interrupt_type ai, text += " " + mon->pronoun(PRONOUN_CAP) + " is" + mweap + "."; } - print_formatted_paragraph(text, - get_number_of_cols(), - MSGCH_WARN); + print_formatted_paragraph(text, MSGCH_WARN); const_cast<monsters*>(mon)->seen_context = "just seen"; } diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 88655f4be4..b2c8247267 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -2853,9 +2853,8 @@ std::string _mon_enchantments_string(const monsters* mon) static void _describe_monster(const monsters *mon) { // First print type and equipment. - const int numcols = get_number_of_cols(); std::string text = get_monster_desc(mon) + "."; - print_formatted_paragraph(text, numcols); + print_formatted_paragraph(text); if (player_mesmerised_by(mon)) mpr("You are mesmerised by her song.", MSGCH_EXAMINE); @@ -2956,7 +2955,7 @@ static void _describe_monster(const monsters *mon) text = _mon_enchantments_string(mon); if (!text.empty()) - print_formatted_paragraph(text, numcols); + print_formatted_paragraph(text); } // This method is called in two cases: @@ -3122,7 +3121,7 @@ static void _describe_cell(const coord_def& where, bool in_range) #else msg = "(Press <w>v</w> for more information.)"; #endif - print_formatted_paragraph(msg, get_number_of_cols()); + print_formatted_paragraph(msg); } } @@ -3202,7 +3201,7 @@ static void _describe_cell(const coord_def& where, bool in_range) #else feature_desc += " (Press <w>v</w> for more information.)"; #endif - print_formatted_paragraph(feature_desc, get_number_of_cols()); + print_formatted_paragraph(feature_desc); } else { diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 727948aadd..88e1238cd2 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -1566,9 +1566,12 @@ std::string get_linebreak_string(const std::string& s, int maxcol) // Takes a (possibly tagged) string, breaks it into lines and // prints it into the given message channel. -void print_formatted_paragraph(std::string &s, int maxcol, - msg_channel_type channel) +void print_formatted_paragraph(std::string &s, msg_channel_type channel) { + int maxcol = get_number_of_cols(); + if (Options.delay_message_clear) + --maxcol; + linebreak_string2(s,maxcol); std::string text; diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h index 7ac3fc90b8..d4bd101a47 100644 --- a/crawl-ref/source/menu.h +++ b/crawl-ref/source/menu.h @@ -507,8 +507,8 @@ protected: int linebreak_string( std::string& s, int wrapcol, int maxcol ); int linebreak_string2( std::string& s, int maxcol ); -void print_formatted_paragraph( std::string &s, int maxcol, - msg_channel_type channel = MSGCH_PLAIN); +void print_formatted_paragraph(std::string &s, + msg_channel_type channel = MSGCH_PLAIN); std::string get_linebreak_string(const std::string& s, int maxcol); #endif diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc index 3981bf2aa4..a0023224b7 100644 --- a/crawl-ref/source/state.cc +++ b/crawl-ref/source/state.cc @@ -197,7 +197,7 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, { std::string text = get_monster_desc(mon, false); text += " comes into view."; - print_formatted_paragraph(text, get_number_of_cols(), MSGCH_WARN); + print_formatted_paragraph(text, MSGCH_WARN); } if (Options.tutorial_left) |