1 #ifndef __ITEM_INFO_H 2 #define __ITEM_INFO_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include "bags.h" 9 10 /* used to enable equip swapping of equlivalent items by clicking twice */ 11 enum EQUIP_TYPE { EQUIP_NONE = 0, EQUIP_HEAD, EQUIP_BODY, EQUIP_LEGS, EQUIP_FEET, EQUIP_NECK, 12 EQUIP_RIGHT_HAND, EQUIP_LEFT_HAND, EQUIP_BOTH_HANDS, EQUIP_CLOAK }; 13 14 /* if true, items descrtion tooltips are enabled in the GUI */ 15 extern int show_item_desc_text; 16 17 /** 18 * @ingroup item_info 19 * @brief get the item description from the lookup table 20 * 21 * @param item_id the item unique id 22 * @param image_id the item image id 23 * @return Returns the description text 24 * @callgraph 25 */ 26 const char *get_item_description(Uint16 item_id, int image_id); 27 28 /** 29 * @ingroup item_info 30 * @brief get the item description from the lookup table, do not add extra tags such as "(read)" 31 * 32 * @param item_id the item unique id 33 * @param image_id the item image id 34 * @return Returns the description text 35 * @callgraph 36 */ 37 const char *get_basic_item_description(Uint16 item_id, int image_id); 38 39 /** 40 * @ingroup item_info 41 * @brief get the item emu from the lookup table 42 * 43 * @param item_id the item unique id 44 * @param image_id the item image id 45 * @return Returns the item enu 46 * @callgraph 47 */ 48 int get_item_emu(Uint16 item_id, int image_id); 49 50 /** 51 * @ingroup item_info 52 * @brief get the item equipment type from the lookup table 53 * 54 * @param item_id the item unique id 55 * @param image_id the item image id 56 * @return Returns the item equipment type, one of EQUIP_TYPE 57 * @callgraph 58 */ 59 enum EQUIP_TYPE get_item_equip_type(Uint16 item_id, int image_id); 60 61 /** 62 * @ingroup item_info 63 * @brief get the number of items that match these ids 64 * 65 * @param item_id the item unique id 66 * @param image_id the item image id 67 * @return Returns the number of matching items 68 * 69 * @callgraph 70 */ 71 int get_item_count(Uint16 item_id, int image_id); 72 73 /** 74 * @ingroup item_info 75 * @brief find out if we have item information 76 * 77 * @return Returns 1 if the information is available, otherwise 0 78 * @callgraph 79 */ 80 int item_info_available(void); 81 82 /** 83 * @ingroup item_info 84 * @brief CONSOLE_LOG help about enabling item_info, but only once and if needed 85 * 86 * @callgraph 87 */ 88 void item_info_help_if_needed(void); 89 90 /** 91 * @ingroup item_info 92 * @brief match passed string against specified item descriptions and return details for matches 93 * 94 * @param storage_items_filter an array for the matching results, element to zero if matching 95 * @param storage_items the items to check 96 * @param filter_item_text the text to match, the needle 97 * @param no_storage the number of items to check 98 * 99 * @callgraph 100 */ 101 void filter_items_by_description(Uint8 *storage_items_filter, const ground_item *storage_items, const char *filter_item_text, int no_storage); 102 103 104 #ifdef __cplusplus 105 } // extern "C" 106 #endif 107 108 #endif 109