[Hide Content]From d5d07e5c6537b0e3fad5395ebbfb7e2e402cc5d5 Mon Sep 17 00:00:00 2001
From: Pekka Lampila <pekka.lampila@iki.fi>
Date: Sun, 17 Mar 2013 00:49:17 +0200
Subject: [PATCH] Don't use menu_sort option for (un)known item menu
Same thing for the found runes menu.
---
crawl-ref/source/invent.cc | 5 +++--
crawl-ref/source/invent.h | 2 +-
crawl-ref/source/itemname.cc | 6 +++---
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index c301813..b229bb1 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -809,14 +809,15 @@ void InvMenu::sort_menu(vector<InvEntry*> &invitems,
menu_letter InvMenu::load_items(const vector<const item_def*> &mitems,
MenuEntry *(*procfn)(MenuEntry *me),
- menu_letter ckey)
+ menu_letter ckey, bool sort)
{
FixedVector< int, NUM_OBJECT_CLASSES > inv_class(0);
for (int i = 0, count = mitems.size(); i < count; ++i)
inv_class[ mitems[i]->base_type ]++;
vector<InvEntry*> items_in_class;
- const menu_sort_condition *cond = find_menu_sort_condition();
+ const menu_sort_condition *cond = NULL;
+ if (sort) cond = find_menu_sort_condition();
for (int i = 0; i < NUM_OBJECT_CLASSES; ++i)
{
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h
index 980946c..1846285 100644
--- a/crawl-ref/source/invent.h
+++ b/crawl-ref/source/invent.h
@@ -145,7 +145,7 @@ public:
// NOTE: Does not set menu title, ever! You *must* set the title explicitly
menu_letter load_items(const vector<const item_def*> &items,
MenuEntry *(*procfn)(MenuEntry *me) = NULL,
- menu_letter ckey = 'a');
+ menu_letter ckey = 'a', bool sort = true);
// Loads items from the player's inventory into the menu, and sets the
// title to the stock title. If "procfn" is provided, it'll be called for
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 73e7232..99084dc 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -2382,9 +2382,9 @@ void check_item_knowledge(bool unknown_items)
menu.set_type(MT_KNOW);
menu_letter ml;
ml = menu.load_items(items, unknown_items ? unknown_item_mangle
- : known_item_mangle);
+ : known_item_mangle, 'a', false);
- ml = menu.load_items(items_missile, known_item_mangle, ml);
+ ml = menu.load_items(items_missile, known_item_mangle, ml, false);
menu.add_entry(new MenuEntry("Other Items", MEL_SUBTITLE));
menu.load_items_seq(items_other, known_item_mangle, ml);
@@ -2438,7 +2438,7 @@ void display_runes()
you.obtainable_runes));
menu.set_flags(MF_NOSELECT);
menu.set_type(MT_RUNES);
- menu.load_items(items, unknown_item_mangle);
+ menu.load_items(items, unknown_item_mangle, 'a', false);
menu.show();
menu.getkey();
redraw_screen();
--
1.7.10.4