From 9ed0206d8ee412153e794327376ed40a6737da6c Mon Sep 17 00:00:00 2001 From: dshaligram Date: Thu, 11 Jan 2007 08:43:24 +0000 Subject: Fix pickup and stash-search menus having unselectable items if there are lots of items, and the term is taller than 52 lines. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@833 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/invent.cc | 4 ++++ crawl-ref/source/stash.cc | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 25da2931c9..34e708f276 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -307,6 +307,10 @@ void InvMenu::load_items(const std::vector &mitems, add_entry( procfn? (*procfn)(ie) : ie ); } } + + // Don't make a menu so tall that we recycle hotkeys on the same page. + if (mitems.size() > 52) + set_maxpagesize(52); } void InvMenu::do_preselect(InvEntry *ie) diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 8d6fd71f81..2a2f43b0f0 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -421,8 +421,8 @@ bool Stash::show_menu(const std::string &prefix, bool can_travel) const menu.can_travel = can_travel; mtitle->quantity = items.size(); menu.set_title(mtitle); - menu.load_items( InvMenu::xlat_itemvect(items), stash_menu_fixup); + std::vector sel; while (true) { @@ -1454,6 +1454,10 @@ void StashTracker::display_search_results( mtitle->quantity = results.size(); stashmenu.set_title(mtitle); + // Don't make a menu so tall that we recycle hotkeys on the same page. + if (results.size() > 52) + stashmenu.set_maxpagesize(52); + menu_letter hotkey; for (unsigned i = 0; i < results.size(); ++i, ++hotkey) { -- cgit v1.2.3-54-g00ecf