[Main 5.2] Source Render Guild Logo Name Player v.1

Publicado por Dakosmu, Mar 25, 2025, 09:21 AM

Tema anterior - Siguiente tema

Dakosmu

[Main 5.2] Source Render Guild Logo Name Player v.1


¡Comparto con ustedes esta útil modificación para mostrar emblemas de gremio junto a los nombres de los jugadores en MU Online! Perfecta para servidores privados o modificaciones client-side.

------Características principales-------
Muestra el emblema del gremio al lado del nombre de cada jugador
Totalmente integrado con el sistema de renderizado existente
Soporte para transparencias y blending adecuado
Posición personalizable del emblema

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



BUSCAR: void RenderBoolean(int x, int y, CHAT* c) en Zzzinterface.cpp

y REEMPLAZAN por este:

void RenderBoolean(int x,int y,CHAT *c)
{

if ( g_isCharacterBuff((&c->Owner->Object), eBuff_CrywolfNPCHide ) )
{
return;
}

if ( c->Owner!=Hero && battleCastle::IsBattleCastleStart()==true && g_isCharacterBuff((&c->Owner->Object), eBuff_Cloaking) )
{
if ( ( Hero->EtcPart==PARTS_ATTACK_KING_TEAM_MARK || Hero->EtcPart==PARTS_ATTACK_TEAM_MARK ))
{
if(!( c->Owner->EtcPart==PARTS_ATTACK_KING_TEAM_MARK || c->Owner->EtcPart==PARTS_ATTACK_TEAM_MARK ))
{
return;
}
}
else if ( ( Hero->EtcPart==PARTS_ATTACK_KING_TEAM_MARK2 || Hero->EtcPart==PARTS_ATTACK_TEAM_MARK2 ))
{
if(!( c->Owner->EtcPart==PARTS_ATTACK_KING_TEAM_MARK2 || c->Owner->EtcPart==PARTS_ATTACK_TEAM_MARK2 ))
{
return;
}
}
else if ( ( Hero->EtcPart==PARTS_ATTACK_KING_TEAM_MARK3 || Hero->EtcPart==PARTS_ATTACK_TEAM_MARK3 ))
{
if(!( c->Owner->EtcPart==PARTS_ATTACK_KING_TEAM_MARK3 || c->Owner->EtcPart==PARTS_ATTACK_TEAM_MARK3 ))
{
return;
}
}
else if ( ( Hero->EtcPart==PARTS_DEFENSE_KING_TEAM_MARK || Hero->EtcPart==PARTS_DEFENSE_TEAM_MARK ))
{
if(!( c->Owner->EtcPart==PARTS_DEFENSE_KING_TEAM_MARK || c->Owner->EtcPart==PARTS_DEFENSE_TEAM_MARK ))
{
return;
}
}
}
if (c->Owner->GuildMarkIndex != -1 && c->Owner->Object.Type == MODEL_PLAYER)
{
// Guardar el estado actual del blending
GLboolean blendEnabled;
glGetBooleanv(GL_BLEND, &blendEnabled);

//Configura el blending y la textura para el emblema
EnableAlphaTest();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

//Crea y renderiza el emblema
CreateGuildMark(c->Owner->GuildMarkIndex, true);
RenderBitmap(
BITMAP_GUILD,
(float)x - 18.0f,
(float)y + 0.0f,
16.0f, 16.0f,
0.0f, 0.0f,
1.0f, 1.0f,
true, true,
1.0f
);

//Restaura el estado de OpenGL solo si no estaba activado originalmente
if (!blendEnabled) {
glDisable(GL_BLEND);
}
}
g_pRenderText->SetBgColor(0, 0, 0, 0);  // Fondo completamente transparente

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

if (FontHeight > 32) FontHeight = 32;

POINT RenderPos = { x, y };
SIZE RenderBoxSize = { c->Width, c->Height };
int iLineHeight = FontHeight/g_fScreenRate_y;

if(IsShopInViewport(c->Owner))
{
SIZE TextSize;
g_pRenderText->SetFont(g_hFontBold);
g_pRenderText->SetBgColor(GetShopBGColor(c->Owner));

g_pRenderText->SetTextColor(GetShopTextColor(c->Owner));
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, GlobalText[1104], 0, iLineHeight, RT3_SORT_LEFT, &TextSize);
RenderPos.x += TextSize.cx;

g_pRenderText->SetTextColor(GetShopText2Color(c->Owner));
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->szShopTitle, RenderBoxSize.cx-TextSize.cx, iLineHeight, RT3_SORT_LEFT, &TextSize);
g_pRenderText->SetFont(g_hFont);

RenderPos.x = x;
RenderPos.y += iLineHeight;
}
/*else if(::IsStrifeMap(gMapManager.WorldActive) && Hero->m_byGensInfluence != c->Owner->m_byGensInfluence && !::IsGMCharacter())
{
if(!c->Owner->m_nContributionPoint)
return;

if(KIND_PLAYER == c->Owner->Object.Kind && MODEL_PLAYER == c->Owner->Object.Type)
{
int _TempX = (int)(c->x + c->Width*0.5f+20.0f);
switch(c->Owner->m_byGensInfluence)
{
case 1:
g_pNewUIGensRanking->RanderMark(_TempX, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
return;
case 2:
g_pNewUIGensRanking->RanderMark(_TempX, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
return;
default:
break;
}
}
}*/

bool bGmMode = false;

if (g_isCharacterBuff((&c->Owner->Object), eBuff_GMEffect) || (c->Owner->CtlCode == CTLCODE_20OPERATOR) || (c->Owner->CtlCode == CTLCODE_08OPERATOR))
{
bGmMode = true;
g_pRenderText->SetBgColor(30, 30, 30, 200);
g_pRenderText->SetTextColor(200, 255, 255, 255);
}

if( c->Owner == Hero )
{
g_pRenderText->SetBgColor(60, 100, 0, 150);
g_pRenderText->SetTextColor(200, 255, 0, 255);
}
else if( c->Owner->GuildMarkIndex == Hero->GuildMarkIndex )
{
g_pRenderText->SetBgColor(GetGuildRelationShipBGColor(GR_UNION));
g_pRenderText->SetTextColor(GetGuildRelationShipTextColor(GR_UNION));
}
else
{
g_pRenderText->SetBgColor(GetGuildRelationShipBGColor(c->Owner->GuildRelationShip));
g_pRenderText->SetTextColor(GetGuildRelationShipTextColor(c->Owner->GuildRelationShip));
}

if( c->Union && c->Union[0] )
{
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Union, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
}
if( c->Guild && c->Guild[0] )
{
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Guild, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
}

if (bGmMode)
{
g_pRenderText->SetTextColor(100, 250, 250, 255);
}
else
{
SetPlayerColor(c->Color);
}

if ( c->x <= MouseX && MouseX < (int)(c->x+c->Width*640/WindowWidth) &&
c->y <= MouseY && MouseY < (int)(c->y+c->Height*480/WindowHeight) &&
InputEnable && Hero->SafeZone && strcmp(c->ID,Hero->ID)!=NULL &&
(DWORD)WorldTime%24 < 12)
{
unsigned int Temp = g_pRenderText->GetBgColor();
g_pRenderText->SetBgColor(g_pRenderText->GetTextColor());
g_pRenderText->SetTextColor(Temp);
}

if (bGmMode)
{
g_pRenderText->SetFont(g_hFontBold);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->ID, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
g_pRenderText->SetFont(g_hFont);
}
else
{
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->ID, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
}

if(c->GuildColor==0)
g_pRenderText->SetBgColor(10, 30, 50, 150);
else if(c->GuildColor==1)
g_pRenderText->SetBgColor(30, 50, 0, 150);
else if(bGmMode)
g_pRenderText->SetBgColor(30, 30, 30, 200);
else
g_pRenderText->SetBgColor(50, 0, 0, 150);

DWORD dwTextColor[2];
BYTE byAlpha[2] = { 255, 255 };
if((c->LifeTime[0] > 0 && c->LifeTime[0] < 10))
byAlpha[0] = 128;
if((c->LifeTime[1] > 0 && c->LifeTime[1] < 10))
byAlpha[1] = 128;

if (bGmMode)
{
dwTextColor[0] = RGBA(250, 200, 50, byAlpha[0]);
dwTextColor[1] = RGBA(250, 200, 50, byAlpha[1]);
}
else
{
dwTextColor[0] = RGBA(230, 220, 200, byAlpha[0]);
dwTextColor[1] = RGBA(230, 220, 200, byAlpha[1]);
}

if(c->LifeTime[1] > 0)
{
g_pRenderText->SetTextColor(dwTextColor[1]);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Text[1], RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;

g_pRenderText->SetTextColor(dwTextColor[0]);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Text[0], RenderBoxSize.cx, iLineHeight);
}
else if(c->LifeTime[0] > 0)
{
g_pRenderText->SetTextColor(dwTextColor[0]);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Text[0], RenderBoxSize.cx, iLineHeight);
}

/*if (KIND_PLAYER == c->Owner->Object.Kind && MODEL_PLAYER == c->Owner->Object.Type)
{
const int nGensMarkHeight = 18;
int nGensMarkPosY = (RenderPos.y - y - nGensMarkHeight) / 2 + y;

if(c->LifeTime[1] > 0)
RenderPos.y -= iLineHeight;

if (1 == c->Owner->m_byGensInfluence)
g_pNewUIGensRanking->RanderMark(x, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
else if (2 == c->Owner->m_byGensInfluence)
g_pNewUIGensRanking->RanderMark(x, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
}*/

}


Creditos
Dexign


Bon Dia

🡱 🡳