don-tnowe / godot-wyvernbox-inventory

Action RPG-focused inventory system for Godot 3 and 4
MIT License
105 stars 4 forks source link

`ItemStackView`s may take up `InventoryView`'s whole rect #10

Closed don-tnowe closed 1 year ago

don-tnowe commented 1 year ago

Steps to reproduce

This does occur in example, commit 312ddf1bd67338c9adf33a28a73ab407c9e2490f :

Equipment, ammo and currency inventories are fine, while Potion views will be stretched.

don-tnowe commented 1 year ago

Update: this happens if the "Cells" node is a container, but not if it's a base Control. The children of the "Cells" node start at the wrong size, the stack views get their rect set from those wrong sizes. Presumably, they're correct next frame, but the stack views were already repositioned.

After putting call_deferred() everywhere, I decided to use await and looks like you need to wait for visibility_changed then process_frame. sort_children, weirdly, doesn't work even if you wait a frame.