Jump to content

[Release] Color Slot Cube C++/Python


WorldArd

Mensajes recomendados

[Cliente/Root]

 

 

 

 

1.Abrir archivo "cube.py" .

 

 

2.Buscar "class CubeResultWindow(ui.ScriptWindow)" y antes de esa linea agregar :

SystemCube = 0  

3.Buscar currentSlot.SetItemSlot(0, itemVnum, itemCount) y abajo agregar:

						if player.GetItemCountByVnum(itemVnum) >= itemCount:
							currentSlot.SetUsableSlot(0)
							currentSlot.SetUnusableWorldSlot(0)
						else:
							currentSlot.SetUnusableSlot(0)
							currentSlot.SetUsableWorldSlot(0)

4.Buscamos "(x, y, z) = player.GetMainCharacterPosition()" y arriba agregamos:

		if SystemCube == 1:
			self.Refresh()

 

 

 

[binario/EterPythonLib]

 

 

 

 

 

[PythonSlotWindow.cpp]

 

 

1.Buscar void CSlotWindow::SelectSlot(DWORD dwSelectingIndex) y arriba agregar:

void CSlotWindow::SetUnusableSlot(DWORD dwIndex)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
        return;
     SET_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE);
}
void CSlotWindow::SetUsableSlot(DWORD dwIndex)

{

TSlot * pSlot;

if (!GetSlotPointer(dwIndex, &pSlot))

return;

REMOVE_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE);

}

void CSlotWindow::SetUnusableWorldSlot(DWORD dwIndex)

{

TSlot * pSlot;

if (!GetSlotPointer(dwIndex, &pSlot))

return;

SET_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE_WORLD);

}


void CSlotWindow::SetUsableWorldSlot(DWORD dwIndex)

{

TSlot * pSlot;

if (!GetSlotPointer(dwIndex, &pSlot))

return;

REMOVE_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE_WORLD);

}

2.Buscar if (rSlot.bActive) y arriba agregar:

         if (IS_SET(rSlot.dwState, SLOT_STATE_UNUSABLE))
         {
            //CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f, 0.3f);
            CPythonGraphic::Instance().SetDiffuseColor(1.0f, 0.0f, 0.0f, 0.3f);
            CPythonGraphic::Instance().RenderBar2d(m_rect.left + rSlot.ixPosition,
            m_rect.top + rSlot.iyPosition,
            m_rect.left + rSlot.ixPosition + rSlot.byxPlacedItemSize * ITEM_WIDTH,
            m_rect.top + rSlot.iyPosition + rSlot.byyPlacedItemSize * ITEM_HEIGHT);
          }
          if (IS_SET(rSlot.dwState, SLOT_STATE_UNUSABLE_WORLD))
          {
            //CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f, 0.3f);
            CPythonGraphic::Instance().SetDiffuseColor(0.0f, 1.0f, 0.0f, 0.3f);
            CPythonGraphic::Instance().RenderBar2d(m_rect.left + rSlot.ixPosition,
            m_rect.top + rSlot.iyPosition,
            m_rect.left + rSlot.ixPosition + rSlot.byxPlacedItemSize * ITEM_WIDTH,
            m_rect.top + rSlot.iyPosition + rSlot.byyPlacedItemSize * ITEM_HEIGHT);
          }

[PythonSlotWindow.H]

 

1.Buscar SLOT_STATE_ALWAYS_RENDER_COVER = (1 << 3), y abajo agregar:

        SLOT_STATE_UNUSABLE = (1 << 4),
        SLOT_STATE_UNUSABLE_WORLD = (1 << 5),

[PythonWindowManagerModule.cpp]

 

1.Buscamos PyObject * wndMgrShowSlotBaseImage(PyObject * poSelf, PyObject * poArgs) y arriba agregamos:

PyObject * wndMgrSetUnusableSlot(PyObject * poSelf, PyObject * poArgs)
{
 UI::CWindow * pWin;
 if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  return Py_BuildException();
int iSlotIndex;

if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))

return Py_BuildException();


if (!pWin->IsType(UI::CSlotWindow::Type()))

return Py_BuildException();


UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;

pSlotWin->SetUnusableSlot(iSlotIndex);

return Py_BuildNone();

}


PyObject * wndMgrSetUsableSlot(PyObject * poSelf, PyObject * poArgs)

{

UI::CWindow * pWin;

if (!PyTuple_GetWindow(poArgs, 0, &pWin))

return Py_BuildException();


int iSlotIndex;

if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))

return Py_BuildException();


if (!pWin->IsType(UI::CSlotWindow::Type()))

return Py_BuildException();


UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;

pSlotWin->SetUsableSlot(iSlotIndex);

return Py_BuildNone();

}

PyObject * wndMgrSetUnusableWorldSlot(PyObject * poSelf, PyObject * poArgs)

{

UI::CWindow * pWin;

if (!PyTuple_GetWindow(poArgs, 0, &pWin))

return Py_BuildException();


int iSlotIndex;

if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))

return Py_BuildException();


if (!pWin->IsType(UI::CSlotWindow::Type()))

return Py_BuildException();


UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;

pSlotWin->SetUnusableWorldSlot(iSlotIndex);

return Py_BuildNone();

}


PyObject * wndMgrSetUsableWorldSlot(PyObject * poSelf, PyObject * poArgs)

{

UI::CWindow * pWin;

if (!PyTuple_GetWindow(poArgs, 0, &pWin))

return Py_BuildException();


int iSlotIndex;

if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))

return Py_BuildException();


if (!pWin->IsType(UI::CSlotWindow::Type()))

return Py_BuildException();


UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;

pSlotWin->SetUsableWorldSlot(iSlotIndex);

return Py_BuildNone();

}

2.Buscamos { "DisableSlot" y abajo agregamos:

          { "SetUnusableSlot",               wndMgrSetUnusableSlot,                METH_VARARGS },
          { "SetUsableSlot",               wndMgrSetUsableSlot,                METH_VARARGS },
          { "SetUnusableWorldSlot",       wndMgrSetUnusableWorldSlot,                METH_VARARGS },
          { "SetUsableWorldSlot",           wndMgrSetUsableWorldSlot,                METH_VARARGS },

 

 

 

Imagen:

 

9e180c637e.jpg

 

Saludos!

Enlace para comentar
Compartir en otros sitios

Unirse a la conversación

Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.

Guest
Responder a este tema...

×   Has pegado contenido con formato .   Eliminar formato

  Only 75 emoji are allowed.

×   Tu enlace se ha incorporado automáticamente.   Mostrar un enlace en su lugar

×   Se ha restaurado el contenido anterior. .   Borrar editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...