diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/inventorywindow.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/client/inventorywindow.cc b/src/client/inventorywindow.cc index 0d91b4d..51ced0e 100644 --- a/src/client/inventorywindow.cc +++ b/src/client/inventorywindow.cc @@ -92,6 +92,8 @@ void InventoryWindow::toggle() } void InventoryWindow::update_inventory() { + const core::Item *selecteditem = (inventorywindow_listview->selected() ? inventorywindow_listview->selected()->item() : 0); + inventorywindow_listview->clear(); inventorywindow_inventorytimestamp = 0; inventorywindow_infotimestamp = 0; @@ -100,7 +102,6 @@ void InventoryWindow::update_inventory() return; } - const core::Item *selecteditem = (inventorywindow_listview->selected() ? inventorywindow_listview->selected()->item() : 0); for (core::Inventory::Items::const_iterator it = core::localcontrol()->inventory()->items().begin(); it != core::localcontrol()->inventory()->items().end(); it++) { core::Item *item = (*it); @@ -166,12 +167,8 @@ void InventoryWindow::update_inventory() inventorywindow_inventorytimestamp = core::localcontrol()->inventory()->timestamp(); - if (inventorywindow_listview->selected()) { - set_info(inventorywindow_listview->selected()->info(), inventorywindow_listview->selected()->item()->amount()); - } else if (inventorywindow_inforecord != core::localcontrol()->info()) { - set_info(0, 0); - } - + show_item_info(inventorywindow_listview->selected()); + inventorywindow_listview->sort(); inventorywindow_listview->event_resize(); } @@ -376,7 +373,9 @@ void InventoryWindow::show_item_info(const ui::ListItem *listitem) set_info(listitem->info(), listitem->item()->amount()); if (listitem->item()->amount()) { inventorywindow_ejectbutton->enable(); - inventorywindow_mountbutton->enable(); + if (listitem->item()->has_flag(core::Item::Unique) && !listitem->item()->has_flag(core::Item::Mounted)) { + inventorywindow_mountbutton->enable(); + } } } else { set_info(0, 0); |