diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-16 00:09:45 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-16 00:09:45 +0000 |
commit | 42f25ae23ee34f9ae3a0e31fc0039258deab2bc3 (patch) | |
tree | cb46297c71d456fe35854a23918518b900207089 /crawl-ref/source/invent.cc | |
parent | 84789445f8c4937c2930a0d67e602408c2605201 (diff) | |
download | crawl-ref-42f25ae23ee34f9ae3a0e31fc0039258deab2bc3.tar.gz crawl-ref-42f25ae23ee34f9ae3a0e31fc0039258deab2bc3.zip |
Support for inline graphics and mouse input on menus.
Menus in the console version should be unchanged. Let me know if this is not the case.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7258 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r-- | crawl-ref/source/invent.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index b387d75e20..5c4c7ecad5 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -382,19 +382,18 @@ void InvMenu::load_inv_items(int item_selector, int excluded_slot, set_title(""); } -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) - { - char key = ie->hotkeys.size() > 0 ? ie->hotkeys[0] : 0; - tiles.update_menu_inventory(get_entry_index(ie), *ie->item, ie->selected(), key); - } -#endif +bool InvEntry::tile(int &idx, TextureID &tex) const +{ + if (quantity <= 0) + return false; + + idx = tileidx_item(*item); + tex = TEX_DEFAULT; - Menu::draw_stock_item(index, me); + return (idx != 0); } +#endif bool InvMenu::is_selectable(int index) const { @@ -627,7 +626,7 @@ void InvMenu::load_items(const std::vector<const item_def*> &mitems, } // Don't make a menu so tall that we recycle hotkeys on the same page. - if (mitems.size() > 52) + if (mitems.size() > 52 && (max_pagesize > 52 || max_pagesize == 0)) set_maxpagesize(52); } |