diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-10 20:02:38 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-10 20:02:38 +0000 |
commit | b2d325166ee05741620ee70de5b47104e256f0b4 (patch) | |
tree | e3146b6c6a5a4ccb6e0eb6c531842dc07d83b049 /crawl-ref/source/invent.cc | |
parent | ae2a0b91978d593736cfea9b5d4ab2a6afd8c537 (diff) | |
download | crawl-ref-b2d325166ee05741620ee70de5b47104e256f0b4.tar.gz crawl-ref-b2d325166ee05741620ee70de5b47104e256f0b4.zip |
Greatly improve 'V' command:
* Add toggle to travel to items. (FR 2180269)
(Basically copied from StashSearchMenu, but I couldn't work out how to
change the title after the toggle.)
* Display monster tiles, yay!
* Space allowing, display monsters' description along with 'x'
information. (Ironically, though this was copied from Tiles, it only
works for ASCII at the moment.)
* Right-shift all entry types by 1 instead of just InvEntry, so it's
more consistent and looks better on the 'V' screen.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9409 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r-- | crawl-ref/source/invent.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 014054a747..cb0f5ececf 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -171,8 +171,9 @@ const int InvEntry::item_freshness() const void InvEntry::select(int qty) { - if ( item && item->quantity < qty ) + if (item && item->quantity < qty) qty = item->quantity; + MenuEntry::select(qty); } @@ -298,7 +299,7 @@ void InvEntry::set_show_glyph(bool doshow) InvMenu::InvMenu(int mflags) : Menu(mflags, "inventory", false), type(MT_INVLIST), pre_select(NULL), - title_annotate(NULL) + title_annotate(NULL), allow_toggle(false), menu_action(ACT_EXAMINE) { mdisplay->set_num_columns(2); } @@ -749,6 +750,13 @@ bool InvMenu::process_key( int key ) draw_select_count(0, true); return (true); } + else if (key == '!') + { + sel.clear(); + menu_action = (action)((menu_action+1) % ACT_NUM); + update_title(); + return (true); + } return Menu::process_key( key ); } |