mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add 'inventory' property to slot ui element
This commit is contained in:
parent
2668b8e17b
commit
4d99508ca1
3 changed files with 10 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue