diff options
author | Neil Moore <neil@s-z.org> | 2012-07-05 01:34:04 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-07-05 02:36:01 -0400 |
commit | 33a2b7e32a922aaae6c83d1cfbe31625ce1c1014 (patch) | |
tree | 3e8f04062c4c73e4dc014c6551180ce151af0df1 /crawl-ref/source/menu.cc | |
parent | e6c9c25219475abd3e9fb94264b8c822e228c5b0 (diff) | |
download | crawl-ref-33a2b7e32a922aaae6c83d1cfbe31625ce1c1014.tar.gz crawl-ref-33a2b7e32a922aaae6c83d1cfbe31625ce1c1014.zip |
Don't break autopickup menu with easy_exit_menu = true.
Because we used MF_EASY_EXIT as a hack for regenerating the menu,
the user's easy_exit_menu option would prevent leaving the menu.
Instead use lastch == CONTROL('R') to indicate that the menu should
be re-entered, and respect the user's easy_exit_menu setting.
Unfortunately, easy_exit_menu was disallowed when anything is selected,
to prevent leaving e.g. the drop menu too soon. Override this behaviour
for MT_KNOW inventory menus.
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r-- | crawl-ref/source/menu.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index d358206a3c..109a7b9941 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -582,16 +582,18 @@ bool Menu::process_key(int keyin) #endif draw_menu(); } - // Easy exit should not kill the menu if there are selected items. - else if (sel.empty() && is_set(MF_EASY_EXIT)) - { - sel.clear(); + else if (allow_easy_exit() && is_set(MF_EASY_EXIT)) return (false); - } } return (true); } +// Easy exit should not kill the menu if there are selected items. +bool Menu::allow_easy_exit() const +{ + return sel.empty(); +} + bool Menu::draw_title_suffix(const std::string &s, bool titlefirst) { if (crawl_state.doing_prev_cmd_again) |