Noticias:

SMF - Just Installed!

Menú principal

[Main 5.2] Source Render Party List v2

Publicado por Dakosmu, Mar 19, 2025, 11:47 PM

Tema anterior - Siguiente tema

Dakosmu

[Main 5.2] Source Render Party List v2
A small piece of code to share with everyone. I have a PartyList designed in the MuMobile style.

bool CNewUIPartyListWindow::Render()
{
if (!m_bActive)
return true;

EnableAlphaTest();
glColor4f(1.f, 1.f, 1.f, 1.f);

g_pRenderText->SetFont(g_hFont);
g_pRenderText->SetTextColor(255, 255, 255, 255);
g_pRenderText->SetBgColor(0, 0, 0, 0);

for (int i = 0; i < PartyNumber; i++)
{
int iVal = i * m_iVal;

switch (Party[i].cClass)
{
case 0:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW1, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, (64.f / 256.f) * 1, 1.0, 64.f / 256.f, 1, 1, 0); break;
case 1:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW1, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, (64.f / 256.f) * 2, 1.0, 64.f / 256.f, 1, 1, 0); break;
case 2:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW1, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, (64.f / 256.f) * 3, 1.0, 64.f / 256.f, 1, 1, 0); break;
case 3:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW2, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, 0.f, 1.0, 64.f / 256.f, 1, 1, 0); break;
case 4:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW2, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, (64.f / 256.f) * 1, 1.0, 64.f / 256.f, 1, 1, 0); break;
case 5:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW2, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, (64.f / 256.f) * 2, 1.0, 64.f / 256.f, 1, 1, 0); break;
case 6:RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW2, m_Pos.x - 32, (m_Pos.y - 2) + iVal, 103, 26, 0.f, (64.f / 256.f) * 3, 1.0, 64.f / 256.f, 1, 1, 0); break;
}

RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP_NEW1, m_Pos.x - 33, (m_Pos.y - 7) + iVal, 150, 37, 0.f, 0.f, 1.0, 64.f / 256.f, 1, 1, 0);
}
for (int i = 0; i < PartyNumber; i++)
{
int iVal = i * m_iVal;

char pClass[255];

if (i == 0)
{
if (Party[i].index == -1)
{
g_pRenderText->SetTextColor(RGBA(128, 75, 11, 255));
}
else
{
g_pRenderText->SetTextColor(RGBA(255, 148, 22, 255));
}
RenderImage(IMAGE_PARTY_LIST_FLAG, m_Pos.x + 77, m_Pos.y + 6, 9, 10);
g_pRenderText->RenderText(m_Pos.x + 5, m_Pos.y + 3 + iVal, Party[i].Name, m_iLimitUserIDHeight[0], 0, RT3_SORT_LEFT);
}
else
{
if (Party[i].index == -1)
{
g_pRenderText->SetTextColor(RGBA(128, 128, 128, 255));
}
else
{
g_pRenderText->SetTextColor(RGBA(255, 255, 255, 255));
}
g_pRenderText->RenderText(m_Pos.x + 5, m_Pos.y + 3 + iVal, Party[i].Name, m_iLimitUserIDHeight[1], 0, RT3_SORT_LEFT);
}

int iStepHP = min(10, Party[i].stepHP);
float fLife = ((float)iStepHP / (float)10) * (float)PARTY_LIST_HP_BAR_WIDTH;

int iHP = (Party[i].currHP * 66) / Party[i].maxHP;
RenderBitmap(SEASON3B::CNewUIPartyInfoWindow::IMAGE_UI_BARHP, m_Pos.x + 4, m_Pos.y + 5 + iVal, 70, 19, 0.f, 0.f, 1.0, 64.f / 256.f, 1, 1, 0);
RenderImage(SEASON3B::CNewUIPartyInfoWindow::IMAGE_PARTY_HPBAR, m_Pos.x + 6, (m_Pos.y + 13) + iVal, iHP, 3);
if (!strcmp(Party[0].Name, Hero->ID) || !strcmp(Party[i].Name, Hero->ID))
{
m_BtnPartyExit[i].Render();
}
}

DisableAlphaBlend();

return true;
}

enum IMAGES add: (And of course, you can use your own TGA image files as replacements.)

LoadBitmap("Interface\\SPK\\PartyBarNew_1.tga", IMAGE_UI_BARHP_NEW1, GL_LINEAR);
LoadBitmap("Interface\\SPK\\PartyBarNew_2.tga", IMAGE_UI_BARHP_NEW2, GL_LINEAR);

Don't forget to free resources after loading images into the game.
DELETEBITMAP(IMAGE);

IMAGE_UI_BARHP_NEW1 = BITMAP_CHECK_BTN_BANK_01 + 31,
IMAGE_UI_BARHP_NEW2,

struct PARTY_t
Add -> BYTE cClass;

Find: void ReceivePartyList(const BYTE* ReceiveBuffer)
Add-> p->cClass = Data2->cClass;

Go to GS Src, search Packet 0x42 then add Class in there!

Result:
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


Link:
Descargar Aqui


Creditos
SPK
Bon Dia

Amumu

hello, can you share the source file?  I always make mistakes in certain places.

Dakosmu

Cita de: Amumu en Mar 28, 2025, 11:17 PMhello, can you share the source file?  I always make mistakes in certain places.

hola amigo, este contenido es un copy y paste.
unicamente lo guarde para no olvidar
Bon Dia

🡱 🡳