diff options
author | elliptic <hyperelliptical@gmail.com> | 2014-03-13 11:21:39 -0400 |
---|---|---|
committer | elliptic <hyperelliptical@gmail.com> | 2014-03-13 11:21:39 -0400 |
commit | 65a9edfe2fbc8b5689cf78d09e90af6b958896ee (patch) | |
tree | b7785c30829b4677a8b6e459f4ce236d9edc7888 /crawl-ref/source/shopping.cc | |
parent | 6b74f4262bfb23b6361bb9599c4ab39cd04a722c (diff) | |
download | crawl-ref-65a9edfe2fbc8b5689cf78d09e90af6b958896ee.tar.gz crawl-ref-65a9edfe2fbc8b5689cf78d09e90af6b958896ee.zip |
Simplify shopping interface.
Previously the interface for removing items from the shopping list while in
a shop behaved differently depending on whether you could afford to buy the
item. Now it doesn't; instead simply:
* lowercase letters change the status of an item to '+' (selected to buy),
or change to '-' (unselected and not on shopping list) if it was
already at '+'.
* uppercase letters change the status of an item to '$' (on shopping list),
or change to '-' if it was already at '$'.
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r-- | crawl-ref/source/shopping.cc | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index c5a327da88..e25758d63b 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -708,9 +708,8 @@ static bool _in_a_shop(int shopidx, int &num_in_list) } else { - // Uppercase means add the item to the shopping list or - // remove it from the shopping list and mark for purchase - // without confirmation. + // Uppercase means toggle the item on the shopping list + // (unmarking for purchase if it was marked). bool to_shoplist = isaupper(key); key = toalower(key) - 'a'; if (key >= static_cast<int>(stock.size())) @@ -746,23 +745,19 @@ static bool _in_a_shop(int shopidx, int &num_in_list) id_stock); if (in_list[key]) { - if (gp_value <= you.gold || to_shoplist) + if (to_shoplist) { shopping_list.del_thing(item); in_list[key] = false; - // Will be toggled to true later selected[key] = false; + continue; } else { - if (_shop_yesno("Remove from shopping list? (y/N)", - 'n')) - { - shopping_list.del_thing(item); - in_list[key] = false; - selected[key] = false; - } - continue; + shopping_list.del_thing(item); + in_list[key] = false; + // Will be toggled to true later + selected[key] = false; } } else if (to_shoplist) |