From 67f07e0aa94db80e3121490159da5234c06e825c Mon Sep 17 00:00:00 2001 From: ennewalker Date: Fri, 4 Jul 2008 22:23:20 +0000 Subject: [2010665] Fixing some delay_message_clear-related bugs. Fixing issue (console and tiles) where colored output was not getting indented properly. I also modified mpr_formatted_output to pass newline=true for the last bit of text when calling message_out. I couldn't figure out how the console version was scrolling mpr_formatted_output and the tiles version was not. However, any mpr function should always scroll the message window (in my opinion), so it seemed like the right thing to do. Also, fixing a tutorial message color formatting typo. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6399 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/message.cc | 12 ++++++++++-- crawl-ref/source/tutorial.cc | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index e933a4c915..957b5b6b2c 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -706,7 +706,7 @@ static void base_mpr(const char *inf, msg_channel_type channel, int param) static void mpr_formatted_output(formatted_string fs, int colour) { - int curcol = 1; + int curcol = Options.delay_message_clear ? 2 : 1; if (need_prefix) { @@ -715,6 +715,14 @@ static void mpr_formatted_output(formatted_string fs, int colour) need_prefix = false; } + // Find last text op so that we can scroll the output. + unsigned last_text = fs.ops.size(); + for (unsigned i = 0; i < fs.ops.size(); ++i) + { + if (fs.ops[i].type == FSOP_TEXT) + last_text = i; + } + for (unsigned i = 0; i < fs.ops.size(); ++i) { switch (fs.ops[i].type) @@ -724,7 +732,7 @@ static void mpr_formatted_output(formatted_string fs, int colour) break; case FSOP_TEXT: message_out(Message_Line, colour, fs.ops[i].text.c_str(), curcol, - false); + (i == last_text)); curcol += multibyte_strlen(fs.ops[i].text); break; case FSOP_CURSOR: diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 5637961f94..5e2398e238 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -2225,7 +2225,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) case TUT_SHIFT_RUN: text << "Walking around takes fewer keystrokes if you press " - "Shift-direction or / direction. " + "Shift-direction or / direction. " "That will let you run until a monster comes into sight or " "your character sees something interesting."; break; -- cgit v1.2.3-54-g00ecf