diff options
Diffstat (limited to 'crawl-ref/source/message.cc')
-rw-r--r-- | crawl-ref/source/message.cc | 12 |
1 files changed, 10 insertions, 2 deletions
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: |