From 8bba03b41a5853a0fd8b9003ada577354e1d10ec Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Mar 2011 13:37:10 +0000 Subject: Grayed out trade items that are currently not available from a trader. --- src/client/inventorylistview.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/client/inventorylistview.cc') diff --git a/src/client/inventorylistview.cc b/src/client/inventorylistview.cc index e41aea2..8ec2c82 100644 --- a/src/client/inventorylistview.cc +++ b/src/client/inventorylistview.cc @@ -60,9 +60,13 @@ void InventoryListView::set_inventory(core::Inventory *inventory, core::InfoType std::string sortkey; std::ostringstream str; + + if (item->amount() == 0) { + str << "^N"; + } str << item->info()->name().c_str(); - if (item->amount() >= 0) { + if (item->amount() > 0) { str << " (" << item->amount() << ")"; } @@ -79,6 +83,10 @@ void InventoryListView::set_inventory(core::Inventory *inventory, core::InfoType listitem->set_item(item); listitem->set_info(item->info()); listitem->set_sortkey(sortkey); + + //if (item->amount() == 0) { + // listitem->disable(); + //} // preserve previous selection during update if (item == selecteditem) { ui::ListView::select(listitem); -- cgit v1.2.3