mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix amounts out of range
This commit is contained in:
@ -583,6 +583,20 @@ impl<'a> Widget for Bag<'a> {
|
|||||||
.resize(inventory.len(), &mut ui.widget_id_generator());
|
.resize(inventory.len(), &mut ui.widget_id_generator());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if state.ids.amounts.len() < inventory.len() {
|
||||||
|
state.update(|s| {
|
||||||
|
s.ids
|
||||||
|
.amounts
|
||||||
|
.resize(inventory.len(), &mut ui.widget_id_generator());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if state.ids.amounts_bg.len() < inventory.len() {
|
||||||
|
state.update(|s| {
|
||||||
|
s.ids
|
||||||
|
.amounts_bg
|
||||||
|
.resize(inventory.len(), &mut ui.widget_id_generator());
|
||||||
|
});
|
||||||
|
}
|
||||||
// Expand img id cache to the number of slots
|
// Expand img id cache to the number of slots
|
||||||
if state.img_id_cache.len() < inventory.len() {
|
if state.img_id_cache.len() < inventory.len() {
|
||||||
state.update(|s| {
|
state.update(|s| {
|
||||||
|
Reference in New Issue
Block a user