add 'inventory' property to slot ui element

This commit is contained in:
MihailRis 2025-12-10 21:45:22 +03:00
parent 2668b8e17b
commit 4d99508ca1
3 changed files with 10 additions and 3 deletions

View file

@ -209,6 +209,8 @@ static int p_get_inventory(UINode* node, lua::State* L) {
if (auto inventory = dynamic_cast<InventoryView*>(node)) {
auto inv = inventory->getInventory();
return lua::pushinteger(L, inv ? inv->getId() : 0);
} else if (auto slot = dynamic_cast<SlotView*>(node)) {
return lua::pushinteger(L, slot->getInventoryId());
}
return 0;
}