diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-08-02 12:54:15 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-08-02 12:54:15 +0000 |
commit | d5e5340c3926d1cf97f6cba151ffaecb20bfb35f (patch) | |
tree | d1faf7d5b27df8f3c523a8dd33357804118e62b1 /trunk/source/invent.h | |
parent | 7b2204d69f21d7075e4666ee032d7a129081bc4b (diff) | |
download | crawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.tar.gz crawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.zip |
Integrated travel patch as of 20060727
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'trunk/source/invent.h')
-rw-r--r-- | trunk/source/invent.h | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/trunk/source/invent.h b/trunk/source/invent.h index 2de7636200..624e603fc1 100644 --- a/trunk/source/invent.h +++ b/trunk/source/invent.h @@ -13,10 +13,26 @@ #define INVENT_H #include <stddef.h> +#include <vector> +#include "menu.h" #define PROMPT_ABORT -1 #define PROMPT_GOT_SPECIAL -2 +struct SelItem +{ + int slot; + int quantity; + const item_def *item; + + SelItem() : slot(0), quantity(0), item(NULL) { } + SelItem( int s, int q, const item_def *it = NULL ) + : slot(s), quantity(q), item(it) + { + } +}; + + int prompt_invent_item( const char *prompt, int type_expect, bool must_exist = true, bool allow_auto_list = true, @@ -24,12 +40,36 @@ int prompt_invent_item( const char *prompt, int type_expect, const char other_valid_char = '\0', int *const count = NULL ); +std::vector<SelItem> select_items( std::vector<item_def*> &items, + const char *title ); + +std::vector<SelItem> prompt_invent_items( + const char *prompt, + int type_expect, + std::string (*titlefn)( int menuflags, + const std::string &oldt ) + = NULL, + bool allow_auto_list = true, + bool allow_easy_quit = true, + const char other_valid_char = '\0', + std::vector<text_pattern> *filter = NULL, + Menu::selitem_tfn fn = NULL ); + + // last updated 12may2000 {dlb} /* *********************************************************************** * called from: invent - ouch - shopping * *********************************************************************** */ -unsigned char invent(int item_class_inv, bool show_price); +unsigned char invent( int item_class_inv, bool show_price ); +unsigned char invent_select(int item_class_inv, + int select_flags = MF_NOSELECT, + std::string (*titlefn)( int menuflags, + const std::string &oldt ) + = NULL, + std::vector<SelItem> *sels = NULL, + std::vector<text_pattern> *filter = NULL, + Menu::selitem_tfn fn = NULL ); // last updated 24may2000 {dlb} /* *********************************************************************** @@ -37,6 +77,7 @@ unsigned char invent(int item_class_inv, bool show_price); * *********************************************************************** */ unsigned char get_invent(int invent_type); +bool in_inventory(const item_def &i); // last updated 12may2000 {dlb} /* *********************************************************************** @@ -44,5 +85,9 @@ unsigned char get_invent(int invent_type); * *********************************************************************** */ void list_commands(bool wizard); +std::string item_class_name(int type, bool terse = false); + +void populate_item_menu( Menu *menu, const std::vector<item_def> &items, + void (*callback)(MenuEntry *me) ); #endif |