feat: add special storage window definitions, player bindings, and UI module exports

This commit is contained in:
shen
2026-10-20 02:38:26 -07:00
parent 2fc99d2fe7
commit 9ef25b79d8
7 changed files with 158 additions and 3 deletions
@@ -948,6 +948,18 @@ PyObject * playerGetItemCountByVnum(PyObject* poSelf, PyObject* poArgs)
return Py_BuildValue("i", ItemNum);
}
#ifdef ENABLE_SPECIAL_STORAGE
PyObject * playerGetItemCountByTT(PyObject* poSelf, PyObject* poArgs)
{
int ivnum;
if (!PyTuple_GetInteger(poArgs, 0, &ivnum))
return Py_BuildException();
int ItemNum = CPythonPlayer::Instance().GetItemCountByTT(ivnum);
return Py_BuildValue("i", ItemNum);
}
#endif
// PORT: AVA2 pet dialogs identify the saved item and display its custom name.
static bool PortItemPosition(PyObject* args,TItemPos& cell)
{
@@ -2397,6 +2409,9 @@ void initPlayer()
{ "GetItemFlags", playerGetItemFlags, METH_VARARGS },
{ "GetItemCount", playerGetItemCount, METH_VARARGS },
{ "GetItemCountByVnum", playerGetItemCountByVnum, METH_VARARGS },
#ifdef ENABLE_SPECIAL_STORAGE
{ "GetItemCountByTT", playerGetItemCountByTT, METH_VARARGS },
#endif
{ "GetItemMetinSocket", playerGetItemMetinSocket, METH_VARARGS },
{ "GetItemID", playerGetItemID, METH_VARARGS },
{ "GetItemNewName", playerGetItemNewName, METH_VARARGS },
@@ -2627,6 +2642,13 @@ void initPlayer()
PyModule_AddIntConstant(poModule, "SLOT_TYPE_MALL", SLOT_TYPE_MALL);
PyModule_AddIntConstant(poModule, "SLOT_TYPE_EMOTION", SLOT_TYPE_EMOTION);
PyModule_AddIntConstant(poModule, "SLOT_TYPE_DRAGON_SOUL_INVENTORY", SLOT_TYPE_DRAGON_SOUL_INVENTORY);
#ifdef ENABLE_SPECIAL_STORAGE
PyModule_AddIntConstant(poModule, "SLOT_TYPE_UPGRADE_INVENTORY", SLOT_TYPE_UPGRADE_INVENTORY);
PyModule_AddIntConstant(poModule, "SLOT_TYPE_BOOK_INVENTORY", SLOT_TYPE_BOOK_INVENTORY);
PyModule_AddIntConstant(poModule, "SLOT_TYPE_STONE_INVENTORY", SLOT_TYPE_STONE_INVENTORY);
PyModule_AddIntConstant(poModule, "SLOT_TYPE_CHANGE_INVENTORY", SLOT_TYPE_CHANGE_INVENTORY);
PyModule_AddIntConstant(poModule, "SLOT_TYPE_COSTUME_INVENTORY", SLOT_TYPE_COSTUME_INVENTORY);
#endif
PyModule_AddIntConstant(poModule, "SLOT_TYPE_SWITCHBOT", SLOT_TYPE_SWITCHBOT); // PORT: AVA2 switchbot
PyModule_AddIntConstant(poModule, "ON_TOP_WND_NONE", 0);
@@ -2646,6 +2668,17 @@ void initPlayer()
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_INVENTORY", DRAGON_SOUL_INVENTORY);
PyModule_AddIntConstant(poModule, "GROUND", GROUND);
PyModule_AddIntConstant(poModule, "SWITCHBOT", SWITCHBOT); // PORT: AVA2 switchbot
#ifdef ENABLE_SPECIAL_STORAGE
PyModule_AddIntConstant(poModule, "UPGRADE_INVENTORY", UPGRADE_INVENTORY);
PyModule_AddIntConstant(poModule, "BOOK_INVENTORY", BOOK_INVENTORY);
PyModule_AddIntConstant(poModule, "STONE_INVENTORY", STONE_INVENTORY);
PyModule_AddIntConstant(poModule, "CHANGE_INVENTORY", CHANGE_INVENTORY);
PyModule_AddIntConstant(poModule, "COSTUME_INVENTORY", COSTUME_INVENTORY);
PyModule_AddIntConstant(poModule, "SPECIAL_PAGE_SIZE", c_Special_Inventory_Page_Size);
PyModule_AddIntConstant(poModule, "SPECIAL_PAGE_COUNT", c_Special_Inventory_Page_Count);
PyModule_AddIntConstant(poModule, "SPECIAL_SLOT_COUNT", c_Special_ItemSlot_Count);
#endif
PyModule_AddIntConstant(poModule, "ITEM_MONEY", -1);