summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/message.cc26
-rw-r--r--crawl-ref/source/message.h1
3 files changed, 26 insertions, 4 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index f8b9d9572f..e87e5ab535 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1524,6 +1524,9 @@ static void _input()
return;
}
+ // Stop autoclearing more now that we have control back.
+ reset_more_autoclear();
+
if (need_to_autopickup())
autopickup();
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index 378e6cbf15..8e91994565 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -368,9 +368,6 @@ static void do_message_print( msg_channel_type channel, int param,
buff[199] = 0;
mpr(buff, channel, param);
-
- if (channel == MSGCH_ERROR)
- interrupt_activity( AI_FORCE_INTERRUPT );
}
void mprf( msg_channel_type channel, int param, const char *format, ... )
@@ -692,6 +689,9 @@ static void base_mpr(const char *inf, msg_channel_type channel, int param)
message_out( Message_Line, colour, inf,
Options.delay_message_clear? 2 : 1 );
+ if (channel == MSGCH_PROMPT || channel == MSGCH_ERROR)
+ reset_more_autoclear();
+
for (unsigned i = 0; i < Options.force_more_message.size(); ++i)
{
if (Options.force_more_message[i].is_filtered( channel, imsg ))
@@ -704,6 +704,9 @@ static void base_mpr(const char *inf, msg_channel_type channel, int param)
}
mpr_store_messages(imsg, channel, param);
+
+ if (channel == MSGCH_ERROR)
+ interrupt_activity( AI_FORCE_INTERRUPT );
}
@@ -756,6 +759,12 @@ void formatted_mpr(const formatted_string& fs, msg_channel_type channel,
mpr_formatted_output(fs, colour);
mpr_store_messages(imsg, channel, param);
+
+ if (channel == MSGCH_PROMPT || channel == MSGCH_ERROR)
+ reset_more_autoclear();
+
+ if (channel == MSGCH_ERROR)
+ interrupt_activity( AI_FORCE_INTERRUPT );
}
// Output given string as formatted message(s), but check patterns
@@ -850,6 +859,13 @@ void mesclr( bool force )
Message_Line = 0;
}
+static bool autoclear_more = false;
+
+void reset_more_autoclear()
+{
+ autoclear_more = false;
+}
+
void more(void)
{
#ifdef DEBUG_DIAGNOSTICS
@@ -860,7 +876,7 @@ void more(void)
}
#endif
- if (crawl_state.is_replaying_keys())
+ if (crawl_state.is_replaying_keys() || autoclear_more)
{
mesclr();
return;
@@ -891,6 +907,8 @@ void more(void)
}
while (keypress != ' ' && keypress != '\r' && keypress != '\n'
&& keypress != ESCAPE && keypress != -1);
+ if (keypress == ESCAPE)
+ autoclear_more = true;
}
mesclr(true);
} // end more()
diff --git a/crawl-ref/source/message.h b/crawl-ref/source/message.h
index 026ce47950..8b914e39b3 100644
--- a/crawl-ref/source/message.h
+++ b/crawl-ref/source/message.h
@@ -83,6 +83,7 @@ void replay_messages();
void set_colour(char set_message_colour);
+void reset_more_autoclear();
// last updated 13oct2003 {dlb}
/* ***********************************************************************