diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-31 19:25:30 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-31 19:25:30 +0000 |
commit | 7c5e54508666b65c7890ddc45880f64b38f887cb (patch) | |
tree | 452f6a59973c7f7236a2f9fb1f3b39c76eb088c9 /crawl-ref/source/invent.h | |
parent | 8df9960b2b34f903658b041751ef4a8c47338c10 (diff) | |
download | crawl-ref-7c5e54508666b65c7890ddc45880f64b38f887cb.tar.gz crawl-ref-7c5e54508666b65c7890ddc45880f64b38f887cb.zip |
sort_menus now allows the user to choose what menus to sort, and how to
sort items, at the cost of obfuscating the sort_menus option massively.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1494 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.h')
-rw-r--r-- | crawl-ref/source/invent.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h index 882b340a25..4278fa222a 100644 --- a/crawl-ref/source/invent.h +++ b/crawl-ref/source/invent.h @@ -56,6 +56,9 @@ private: static bool show_prices; static void set_show_prices(bool doshow); + mutable std::string basename; + mutable std::string qualname; + friend class InvShowPrices; public: @@ -64,6 +67,11 @@ public: InvEntry( const item_def &i ); std::string get_text() const; + const std::string &get_basename() const; + const std::string &get_qualname() const; + const std::string &get_fullname() const; + const bool is_item_cursed() const; + private: void add_class_hotkeys(const item_def &i); }; @@ -79,7 +87,7 @@ class InvMenu : public Menu { public: InvMenu(int mflags = MF_MULTISELECT) - : Menu(mflags), type(MT_INVSELECT), pre_select(NULL), + : Menu(mflags), type(MT_INVLIST), pre_select(NULL), title_annotate(NULL) { } @@ -119,6 +127,9 @@ public: protected: bool process_key(int key); void do_preselect(InvEntry *ie); + void sort_menu(std::vector<InvEntry*> &items, + const menu_sort_condition *cond); + const menu_sort_condition *find_menu_sort_condition() const; protected: menu_type type; @@ -140,7 +151,8 @@ int prompt_invent_item( const char *prompt, std::vector<SelItem> select_items( const std::vector<const item_def*> &items, - const char *title, bool noselect = false ); + const char *title, bool noselect = false, + menu_type mtype = MT_PICKUP ); std::vector<SelItem> prompt_invent_items( const char *prompt, @@ -187,4 +199,7 @@ std::string item_class_name(int type, bool terse = false); bool check_warning_inscriptions(const item_def& item, operation_types oper); bool has_warning_inscription(const item_def& item, operation_types oper); +void init_item_sort_comparators(item_sort_comparators &list, + const std::string &set); + #endif |