diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-21 17:54:43 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-21 17:54:43 +0000 |
commit | 0e472a37cd47225bb6660aa9f7d12320f7cd4582 (patch) | |
tree | d50e76bcb67c83f1bc6c7fbea08122302d6d00c4 /crawl-ref/source/shopping.cc | |
parent | a36fd3f9f0e5bde3dd9d74e1742cfbd2f045c635 (diff) | |
download | crawl-ref-0e472a37cd47225bb6660aa9f7d12320f7cd4582.tar.gz crawl-ref-0e472a37cd47225bb6660aa9f7d12320f7cd4582.zip |
* Fix 2862312: examination of items in shops not working after buying
something
* FR 2836364 : Make controlled blink contaminate the player.
* Fix 2841232: display "very slow" in the % screen.
* FR 2858960 : Re-add mouseover descriptions for previously seen (but
not detected) features out of sight, and for plain floor
the stash description like when using 'x'.
* Disallow placement of corpses within walls, and allow rock worms to
leave corpses elsewhere.
* Minor tweaks to the documentation.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10766 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r-- | crawl-ref/source/shopping.cc | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index bef60e9124..dfcdd0306a 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -92,13 +92,29 @@ static std::string _purchase_keys(const std::string &s) return (list); } -static void _list_shop_keys(const std::string &purchasable, bool viewing) +static void _list_shop_keys(const std::string &purchasable, bool viewing, + int total_stock) { + ASSERT(total_stock > 0); + char buf[200]; const int numlines = get_number_of_lines(); cgotoxy(1, numlines - 1, GOTO_CRT); - std::string pkeys = _purchase_keys(purchasable); + std::string pkeys = ""; + if (viewing) + { + pkeys = "<w>a</w>"; + if (total_stock > 1) + { + pkeys += "-<w>"; + pkeys += 'a' + total_stock - 1; + pkeys += "</w>"; + } + } + else + pkeys = _purchase_keys(purchasable); + if (!pkeys.empty()) { pkeys = "[" + pkeys + "] Select Item to " @@ -287,7 +303,7 @@ static bool _in_a_shop( int shopidx ) const std::string purchasable = _shop_print_stock(stock, selected, shop, total_cost); - _list_shop_keys(purchasable, viewing); + _list_shop_keys(purchasable, viewing, stock.size()); if (!total_cost) { @@ -356,7 +372,7 @@ static bool _in_a_shop( int shopidx ) _shop_print("I'm sorry, you don't seem to have enough money.", 1); } - else if (!total_cost) + else if (!total_cost) // Nothing selected. continue; else { @@ -451,7 +467,7 @@ static bool _in_a_shop( int shopidx ) item.flags |= (ISFLAG_IDENT_MASK | ISFLAG_NOTED_ID | ISFLAG_NOTED_GET); } - describe_item(item); + describe_item(item, false, true); if (id_stock) item.flags = old_flags; } |