mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Better inventory counter
This commit is contained in:
parent
1c145e8d3a
commit
43d4e8aad2
@ -34,14 +34,7 @@ impl Inventory {
|
||||
self.amount = 0;
|
||||
for item in self.slots.iter() {
|
||||
if let Some(item) = item {
|
||||
match item.kind {
|
||||
ItemKind::Tool(_) | ItemKind::Armor { .. } => self.amount += 1,
|
||||
ItemKind::Utility { amount, .. }
|
||||
| ItemKind::Ingredient { amount, .. }
|
||||
| ItemKind::Consumable { amount, .. } => {
|
||||
self.amount += amount;
|
||||
},
|
||||
}
|
||||
self.amount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ impl<'a> Widget for Bag<'a> {
|
||||
&self.localized_strings.get("hud.bag.exp")
|
||||
);
|
||||
let space_used = inventory.amount;
|
||||
let space_max = 0;
|
||||
let space_max = inventory.slots.len();
|
||||
let bag_space = format!("{}/{}", space_used, space_max);
|
||||
let level = (self.stats.level.level()).to_string();
|
||||
let currency = 0; // TODO: Add as a Stat maybe?
|
||||
|
Loading…
Reference in New Issue
Block a user