summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 01:19:56 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 01:19:56 +0000
commit725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd (patch)
treed2644ce5f13e7ab649b27b49f7bdcde18802a6b1 /crawl-ref/source/stuff.cc
parent1a36197574afe860feff7208cd883770a5d28946 (diff)
downloadcrawl-ref-725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd.tar.gz
crawl-ref-725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd.zip
Added new commands "re-do previous command" (bound to `) and "repeat
next command" (bound to 0). Though this is just an interface change, it changes code in the core input processing function (input() in acr.cc), and also messes around with the input buffer, so it could probably do with more testing before merging it into the 0.3 branch. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2137 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r--crawl-ref/source/stuff.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 36eb33d543..1b6afe54dd 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -621,27 +621,34 @@ void canned_msg(canned_message_type which_message)
break;
case MSG_TOO_BERSERK:
mpr("You are too berserk!");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_PRESENT_FORM:
mpr("You can't do that in your present form.");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_NOTHING_CARRIED:
mpr("You aren't carrying anything.");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_CANNOT_DO_YET:
mpr("You can't do that yet.");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_OK:
mpr("Okay, then.");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_UNTHINKING_ACT:
mpr("Why would you want to do that?");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_SPELL_FIZZLES:
mpr("The spell fizzles.");
break;
case MSG_HUH:
mpr("Huh?");
+ crawl_state.cancel_cmd_repeat();
break;
case MSG_EMPTY_HANDED:
mpr("You are now empty-handed.");
@@ -656,8 +663,9 @@ void canned_msg(canned_message_type which_message)
bool yesno( const char *str, bool safe, int safeanswer, bool clear_after,
bool interrupt_delays, bool noprompt )
{
- if (interrupt_delays)
+ if (interrupt_delays && !crawl_state.is_repeating_cmd())
interrupt_activity( AI_FORCE_INTERRUPT );
+
for (;;)
{
if ( !noprompt )
@@ -691,7 +699,9 @@ bool yesno( const char *str, bool safe, int safeanswer, bool clear_after,
// like yesno(), but returns 0 for no, 1 for yes, and -1 for quit
int yesnoquit( const char* str, bool safe, int safeanswer, bool clear_after )
{
- interrupt_activity( AI_FORCE_INTERRUPT );
+ if (!crawl_state.is_repeating_cmd())
+ interrupt_activity( AI_FORCE_INTERRUPT );
+
while (1)
{
mpr(str, MSGCH_PROMPT);