Ejemplo n.º 1
0
void CWndPartyQuick::OnDraw( C2DRender* p2DRender ) 
{ 
	// 파티 정보 출력
	//Static control
	int nMax = g_Party.m_nSizeofMember;
	int i;
	CRect rect;

	SetActiveMember(nMax);

	for(i=0; i<nMax; i++)
	{
		LPWNDCTRL lpWndCtrl = GetWndCtrl( StaticID[i] );
		rect = lpWndCtrl->rect;
		CMover* pObjMember = prj.GetUserByID( g_Party.m_aMember[i].m_uPlayerId );
		CString strMember;
		
		if(m_pFocusMember == pObjMember)
			p2DRender->RenderFillRect( rect, 0x60ffff00 );

		// 상태에 따라 색 변경
		DWORD dwColor = 0xff000000;
		u_long  nLeadMember = g_Party.m_aMember[i].m_uPlayerId;
		if( IsValidObj(pObjMember) )
		{
			if( pObjMember->GetHitPoint() == 0 ) 
				dwColor = 0xffff0000; // 죽은놈
			else if( ((FLOAT)pObjMember->GetHitPoint()) / ((FLOAT)pObjMember->GetMaxHitPoint()) <.1f ) 
				dwColor = 0xffffff00; // HP 10% 이하인놈
			if(g_Party.IsLeader(nLeadMember)) //Leader Color Set
			{
				dwColor = 0xff1fb72d; //굵게 해야함...
#if __VER >= 10 // __LEGEND
				if(pObjMember->IsMaster())
					strMember.Format( prj.GetText( TID_GAME_QUICK_MARK_MASTER ), pObjMember->GetLevel(), pObjMember->GetName() );
				else if(pObjMember->IsHero())
#if __VER >= 15 // __HERO129_VER15				// 15차 히어로 레벨확장
					strMember.Format( prj.GetText( TID_GAME_QUICK_MARK_HERO ), pObjMember->GetLevel(), pObjMember->GetName() );
	#else	// 15차 히어로 레벨확장
					strMember.Format( prj.GetText( TID_GAME_QUICK_MARK_HERO_BEFORE ), pObjMember->GetName() );
	#endif	// 15차 히어로 레벨확장
				else 
					strMember.Format( "%d. %s", pObjMember->GetLevel(), pObjMember->GetName() );
#else //__LEGEND
				strMember.Format( "%d. %s", pObjMember->GetLevel(), pObjMember->GetName() );
#endif //__LEGEND
			}
			else
			{
#if __VER >= 10 // __LEGEND
				if(pObjMember->IsMaster())
Ejemplo n.º 2
0
void CWndPartyCtrl::OnDraw( C2DRender* p2DRender ) 
{
	if( NULL == g_pPlayer )
		return;

	CPoint pt( 3, 3 );

//	pt.y -= ( m_nFontHeight + 3 ) * m_wndScrollBar.GetScrollPos();

#if __VER < 11 // __CSC_VER11_4
	CWndMessenger* pWndMessenger = (CWndMessenger*)GetWndBase( APP_MESSENGER_ );
#endif //__CSC_VER11_4
	CWndWorld* pWndWorld = (CWndWorld*)g_WndMng.GetWndBase( APP_WORLD );
	
	int nMax = g_Party.m_nSizeofMember;
	// 눈에 보이는 갯수가 페이지라인수 보다 크면 보이는 갯수를 페이지라인수로 조정 
	if( nMax - m_wndScrollBar.GetScrollPos() > m_wndScrollBar.GetScrollPage() )
		nMax = m_wndScrollBar.GetScrollPage() + m_wndScrollBar.GetScrollPos();
	if( nMax < m_wndScrollBar.GetScrollPos() )
		nMax = 0;
	
	TEXTUREVERTEX2* pVertex = new TEXTUREVERTEX2[ 6 * 2 * nMax ];
	TEXTUREVERTEX2* pVertices = pVertex;
	
	for( int i = m_wndScrollBar.GetScrollPos(); i < nMax; i++ ) 
	{
		CMover* pObjMember = prj.GetUserByID( g_Party.m_aMember[i].m_uPlayerId );
		CString strMember;
#if __VER >= 11 // __SYS_PLAYER_DATA
		PlayerData* pPlayerData	= CPlayerDataCenter::GetInstance()->GetPlayerData( g_Party.m_aMember[i].m_uPlayerId );
		int nJob	= pPlayerData->data.nJob;
		int nSex	= pPlayerData->data.nSex;
#else	// __SYS_PLAYER_DATA
		int nJob	= g_Party.m_aMember[ i ].m_nJob;
		int nSex	= g_Party.m_aMember[ i ].m_nSex;
#endif	// __SYS_PLAYER_DATA
		
		// 상태에 따라 색 변경
		DWORD dwColor = 0xff000000;
		if( IsValidObj(pObjMember) )
		{
			if( pObjMember->GetHitPoint() == 0 ) 
				dwColor = 0xffff0000; // 죽은놈
			else 
				if( ((FLOAT)pObjMember->GetHitPoint()) / ((FLOAT)pObjMember->GetMaxHitPoint()) < 0.1f ) 
					dwColor = 0xffffff00; // HP 10% 이하인 놈
			strMember.Format( "%d %s", pObjMember->GetLevel(), pObjMember->GetName() );
		}
		else
		{
			dwColor = 0xff878787; // 디폴트는 주위에 없는 놈
			if( g_Party.m_aMember[ i ].m_bRemove ) 
				dwColor = 0xff000000; // 서버에 없는 놈
#if __VER >= 11 // __SYS_PLAYER_DATA
			strMember.Format( "?? %s", pPlayerData->szPlayer );
#else	// __SYS_PLAYER_DATA
			strMember.Format( "?? %s", g_Party.m_aMember[ i ].m_szName );
#endif	// __SYS_PLAYER_DATA
		}
		if( i == m_nCurSelect )
			dwColor = 0xff6060ff; 

		int x = 0, nWidth = m_rectClient.Width() - 10;// - 1;

		CRect rect( x, pt.y, x + nWidth, pt.y + m_nFontHeight );

		rect.SetRect( x + 20, pt.y + 18, x + nWidth - 10, pt.y + 30 ); 
		nWidth	= pObjMember ? pObjMember->GetHitPointPercent( rect.Width() ) : 0;
		CRect rectTemp = rect; 
		rectTemp.right = rectTemp.left + nWidth;
		if( rect.right < rectTemp.right )
			rectTemp.right = rect.right;

		m_pTheme->RenderGauge( p2DRender, &rect, 0xffffffff, m_pVBGauge, &m_texGauEmptyNormal );
		m_pTheme->RenderGauge( p2DRender, &rectTemp, 0x64ff0000, m_pVBGauge, &m_texGauFillNormal );

		rect.SetRect( x + 3, pt.y, x + 3 + 32, pt.y + 6 + 32 ); 

		p2DRender->TextOut( x + 20, pt.y + 3, strMember, dwColor ); 

		if( MAX_EXPERT <= nJob )
		{
#if __VER >= 10 // __LEGEND
			if( MAX_PROFESSIONAL <= nJob && nJob < MAX_MASTER )
				pWndWorld->m_texMsgIcon.MakeVertex( p2DRender, CPoint( 2, pt.y ),  ( 70 + nJob - 16 ) + ( 8 * nSex ), &pVertices, 0xffffffff );
			else if( MAX_MASTER <= nJob )
				pWndWorld->m_texMsgIcon.MakeVertex( p2DRender, CPoint( 2, pt.y ),  ( 70 + nJob - 24 ) + ( 8 * nSex ), &pVertices, 0xffffffff );
			else
#endif //__LEGEND
			pWndWorld->m_texMsgIcon.MakeVertex( p2DRender, CPoint( 2, pt.y ),  ( 70 + nJob - 6 ) + ( 8 * nSex ), &pVertices, 0xffffffff );
		}
		else
		{
			pWndWorld->m_texMsgIcon.MakeVertex( p2DRender, CPoint( 2, pt.y ),  12 + nJob + ( 6 * nSex ), &pVertices, 0xffffffff );
		}

		pt.y += m_nFontHeight + 3;
	}
	pWndWorld->m_texMsgIcon.Render( m_pApp->m_pd3dDevice, pVertex, ( (int) pVertices - (int) pVertex ) / sizeof( TEXTUREVERTEX2 ) );
	safe_delete_array( pVertex );
}