summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-08 12:01:51 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-08 12:01:51 +0000
commit27e5b16df763242782f7af14b5cd3fc099c03e10 (patch)
treecf1c77f2ccda24f7c6b980ac1e06d2ac87430aa6
parent4469995c7c38d8e7ee299ad4abd62888e859b204 (diff)
downloadcrawl-ref-27e5b16df763242782f7af14b5cd3fc099c03e10.tar.gz
crawl-ref-27e5b16df763242782f7af14b5cd3fc099c03e10.zip
Escape cancels out of ability and spell menus for 0.3.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2374 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abl-show.cc9
-rw-r--r--crawl-ref/source/spl-cast.cc4
2 files changed, 11 insertions, 2 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index e22fb3b0d6..b3e5e9e2fb 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -834,6 +834,11 @@ bool activate_ability()
if ( keyin == '?' || keyin == '*' )
{
selected = choose_ability_menu(talents);
+ if (selected == -1)
+ {
+ canned_msg( MSG_OK );
+ return (false);
+ }
}
else if (keyin == ESCAPE || keyin == ' ' ||
keyin == '\r' || keyin == '\n')
@@ -1796,7 +1801,9 @@ int choose_ability_menu(const std::vector<talent>& talents)
{
Menu abil_menu(MF_SINGLESELECT | MF_ANYPRINTABLE);
abil_menu.set_highlighter(NULL);
- abil_menu.set_title(new MenuEntry(" Ability Cost Success"));
+ abil_menu.set_title(
+ new MenuEntry(" Ability "
+ "Cost Success"));
int numbers[52];
for ( int i = 0; i < 52; ++i )
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 4057290db2..ffe21b064e 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -614,10 +614,12 @@ bool cast_a_spell()
if (keyin == '?' || keyin == '*')
{
keyin = list_spells();
+ if (!keyin)
+ keyin = ESCAPE;
redraw_screen();
- if ( isalpha(keyin) )
+ if ( isalpha(keyin) || keyin == ESCAPE )
break;
else
mesclr();