From 214c798064a28a48126a6faf487303fab25b2dd7 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 25 Dec 2009 11:36:22 +0100 Subject: Add new inventory menu type for item knowledge. This means the knowledge menu is not affected by the main inventory sort options. In particular, this fixes item knowledge sort order breaking down once you know a lot of items of a given type. --- crawl-ref/source/enum.h | 4 ++-- crawl-ref/source/initfile.cc | 3 ++- crawl-ref/source/itemname.cc | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 322a67c270..61dbeb3b2f 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1590,8 +1590,8 @@ enum menu_type MT_INVLIST, // List inventory MT_DROP, - - MT_PICKUP + MT_PICKUP, + MT_KNOW }; enum mon_holy_type diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 396f217e40..529cbf4b04 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -4038,7 +4038,8 @@ void menu_sort_condition::set_menu_type(std::string &s) { "any:", MT_ANY }, { "inv:", MT_INVLIST }, { "drop:", MT_DROP }, - { "pickup:", MT_PICKUP } + { "pickup:", MT_PICKUP }, + { "know:", MT_KNOW } }; for (unsigned mi = 0; mi < ARRAYSZ(menu_type_map); ++mi) diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index ee2e39b4b5..8d487d2682 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1978,6 +1978,7 @@ bool check_item_knowledge(bool quiet) InvMenu menu; menu.set_title("You recognise:"); menu.set_flags(MF_NOSELECT); + menu.set_type(MT_KNOW); menu.load_items(items, discoveries_item_mangle); menu.show(); redraw_screen(); -- cgit v1.2.3-54-g00ecf