Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/inventory.cc')
-rw-r--r--src/client/inventory.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/inventory.cc b/src/client/inventory.cc
index c6e86da..4894d3d 100644
--- a/src/client/inventory.cc
+++ b/src/client/inventory.cc
@@ -100,12 +100,18 @@ void Inventory::update_inventory()
str << item->info()->name().c_str();
if (item->amount() > 0) {
str << " (" << item->amount() << ")";
- }
+ }
+
listitem = new ui::ListItem(menu_listview, str.str().c_str());
listitem->set_height(listitem->font()->height() * 2.0f);
listitem->set_item(item);
listitem->set_info(item->info());
+ std::string sortkey(item->info()->type()->label());
+ sortkey += '.';
+ sortkey += item->info()->label();
+ listitem->set_sortkey(sortkey);
+
// preserve previous selection during update
if (item == selecteditem) {
menu_listview->select(listitem);
@@ -128,6 +134,7 @@ void Inventory::update_inventory()
set_info(0, 0);
}
+ menu_listview->sort();
menu_listview->event_resize();
}