add hud.open inventory events support
This commit is contained in:
parent
80128a4190
commit
90fc559234
@ -413,6 +413,7 @@ std::shared_ptr<Inventory> Hud::openInventory(
|
||||
}
|
||||
secondInvView->bind(inv, &content);
|
||||
add(HudElement(hud_element_mode::inventory_bound, doc, secondUI, false));
|
||||
scripting::on_inventory_open(&player, *inv);
|
||||
return inv;
|
||||
}
|
||||
|
||||
@ -522,6 +523,9 @@ void Hud::closeInventory() {
|
||||
scripting::on_inventory_closed(&player, *blockUI->getInventory());
|
||||
blockUI = nullptr;
|
||||
}
|
||||
if (secondInvView) {
|
||||
scripting::on_inventory_closed(&player, *secondInvView->getInventory());
|
||||
}
|
||||
dropExchangeSlot();
|
||||
gui.remove(SlotView::EXCHANGE_SLOT_NAME);
|
||||
exchangeSlot = nullptr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user