Ejemplo n.º 1
0
void ZVoteInterface::DrawVoteTargetlist(MDrawContext* pDC)
{
	if(GetShowTargetList() == false) return;

	MFont *pFont=ZGetGameInterface()->GetCombatInterface()->GetGameFont();
	pDC->SetFont(pFont);

	float y = 0.3f;
	float linespace = (float)pFont->GetHeight() * 1.1 / (float)MGetWorkspaceHeight();

	pDC->SetColor(MCOLOR(0xFFFFFFFF));

	TextRelative( pDC, .05f, y, ZMsg(MSG_VOTE_SELECT_PLAYER_TO_KICK) );

	y+=2.f*linespace;

	for (int i=0; i<(int)m_TargetList.size(); i++) 
	{
		string& strName = m_TargetList[i];

		char szBuffer[256];
		sprintf(szBuffer,"[%c] %s", ConvIndexToKey(i), strName.c_str());

		pDC->SetColor(MCOLOR(0xFFFFFFFF));
		TextRelative(pDC,.05f,y,szBuffer);

		y+=linespace;
	}

	y+=linespace;
	pDC->SetColor(MCOLOR(0xFFFFFFFF));
	
	TextRelative(pDC,.05f,y, ZMsg(MSG_VOTE_SELECT_PLAYER_CANCEL));
}
Ejemplo n.º 2
0
void ZVoteInterface::DrawVoteMessage(MDrawContext* pDC)		// 투표가 진행중일때 메시지
{
	// 투표 진행중일때 메시지
	if ( (ZGetGameInterface()->GetState() == GUNZ_GAME) &&
		ZGetGameClient() &&
		ZGetGameClient()->IsVoteInProgress() && 
		ZGetGameClient()->CanVote() ) 
	{
		MFont *pFont=ZGetGameInterface()->GetCombatInterface()->GetGameFont();
		pDC->SetFont(pFont);
		pDC->SetColor(MCOLOR(0x80ffffff));
		TextRelative(pDC,300.f/800.f,550/600.f,ZGetGameClient()->GetVoteMessage());

		if(timeGetTime()/500 % 2 == 0 ) {

			TextRelative(pDC,300.f/800.f,565/600.f, ZMsg(MSG_VOTE_YESNO));
		}
	}
}
void ZCombatQuestScreen::OnDraw(CCDrawContext* pDC)
{
	/////////////////////////////////////////////
	list<ZCharacter*>		SortedCharacterList;

	for(ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
		itor != ZGetGame()->m_CharacterManager.end(); ++itor)
	{
		ZCharacter* pCharacter = (*itor).second;
		if (!pCharacter->IsVisible()) continue;

		SortedCharacterList.push_back(pCharacter);
	}

	SortedCharacterList.sort(CompareQuestScreenCharacter);
/*
	int cnt = 0;
	for (list<ZCharacter*>::iterator itor = SortedCharacterList.begin(); itor != SortedCharacterList.end(); ++itor)
	{
		DrawPlayer(pDC, cnt, (*itor));
		cnt++;
	}
*/


	if ( ZGetQuest()->IsRoundClear())
	{
		// 운영자 hide는 제외
		bool bEventHide = false;
		if (ZGetMyInfo()->IsAdminGrade()) 
		{
			CCMatchObjCache* pCache = ZGetGameClient()->FindObjCache(ZGetMyUID());
			if (pCache && pCache->CheckFlag(CCTD_PlayerFlags_AdminHide)) bEventHide = true;
		}

		DWORD dwSec;
		DWORD dwCurrTime = timeGetTime();
		if ( ZGetQuest()->GetRemainedTime() < dwCurrTime)
			dwSec = 0;
		else
			dwSec = (ZGetQuest()->GetRemainedTime() - dwCurrTime) / 1000;

		char szSec[ 10];
		sprintf( szSec, "%d", dwSec);
		char szMsg[ 128];
		ZTransMsg( szMsg, MSG_GAME_NEXT_N_MIN_AFTER, 1, szSec);

		pDC->SetFont( CCFontManager::Get("FONTa10_O2Wht"));
		pDC->SetColor(sColor(0xFFFFFFFF));

		if (!bEventHide)
			TextRelative(pDC,400.f/800.f,500.f/600.f, szMsg, true);
	}
}
Ejemplo n.º 4
0
void ZObserver::OnDraw(MDrawContext* pDC)
{
	if ( g_pGame->IsReplay() && !g_pGame->IsShowReplayInfo())
		return;

	if ( m_pTargetCharacter == NULL)
		return;

	if ( ZGetCamera()->GetLookMode() == ZCAMERA_MINIMAP)
		return;

	if ( ZGetMyInfo()->IsAdminGrade())
	{
		MFont *pFont=MFontManager::Get("FONTb11b");
		if ( pFont == NULL)
			_ASSERT(0);
		pDC->SetFont(pFont);

		MCOLOR backgroundcolor;
		if ( m_pTargetCharacter->GetTeamID() == MMT_RED)
			backgroundcolor = MCOLOR(100,0,0, 150);
		else if ( m_pTargetCharacter->GetTeamID() == MMT_BLUE)
			backgroundcolor = MCOLOR(0,0,100, 150);
		else 
			backgroundcolor = MCOLOR(0,0,0, 150);

		pDC->SetColor(backgroundcolor);
		pDC->FillRectangle( MGetWorkspaceWidth() / 2 - 170, MGetWorkspaceHeight() * (650.0f/800.0f) - 7, 340, 30);

		backgroundcolor = MCOLOR( 255,255,255, 255);
		pDC->SetColor( backgroundcolor);

		char szName[128];
		sprintf_safe( szName, "%s (HP:%d, AP:%d)", m_pTargetCharacter->GetUserName(), m_pTargetCharacter->GetHP(), m_pTargetCharacter->GetAP());
		TextRelative(pDC, 0.5f, 650.0f/800.0f, szName, true);
	}

	else if ( ZApplication::GetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DUEL)
	{
		char	charName[3][100];
		charName[0][0] = charName[1][0] = charName[2][0] = 0;
		float	fMaxHP[ 2]={ 0.0f, 0.0f},	fMaxAP[ 2]={ 0.0f, 0.0f};
		int		nHP[ 2]={ 0, 0},			nAP[ 2]={ 0, 0};
		bool	bExistNextChallenger = false;
		bool	bIsChampOserved = false;
		bool	bIsChlngOserved = false;

		ZRuleDuel* pDuel = (ZRuleDuel*)ZGetGameInterface()->GetGame()->GetMatch()->GetRule();

		for (ZCharacterManager::iterator itor = ZGetCharacterManager()->begin(); itor != ZGetCharacterManager()->end(); ++itor)
		{
			ZCharacter* pCharacter = (*itor).second;

			// Champion
			if (pCharacter->GetUID() == pDuel->QInfo.m_uidChampion)
			{
				strcpy_safe(charName[0], pCharacter->GetUserName());
				fMaxHP[ 0] = pCharacter->GetProperty()->fMaxHP;
				fMaxAP[ 0] = pCharacter->GetProperty()->fMaxAP;
				if ( pCharacter->IsDie())
				{
					nHP[ 0] = 0;
					nAP[ 0] = 0;
				}
				else
				{
					nHP[ 0] = pCharacter->GetHP();
					nAP[ 0] = pCharacter->GetAP();
				}

				if ( m_pTargetCharacter)
				{
					if ( pCharacter->GetUID() == m_pTargetCharacter->GetUID())
						bIsChampOserved = true;
				}
			}

			// Challenger
			else if (pCharacter->GetUID() == pDuel->QInfo.m_uidChallenger)
			{
				strcpy_safe(charName[1], pCharacter->GetUserName());
				fMaxHP[ 1] = pCharacter->GetProperty()->fMaxHP;
				fMaxAP[ 1] = pCharacter->GetProperty()->fMaxAP;
				if ( pCharacter->IsDie())
				{
					nHP[ 1] = 0;
					nAP[ 1] = 0;
				}
				else
				{
					nHP[ 1] = pCharacter->GetHP();
					nAP[ 1] = pCharacter->GetAP();
				}

				if ( m_pTargetCharacter)
				{
					if ( pCharacter->GetUID() == m_pTargetCharacter->GetUID())
						bIsChlngOserved = true;
				}
			}

			// Waiting
			else if (pCharacter->GetUID() == pDuel->QInfo.m_WaitQueue[0])
			{
				strcpy_safe(charName[2], pCharacter->GetUserName());
				bExistNextChallenger = true;
			}
		}

		float fRx = (float)MGetWorkspaceWidth()  / 800.0f;
		float fRy = (float)MGetWorkspaceHeight() / 600.0f;

		int nWidth;
		float fPosy;
		float fLength;
		float fHeight;

		// HP
		fPosy = 10.0f*fRy;
		fLength = 163.0f*fRx;
		fHeight = 23.0f*fRy;

		pDC->SetColor( 255, 0, 0, 210);
		nWidth = (int)( (float)nHP[0] / fMaxHP[0] * fLength);
		pDC->FillRectangle( (193.0f+163.0f)*fRx-nWidth, fPosy, nWidth, fHeight);

		nWidth = (int)( (float)nHP[1] / fMaxHP[1] * fLength);
		pDC->FillRectangle( 444.0f*fRx, fPosy, nWidth, fHeight);


		// AP
		pDC->SetColor( 0, 50, 0, 170);
		pDC->FillRectangle( 218.0f*fRx, 37.0f*fRy, 150.0f*fRx, 5.0f*fRy);
		pDC->FillRectangle( 432.0f*fRx, 37.0f*fRy, 150.0f*fRx, 5.0f*fRy);

		pDC->SetColor( 0, 255, 0, 100);
		nWidth = (int)( (float)nAP[0] / fMaxAP[0] * 150.0f * fRx);
		pDC->FillRectangle( (218.0f+150.0f)*fRx-nWidth, 37.0f*fRy, nWidth, 5.0f*fRy);

		nWidth = (int)( (float)nAP[1] / fMaxAP[1] * 150.0f * fRx);
		pDC->FillRectangle( 432.0f*fRx, 37.0f*fRy, nWidth, 5.0f*fRy);


		// °ÔÀÌÁö ÇÁ·¹ÀÓ Ãâ·Â
		MBitmap* pBitmap = MBitmapManager::Get( "duel_score.tga");
		if ( pBitmap)
		{
			pDC->SetBitmap( pBitmap);
			pDC->Draw( 167.0f*fRx, 0, 466.0f*fRx, 49.0f*fRx);
		}


		// À̸§ Ãâ·Â
		MFont *pFont = MFontManager::Get("FONTa10_O2Wht");
		if ( pFont == NULL)
			_ASSERT(0);
		pDC->SetFont( pFont);
		int nTime = GetGlobalTimeMS() % 200;
		if ( bIsChampOserved && (nTime < 100))
			pDC->SetColor(MCOLOR(0xFFFFFF00));
		else
			pDC->SetColor(MCOLOR(0xFFA0A0A0));
		TextRelative(pDC, 0.34f, 0.026f, charName[0], true);

		if ( bIsChlngOserved && (nTime < 100))
			pDC->SetColor(MCOLOR(0xFFFFFF00));
		else
			pDC->SetColor(MCOLOR(0xFFA0A0A0));
		TextRelative(pDC, 0.66f, 0.026f, charName[1], true);

		if ( bExistNextChallenger)
		{
			MBitmap* pBitmap = MBitmapManager::Get( "icon_play.tga");
			if ( pBitmap)
			{
				pDC->SetBitmap( pBitmap);

				int nIcon = 20.0f*fRx;
				pDC->Draw( 646.0f*fRx, 0, nIcon, nIcon);
				pDC->Draw( 640.0f*fRx, 0, nIcon, nIcon);
			}

			pDC->SetColor( MCOLOR(0xFF808080));
			TextRelative( pDC, 0.83f, 0.01f, charName[ 2], false);
		}

		ZGetCombatInterface()->DrawVictory( pDC, 162, 20, pDuel->QInfo.m_nVictory);
	}
	

	else if ( ZApplication::GetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL)
	{
		char szName[128];
		sprintf_safe(szName, "%s (HP:%d, AP:%d)", m_pTargetCharacter->GetUserName(), m_pTargetCharacter->GetHP(), m_pTargetCharacter->GetAP());
		if ( m_pTargetCharacter->IsAdmin())
			pDC->SetColor(MCOLOR(ZCOLOR_ADMIN_NAME));
		else
			pDC->SetColor(MCOLOR(0xFFFFFFFF));

		MFont *pFont = MFontManager::Get( "FONTb11b");
		if ( pFont == NULL)
			_ASSERT(0);
		pDC->SetFont( pFont);

		if ( ZApplication::GetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DEATHMATCH_TEAM2)
			TextRelative( pDC, 0.5f, 75.0f/800.0f, szName, true);
		else
			TextRelative( pDC, 0.5f, 50.0f/800.0f, szName, true);
	}

	// Ä«¸Þ¶ó Ç¥½Ã
	if ( !ZGetMyInfo()->IsAdminGrade()) {
		ZCamera *pCamera = ZGetGameInterface()->GetCamera();

		const char *szModes[] = { "normal", "user", "free", "minimap" };
//		TextRelative(pDC, 0.9f, 50.0f/800.0f, szModes[pCamera->GetLookMode()], true);

		char szFileName[ 50];
		sprintf_safe( szFileName, "camera_%s.tga", szModes[pCamera->GetLookMode()]);
		pDC->SetBitmap( MBitmapManager::Get( szFileName));

		float fGain = (float)MGetWorkspaceWidth() / 800.0f;
		pDC->Draw( (int)(720.0f * fGain), (int)(7.0f * fGain), (int)(64.0f * fGain), (int)(64.0f * fGain));
	}



	// Admin ¿ÉÁ®¹öÀÏ °æ¿ì¿¡ ³²Àº Àοø¼ö Ç¥½Ã
	if ( ZGetMyInfo()->IsAdminGrade())
	{
		// Àοø¼ö ±¸Çϱâ
		int nNumOfTotal=0, nNumOfRedTeam=0, nNumOfBlueTeam=0;
		ZCharacterManager::iterator itor;
		ZCharacter* pCharacter;
		for (itor = ZGetCharacterManager()->begin(); itor != ZGetCharacterManager()->end(); ++itor)
		{
			pCharacter = (*itor).second;
	
			if ( pCharacter->GetTeamID() == MMT_SPECTATOR)		// ¿ÉÀú¹ö´Â –A´Ù
				continue;

			if(pCharacter->IsAdminHide()) continue;
		
			if ( (pCharacter->GetTeamID()==4) && ( !pCharacter->IsDie()))
				nNumOfTotal++;
			else if ( (pCharacter->GetTeamID()==MMT_RED) && ( !pCharacter->IsDie()))
				nNumOfRedTeam++;
			else if ( (pCharacter->GetTeamID()==MMT_BLUE) && ( !pCharacter->IsDie()))
				nNumOfBlueTeam++;
		}

		// ÆÀ À̹ÌÁö Ç¥½Ã
		float sizex = MGetWorkspaceWidth() / 800.f;
		float sizey = MGetWorkspaceHeight() / 600.f;
		char szText[128];

		// ¹è°æ Ç¥½Ã
		MCOLOR backgroundcolor;

		if (ZApplication::GetGame()->GetMatch()->IsTeamPlay())
		{
			backgroundcolor = MCOLOR(100,0,0, 150);
			pDC->SetColor(backgroundcolor);
			pDC->FillRectangle( 700 * sizex, 37 * sizey, 85 * sizex, 22 * sizey);
			backgroundcolor = MCOLOR(0,0,100, 150);
			pDC->SetColor(backgroundcolor);
			pDC->FillRectangle( 700 * sizex, 62 * sizey, 85 * sizex, 22 * sizey);

			// Àοø¼ö Ç¥½Ã
			backgroundcolor = MCOLOR(255,180,180, 255);
			pDC->SetColor(backgroundcolor);
			sprintf_safe( szText, "%s:%d", ZMsg( MSG_WORD_REDTEAM), nNumOfRedTeam); 
			TextRelative( pDC, 0.92f, 40.0f/600.0f, szText, true);
			backgroundcolor = MCOLOR(180,180,255, 255);
			pDC->SetColor(backgroundcolor);
			sprintf_safe( szText, "%s:%d", ZMsg( MSG_WORD_BLUETEAM), nNumOfBlueTeam); 
			TextRelative( pDC, 0.92f, 65.0f/600.0f, szText, true);
		}
	}

	CheckDeadTarget();
}