mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
InventoryView.unbind()
This commit is contained in:
parent
a8aa0550c9
commit
fa57a898d7
3 changed files with 13 additions and 10 deletions
|
|
@ -409,20 +409,11 @@ void Hud::openPermanent(UiDocument* doc) {
|
|||
}
|
||||
|
||||
void Hud::closeInventory() {
|
||||
auto level = frontend->getLevel();
|
||||
|
||||
inventoryOpen = false;
|
||||
ItemStack& grabbed = interaction->getGrabbedItem();
|
||||
grabbed.clear();
|
||||
inventoryView = nullptr;
|
||||
if (blockUI) {
|
||||
auto blockinv = blockUI->getInventory();
|
||||
// todo: do it automatically
|
||||
if (blockinv->isVirtual()) {
|
||||
level->inventories->remove(blockinv->getId());
|
||||
}
|
||||
blockUI = nullptr;
|
||||
}
|
||||
blockUI = nullptr;
|
||||
secondUI = nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -458,6 +449,9 @@ void Hud::remove(HudElement& element) {
|
|||
inventory = invview->getInventory().get();
|
||||
}
|
||||
scripting::on_ui_close(document, inventory);
|
||||
if (invview) {
|
||||
invview->unbind();
|
||||
}
|
||||
}
|
||||
gui->remove(element.getNode());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue