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;
glColor4f ( 0.f, 0.f, 0.f, 0.9f );
RenderColor( float(m_Pos.x+2), float(m_Pos.y+2+iVal), PARTY_LIST_WINDOW_WIDTH-3, PARTY_LIST_WINDOW_HEIGHT-6 );
EnableAlphaTest();
if( Party[i].index == -1 )
{
glColor4f ( 0.3f, 0.f, 0.f, 0.5f );
RenderColor( m_Pos.x+2, m_Pos.y+2+iVal, PARTY_LIST_WINDOW_WIDTH-3, PARTY_LIST_WINDOW_HEIGHT-6 );
EnableAlphaTest();
}
else
{
if( Party[i].index >= 0 && Party[i].index < MAX_CHARACTERS_CLIENT )
{
CHARACTER* pChar = &CharactersClient[Party[i].index];
OBJECT* pObj = &pChar->Object;
if(g_isCharacterBuff(pObj, eBuff_Defense) == true)
{
glColor4f ( 0.2f, 1.f, 0.2f, 0.2f );
RenderColor( m_Pos.x+2, m_Pos.y+2+iVal, PARTY_LIST_WINDOW_WIDTH-3, PARTY_LIST_WINDOW_HEIGHT-6 );
EnableAlphaTest();
}
}
}
EndRenderColor();
// Image Link DRAWBARIMAGE
RenderImage(DRAWBARIMAGE, m_Pos.x, m_Pos.y + iVal, PARTY_LIST_WINDOW_WIDTH + 1.0f, PARTY_LIST_WINDOW_HEIGHT);
char szIndex[8];
sprintf(szIndex, "%d", i + 1);
g_pRenderText->SetTextColor(255, 255, 0, 255);
g_pRenderText->RenderText(m_Pos.x + 6, m_Pos.y - 2 + iVal + 5, szIndex, 20, RT3_SORT_LEFT);
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 ) );
}
// Image Link DRAWBARFLAG
RenderImage(DRAWBARFLAG, m_Pos.x + 65, m_Pos.y + 3, 7, 7);
g_pRenderText->RenderText(m_Pos.x + 15, m_Pos.y + 2+ 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+15, m_Pos.y+ 2+iVal, Party[i].Name, m_iLimitUserIDHeight[1], 0, RT3_SORT_LEFT );
}
int iStepHP = min( 10, Party[i].stepHP );
float fLife = (((float)iStepHP / 10) * (float)PARTY_LIST_HP_BAR_WIDTH) * 1.1f;
// Image Link IMAGE_HP
RenderImage(IMAGE_HP, m_Pos.x + 2, m_Pos.y + 13 + iVal, fLife, 2.5f);
int iStepSD = min(10, Party[i].stepSD);
float fShield = (((float)iStepSD / 10) * (float)PARTY_LIST_HP_BAR_WIDTH) * 1.1f;
// Image Link IMAGE_SD
RenderImage(IMAGE_SD, m_Pos.x + 2, m_Pos.y + 18 + iVal, fShield, 2.5f);
if( !strcmp( Party[0].Name, Hero->ID ) || !strcmp( Party[i].Name, Hero->ID ) )
{
m_BtnPartyExit[i].Render();
}
}
DisableAlphaBlend();
return true;
}