public void RefreshInventory() { itemList.Clear(); itemData = Session.session.player.GetAllItems(); UpdateWeightInfo(Item.TotalWeight(itemData)); itemData = Item.FilterByCategory(itemData, activeFilter); foreach (ItemData item in itemData) { itemList.AddItem(item.ToString()); } itemSelected = -1; if (itemInfo != null) { itemInfo.Hide(); } if (useButton != null) { useButton.Hide(); } if (dropButton != null) { dropButton.Hide(); } }
private void onItems() { mode = Mode.Item; reloadLists(); itemList.Clear(); foreach (Item item in items) { if (item != null) { string str = ""; str = String.Format("{0,3}: {1,-20} {2, 10}$ - {3,5} en stock", item.getId(), item.getNom(), item.getPrix(), item.getStock()); itemList.AddItem(str); } } var control = (Control)GetNode("Panel/Control"); control.Show(); }