diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-05 01:33:53 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-05 01:33:53 +0000 |
commit | 62f7040f14b39e67042be98f951575fbc819e84e (patch) | |
tree | d4fa0598a1bee1d34fff81e2c150de08c2256753 /crawl-ref/source/invent.cc | |
parent | 19155f1f85058ef9d65d11e60c63cc69c36d4e8a (diff) | |
download | crawl-ref-62f7040f14b39e67042be98f951575fbc819e84e.tar.gz crawl-ref-62f7040f14b39e67042be98f951575fbc819e84e.zip |
Tiles!
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3194 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r-- | crawl-ref/source/invent.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index f55cdd856b..49e497070a 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -44,6 +44,8 @@ #include "menu.h" #include "randart.h" +#include "tiles.h" + /////////////////////////////////////////////////////////////////////////////// // Inventory menu shenanigans @@ -350,6 +352,36 @@ void InvMenu::load_inv_items(int item_selector, } } +void InvMenu::draw_stock_item(int index, const MenuEntry *me) const +{ +#ifdef USE_TILE + const InvEntry *ie = dynamic_cast<const InvEntry*>(me); + if (ie && me->quantity > 0) + { + int draw_quantity = ie->quantity > 1 ? ie->quantity : -1; + bool is_item_on_floor = true; + bool is_item_tried = false; + char c = 0; + int idx = -1; + if (ie->item) + { + is_item_on_floor = ie->item->x != -1; + is_item_tried = item_type_tried(*ie->item); + c = ie->hotkeys.size() > 0 ? ie->hotkeys[0] : 0; + idx = (is_item_on_floor ? ie->item->index() : + letter_to_index(c)); + } + + TileDrawOneItem(REGION_INV2, get_entry_index(ie), c, + idx, tileidx_item(*ie->item), draw_quantity, + is_item_on_floor, ie->selected(), ie->is_item_equipped(), + is_item_tried, ie->is_item_cursed()); + } +#endif + + Menu::draw_stock_item(index, me); +} + template <std::string (*proc)(const InvEntry *a)> int compare_item_str(const InvEntry *a, const InvEntry *b) { |