MRMJ-1: Messenger & Skills fixes

This commit is contained in:
Mind Rapist
2025-12-14 05:12:39 +02:00
parent 436db01a80
commit 7b08687023
46 changed files with 1258 additions and 60 deletions

View File

@@ -1254,6 +1254,80 @@ PyObject * wndMgrSetSlotCoolTime(PyObject * poSelf, PyObject * poArgs)
return Py_BuildNone();
}
#ifdef FIX_REFRESH_SKILL_COOLDOWN
PyObject* wndMgrStoreSlotCoolTime(PyObject* poSelf, PyObject* poArgs)
{
UI::CWindow* pWin;
if (!PyTuple_GetWindow(poArgs, 0, &pWin))
return Py_BuildException();
int iKey;
if (!PyTuple_GetInteger(poArgs, 1, &iKey))
return Py_BuildException();
int iSlotIndex;
if (!PyTuple_GetInteger(poArgs, 2, &iSlotIndex))
return Py_BuildException();
float fCoolTime;
if (!PyTuple_GetFloat(poArgs, 3, &fCoolTime))
return Py_BuildException();
float fElapsedTime = 0.0f;
PyTuple_GetFloat(poArgs, 4, &fElapsedTime);
if (!pWin->IsType(UI::CSlotWindow::Type()))
return Py_BuildException();
UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin;
pSlotWin->StoreSlotCoolTime(iKey, iSlotIndex, fCoolTime, fElapsedTime);
return Py_BuildNone();
}
PyObject* wndMgrRestoreSlotCoolTime(PyObject* poSelf, PyObject* poArgs)
{
UI::CWindow* pWin;
if (!PyTuple_GetWindow(poArgs, 0, &pWin))
return Py_BuildException();
int iKey;
if (!PyTuple_GetInteger(poArgs, 1, &iKey))
return Py_BuildException();
if (!pWin->IsType(UI::CSlotWindow::Type()))
return Py_BuildException();
UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin;
pSlotWin->RestoreSlotCoolTime(iKey);
return Py_BuildNone();
}
PyObject* wndMgrTransferSlotCoolTime(PyObject* poSelf, PyObject* poArgs)
{
UI::CWindow* pWin;
if (!PyTuple_GetWindow(poArgs, 0, &pWin))
return Py_BuildException();
int iIndex1;
if (!PyTuple_GetInteger(poArgs, 1, &iIndex1))
return Py_BuildException();
int iIndex2;
if (!PyTuple_GetInteger(poArgs, 2, &iIndex2))
return Py_BuildException();
if (!pWin->IsType(UI::CSlotWindow::Type()))
return Py_BuildException();
UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin;
pSlotWin->TransferSlotCoolTime(iIndex1, iIndex2);
return Py_BuildNone();
}
#endif
PyObject * wndMgrSetToggleSlot(PyObject * poSelf, PyObject * poArgs)
{
assert(!"wndMgrSetToggleSlot");
@@ -2423,6 +2497,11 @@ void initwndMgr()
{ "SetSlotCount", wndMgrSetSlotCount, METH_VARARGS },
{ "SetSlotCountNew", wndMgrSetSlotCountNew, METH_VARARGS },
{ "SetSlotCoolTime", wndMgrSetSlotCoolTime, METH_VARARGS },
#ifdef FIX_REFRESH_SKILL_COOLDOWN
{ "StoreSlotCoolTime", wndMgrStoreSlotCoolTime, METH_VARARGS },
{ "RestoreSlotCoolTime", wndMgrRestoreSlotCoolTime, METH_VARARGS },
{ "TransferSlotCoolTime", wndMgrTransferSlotCoolTime, METH_VARARGS },
#endif
{ "SetToggleSlot", wndMgrSetToggleSlot, METH_VARARGS },
{ "ActivateSlot", wndMgrActivateSlot, METH_VARARGS },
{ "DeactivateSlot", wndMgrDeactivateSlot, METH_VARARGS },