[Quest API] Add inventory->CountItemEquippedByID(item_id) and inventory->HasItemEquippedByID(item_id) to Perl/Lua. (#1963)

- Add $inventory->CountItemEquippedByID(item_id) to Perl.
- Add $inventory->HasItemEquippedByID(item_id) to Perl.
- Add inventory:CountItemEquippedByID(item_id) to Lua.
- Add inventory:HasItemEquippedByID(item_id) to Lua
This commit is contained in:
Kinglykrab
2022-02-06 13:21:48 -05:00
committed by GitHub
parent ee1f0ea91f
commit a5d8a64792
5 changed files with 88 additions and 0 deletions
+12
View File
@@ -174,6 +174,16 @@ bool Lua_Inventory::HasAugmentEquippedByID(uint32 item_id) {
return self->HasAugmentEquippedByID(item_id);
}
int Lua_Inventory::CountItemEquippedByID(uint32 item_id) {
Lua_Safe_Call_Int();
return self->CountItemEquippedByID(item_id);
}
bool Lua_Inventory::HasItemEquippedByID(uint32 item_id) {
Lua_Safe_Call_Bool();
return self->HasItemEquippedByID(item_id);
}
luabind::scope lua_register_inventory() {
return luabind::class_<Lua_Inventory>("Inventory")
.def(luabind::constructor<>())
@@ -185,6 +195,7 @@ luabind::scope lua_register_inventory() {
.def("CanItemFitInContainer", (bool(Lua_Inventory::*)(Lua_Item,Lua_Item))&Lua_Inventory::CanItemFitInContainer)
.def("CheckNoDrop", (bool(Lua_Inventory::*)(int))&Lua_Inventory::CheckNoDrop)
.def("CountAugmentEquippedByID", (int(Lua_Inventory::*)(uint32))&Lua_Inventory::CountAugmentEquippedByID)
.def("CountItemEquippedByID", (int(Lua_Inventory::*)(uint32))&Lua_Inventory::CountItemEquippedByID)
.def("DeleteItem", (bool(Lua_Inventory::*)(int))&Lua_Inventory::DeleteItem)
.def("DeleteItem", (bool(Lua_Inventory::*)(int,int))&Lua_Inventory::DeleteItem)
.def("FindFreeSlot", (int(Lua_Inventory::*)(bool,bool))&Lua_Inventory::FindFreeSlot)
@@ -202,6 +213,7 @@ luabind::scope lua_register_inventory() {
.def("HasItemByUse", (int(Lua_Inventory::*)(int))&Lua_Inventory::HasItemByUse)
.def("HasItemByUse", (int(Lua_Inventory::*)(int,uint8))&Lua_Inventory::HasItemByUse)
.def("HasItemByUse", (int(Lua_Inventory::*)(int,uint8,uint8))&Lua_Inventory::HasItemByUse)
.def("HasItemEquippedByID", (bool(Lua_Inventory::*)(uint32))&Lua_Inventory::HasItemEquippedByID)
.def("HasSpaceForItem", (bool(Lua_Inventory::*)(Lua_Item,int))&Lua_Inventory::HasSpaceForItem)
.def("PopItem", (Lua_ItemInst(Lua_Inventory::*)(int))&Lua_Inventory::PopItem)
.def("PushCursor", (int(Lua_Inventory::*)(Lua_ItemInst))&Lua_Inventory::PushCursor)