Exemplo n.º 1
0
void ZMeshViewList::RecalcBounds(void)
{
    MRECT r = GetClientRect();

    //m_pLeft->SetBounds(r.x, r.y, LEFTRIGHT_WIDTH, r.h);
    //m_pRight->SetBounds(r.x+r.w-LEFTRIGHT_WIDTH, r.y, LEFTRIGHT_WIDTH, r.h);
    m_pBmLeft->SetBounds(r.x, r.y, LEFTRIGHT_WIDTH, r.h);
    m_pBmRight->SetBounds(r.x+r.w-LEFTRIGHT_WIDTH, r.y, LEFTRIGHT_WIDTH, r.h);

    int nVisibleCount = GetVisibleCount();
    int nItemWidth = GetItemWidth();
    int nItemCount = GetItemCount();
    if(m_nItemStartIndex+nVisibleCount>nItemCount) {
        m_nItemStartIndex = nItemCount - nVisibleCount;
        if(m_nItemStartIndex<0) m_nItemStartIndex = 0;
    }

    int nCount = GetItemCount();

    if(m_nItemStartIndex>0) m_pBmLeft->Enable(true);
    else m_pBmLeft->Enable(false);
    //if(m_nItemStartIndex+nVisibleCount<nCount) m_pRight->Enable(true);
    //else m_pRight->Enable(false);
    if(m_nItemStartIndex+nVisibleCount<nCount) m_pBmRight->Enable(true);
    else m_pBmRight->Enable(false);

    for(int i=0; i<nCount; i++) {
        MWidget* pChild = GetItem(i);
        pChild->SetBounds(r.x+LEFTRIGHT_WIDTH+(i-m_nItemStartIndex)*nItemWidth, r.y, nItemWidth, r.h);
        if(i-m_nItemStartIndex<0 || i-m_nItemStartIndex>=nVisibleCount) pChild->Show(false);
        else pChild->Show(true);
    }
}
Exemplo n.º 2
0
void ShowProposalWaitFrame(bool bVisible, const char* szTitle, const char* szMessage)
{
	ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
	MWidget* pWidget = pResource->FindWidget("ProposalAgreementWait");
	if(pWidget!=NULL)
	{
		if (bVisible)
		{
			pWidget->SetText(szTitle);

			MTextArea* pTextArea = (MTextArea*)pResource->FindWidget("ProposalAgreementWait_Textarea");
			if (pTextArea) 
			{
				pTextArea->SetText(szMessage);
			}



			static ZCOUNTDOWN countDown = {PROPOSAL_AGREEMENT_TIMEOUT_SEC,
				                           "ProposalAgreementWait_Remain",
                                           "ProposalAgreementWait",
										   ShowProposalWaitFrame_OnExpire};

			countDown.nSeconds=PROPOSAL_AGREEMENT_TIMEOUT_SEC;	// static 이므로 재설정
			ZApplication::GetTimer()->SetTimerEvent(0, &OnTimer_CountDown, &countDown, true);

			pWidget->Show(true, true);
		}
		else
		{
            pWidget->Show(false);
		}
	}
}
// 버튼에 마우스오버할때 나타나는 초록빛이 사라지지 않아서 이렇게 해둔것 같다. 이코드가 여기저기 많아서 함수로 만들어버렸음
void WidgetHideDisableShow(const char* szWidget)
{
	MWidget* pWidget = GetIDLResource()->FindWidget( szWidget);
	if ( pWidget)
	{
		pWidget->Show( false);
		pWidget->Enable( false);
		pWidget->Show( true);
	}
}
Exemplo n.º 4
0
void ZGameClient::OnClanAskJoinAgreement(const char* szClanName, MUID& uidClanAdmin, const char* szClanAdmin)
{
	// 받을수 없는 상황이면 무시
	if(!ZGetGameInterface()->IsReadyToPropose()) return;

	m_uidRequestPlayer = uidClanAdmin;

	ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
	MTextArea* pTextEdit = (MTextArea*)pResource->FindWidget("ClanJoinerAgreementConfirm_Textarea");
	if (pTextEdit)
	{
		char szTemp[256];
//		ZTransMsg(szTemp, MSG_CLAN_JOINER_AGREEMENT_LABEL, 1, szClanName);
		ZTransMsg(szTemp, MSG_CLAN_JOINER_AGREEMENT_LABEL, 1, szClanName);
		pTextEdit->SetText(szTemp);
	}

	MWidget* pWidget = pResource->FindWidget("ClanJoinerAgreementConfirm");
	if(pWidget!=NULL)
	{
		static ZCOUNTDOWN countDown = {30,"ClanJoinerAgreementConfirm_Remain",
			"ClanJoinerAgreementConfirm",OnClanAskJoinAgreement_OnExpire};
		countDown.nSeconds=30;	// static 이므로 재설정
		ZApplication::GetTimer()->SetTimerEvent(0, &OnTimer_CountDown, &countDown, true);

		pWidget->Show(true, true);
	}

}
void WidgetEnableShow(const char* szWidget, bool bEnable, bool bShow)
{
	MWidget* pWidget = GetIDLResource()->FindWidget( szWidget);
	if (pWidget)
	{
		pWidget->Enable(bEnable);
		pWidget->Show(bShow);
	}
}
Exemplo n.º 6
0
void ShowClanSponsorAgreeWaitFrame(bool bVisible)
{
	ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
	MWidget* pWidget = pResource->FindWidget("ClanSponsorAgreementWait");
	if(pWidget!=NULL)
	{
		if (bVisible)
		{
			static ZCOUNTDOWN countDown = {30,"ClanSponsorAgreementWait_Remain",
				"ClanSponsorAgreementWait",ShowClanSponsorAgreeWaitFrame_OnExpire};
			countDown.nSeconds=30;	// static 이므로 재설정
			ZApplication::GetTimer()->SetTimerEvent(0, &OnTimer_CountDown, &countDown, true);

			pWidget->Show(true, true);
		}
		else
		{
            pWidget->Show(false);
		}
	}
}
Exemplo n.º 7
0
void SetCountdown(const ZCOUNTDOWN& Countdown)
{
	auto Callback = [Countdown = Countdown]() mutable
	{
		ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
		MWidget* pTargetWidget = pResource->FindWidget(Countdown.szTargetWidget);
		if (!pTargetWidget || !pTargetWidget->IsVisible()) return true;

		if (Countdown.nSeconds > 0) {

			if (Countdown.szLabelWidget != NULL)
			{
				ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
				MWidget* pWidget = pResource->FindWidget(Countdown.szLabelWidget);
				if (pWidget)
				{
					char buffer[256];
					sprintf_safe(buffer, "%d", Countdown.nSeconds);
					pWidget->SetText(buffer);
				}
			}

			Countdown.nSeconds--;
			return false;
		}

		pTargetWidget->Show(false);

		if (Countdown.pCallBack)
			Countdown.pCallBack();

		return true;
	};

	ZApplication::GetTimer()->SetTimerEvent(1000, Callback);
}
Exemplo n.º 8
0
void ZGameClient::OnClanResponseClanInfo(void* pBlob)
{
	int nCount = MGetBlobArrayCount(pBlob);
	if(nCount != 1) return;

	MTD_ClanInfo* pClanInfo = (MTD_ClanInfo*)MGetBlobArrayElement(pBlob, 0);
	
	// 이미 emblem을 가지고 있었으면 emblem interface 에 통보해준다
	int nOldClanID = ZGetNetRepository()->GetClanInfo()->nCLID;

	// repository에 클랜정보를 보관한다
	memcpy(ZGetNetRepository()->GetClanInfo(),pClanInfo,sizeof(MTD_ClanInfo));

//	mlog("OnClanResponseClanInfo : ");

	// emblem interface 에 통보한다
	ZGetEmblemInterface()->AddClanInfo(pClanInfo->nCLID);	

	if(nOldClanID!=0) {
		ZGetEmblemInterface()->DeleteClanInfo(nOldClanID);
	}

	ZIDLResource* pRes = ZApplication::GetGameInterface()->GetIDLResource();

	MPicture* pPicture= (MPicture*)pRes->FindWidget( "Lobby_ClanInfoEmblem" );
	if ( pPicture)
		pPicture->SetBitmap( ZGetEmblemInterface()->GetClanEmblem2( pClanInfo->nCLID));

	// 클랜 이름
	MLabel* pLabel = (MLabel*)pRes->FindWidget("Lobby_ClanInfoName");
	pLabel->SetText(ZGetNetRepository()->GetClanInfo()->szClanName);

	// 접속된 사람수
	char szCount[16];
	sprintf(szCount,"%d",ZGetNetRepository()->GetClanInfo()->nConnedMember);

	char szOutput[256];
//	ZTranslateMessage(szOutput,MSG_LOBBY_CLAN_DETAIL,2,
//		ZGetNetRepository()->GetClanInfo()->szMaster,szCount);
	ZTransMsg(szOutput,MSG_LOBBY_CLAN_DETAIL,2,
		ZGetNetRepository()->GetClanInfo()->szMaster,szCount);

	pLabel = (MLabel*)pRes->FindWidget("Lobby_ClanInfoDetail");
	pLabel->SetText(szOutput);


	sprintf(szOutput,"%d/%d",ZGetNetRepository()->GetClanInfo()->nWins,ZGetNetRepository()->GetClanInfo()->nLosses);
	ZBmNumLabel *pNumLabel = (ZBmNumLabel*)pRes->FindWidget("Lobby_ClanInfoWinLose");
	pNumLabel->SetText(szOutput);

	sprintf(szOutput,"%d", ZGetNetRepository()->GetClanInfo()->nPoint);
	pNumLabel = (ZBmNumLabel*)pRes->FindWidget("Lobby_ClanInfoPoints");
	pNumLabel->SetText(szOutput);

	pNumLabel = (ZBmNumLabel*)pRes->FindWidget("Lobby_ClanInfoTotalPoints");
	//		sprintf(szOutput,"%d",ZGetNetRepository()->GetClanInfo()->nWins,ZGetNetRepository()->GetClanInfo()->nXP);
	//		pNumLabel->SetText(szOutput);
	pNumLabel->SetNumber(ZGetNetRepository()->GetClanInfo()->nTotalPoint,true);

	int nRanking = pClanInfo->nRanking;

	pNumLabel = (ZBmNumLabel*)pRes->FindWidget("Lobby_ClanInfoRanking");
	pNumLabel->SetIndexOffset(16);	// 아래쪽 색다른 글씨로 찍는다
	MWidget *pUnranked = pRes->FindWidget("Lobby_ClanInfoUnranked");
	if(nRanking == 0) {
		pNumLabel->Show(false);
		if ( pUnranked)
			pUnranked->Show(true);
	}else
	{
		pNumLabel->Show(true);
		pNumLabel->SetNumber(nRanking);
		if ( pUnranked)
			pUnranked->Show(false);
	}

	/*
	// UI상에 보여줘야 하지만 지금은 준비가 안되어있는 관계로 채팅창에 뿌린다.

	char szText[256];
	sprintf(szText, "클랜명: %s", pClanInfo->szClanName);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);


	sprintf(szText, "레벨: %d", pClanInfo->nLevel);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);

	sprintf(szText, "경험치: %d", pClanInfo->nXP);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);

	sprintf(szText, "포인트: %d", pClanInfo->nPoint);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);

	sprintf(szText, "마스터: %s", pClanInfo->szMaster);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);

	sprintf(szText, "전적: %d승 %d패", pClanInfo->nWins, pClanInfo->nLoses);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);

	sprintf(szText, "클랜원정보: 총 %d명중 %d명 접속함", pClanInfo->nTotalMemberCount, pClanInfo->nConnedMember);
	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);
	*/
}
void ZInterfaceBackground::Draw(void)
{
#ifdef _FASTDEBUG
	MWidget* pWidget = (MWidget*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSelection");
	if ( pWidget)
	{
		if ( ZApplication::GetGameInterface()->GetState() == GUNZ_CHARSELECTION)
			pWidget->Show( true);
	}

	MPicture* pPicture = (MPicture*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSel_TopScreen");
	if ( pPicture)
		pPicture->SetOpacity( 0);

	return;
#endif

	// Set rendering state
	RSetViewport( 0, 0, RGetScreenWidth(), RGetScreenHeight());
	RGetDevice()->SetRenderState( D3DRS_CULLMODE  ,D3DCULL_CW);					// from rbs rendering
	RGetDevice()->SetRenderState( D3DRS_NORMALIZENORMALS , TRUE );
	RGetDevice()->SetSamplerState( 0, D3DSAMP_MINFILTER , D3DTEXF_LINEAR);		// Texture filtering
	RGetDevice()->SetSamplerState( 0, D3DSAMP_MAGFILTER , D3DTEXF_LINEAR);
	RGetDevice()->SetSamplerState( 0, D3DSAMP_MIPFILTER , D3DTEXF_LINEAR);

	// Set camera position and direction
    rvector vCamPos, vCamDir;
	float fForgDensity;

	switch ( m_nSceneNumber)
	{
		case  LOGIN_SCENE_FIXEDSKY :
		{
			// Fixed camera
			vCamPos = m_vCamPosSt;
			vCamDir = m_vCamDirSt;

			// Fixed fog -> black screen
			fForgDensity = 0.0f;

			break;
		}

		case  LOGIN_SCENE_FALLDOWN :
		{
			// Get current clock
			DWORD dwClock = ( timeGetTime() - m_dwClock);

			/*
			// Show maiet logo
			if ( !m_bShowMaietLogo)
			{
				m_bShowMaietLogo = true;
				ZGetScreenEffectManager()->AddScreenEffect( "maiet_logo");
			}
			*/

			// Set fog density
			fForgDensity = dwClock * 15.0f;

			// Set wait time
			if ( dwClock < 500)
				dwClock = 0;
			else
				dwClock -= 500;

			// Play BGM music
			//PenguinGuy
//			if ( dwClock > 2000)
//				ZApplication::GetSoundEngine()->PlayMusic( true);


			// End of scroll camera
			float fSeed = dwClock * 0.00035f;			// 카메라가 전부 다 내려오기 까지 걸리는 시간( dwClock에 곱해주는 값이
														// 작을수록 빨리 내려옴)
			if ( fSeed > 3.14)
			{
				m_nSceneNumber = LOGIN_SCENE_FIXEDCHAR;
//				m_bShowMaietLogo = false;
			}


			// Move camera position & direction
			float fGain = ( cos( fSeed) + 1.0f) / 2.0f;			// 0 < fGain < 1.0
			vCamPos = m_vCamPosEd + ( m_vCamPosSt - m_vCamPosEd) * fGain;
			vCamDir = m_vCamDirEd + ( m_vCamDirSt - m_vCamDirEd) * fGain;

			//if (m_bShowMaietLogo)
			//{
			//	ZGetScreenEffectManager()->UpdateEffects();
				ZGetScreenEffectManager()->DrawEffects();
			//}

			break;
		}

		case  LOGIN_SCENE_FIXEDCHAR :
		{
			// Show menu UI
			MWidget* pWidget = (MWidget*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSelection");
			if ( pWidget)
			{
				if ( ZApplication::GetGameInterface()->GetState() == GUNZ_CHARSELECTION)
					pWidget->Show( true);
			}
			MPicture* pPicture = (MPicture*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSel_TopScreen");
			if ( pPicture)
				pPicture->SetOpacity( 0);

			// Play BGM music
			//PenguinGuy
//			ZApplication::GetSoundEngine()->PlayMusic( true);

			// Fixed camera
			vCamPos = m_vCamPosEd;
			vCamDir = m_vCamDirEd;


			#define FADE_IN_TIME 500
			DWORD dwClock = ( timeGetTime() - m_dwClock);

			float fGain = ((float)dwClock / (float)FADE_IN_TIME);
			if (fGain > 1.0f)
				fGain = 1.0f;

			SetFogMulti(fGain);

			// Cleared fog
			fForgDensity = 50000.0f;
			break;
		}

		case  LOGIN_SCENE_SELECTCHAR :
		{
			// Get current clock
			DWORD dwClock = ( timeGetTime() - m_dwClock);
			float fGain = ( cos( dwClock * 0.0012f) + 1.0f) / 2.0f;
			//vCamPos = m_vCamPosEd + ( m_vCamPosSt - m_vCamPosEd) * fGain;
			//vCamDir = m_vCamDirEd + ( m_vCamDirSt - m_vCamDirEd) * fGain;
			vCamPos = m_vCamPosSt;
			vCamDir = m_vCamDirSt;

			MPicture* pPicture = (MPicture*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSel_TopScreen");
			if ( pPicture)
			{
				// Set wait time
				if ( dwClock < 2000)
					dwClock = 0;
				else
					dwClock -= 2000;

				// Set opacity of black screen
				int nOpacity = (int)( dwClock / 3.0f);
				if ( nOpacity > 255)
					nOpacity = 255;

				pPicture->SetOpacity( nOpacity);
			}

			// Cleared fog
			fForgDensity = 50000.0f;
			break;
		}

		case  LOGIN_ROAMING :
		{
			#define ROAM_SPEED 10000
			DWORD dwClock = ( timeGetTime() - m_dwClock);

			/*if (GetAsyncKeyState(VK_NUMPAD2) & 0x8000)
				off.y -= 1.0f;
			if (GetAsyncKeyState(VK_NUMPAD8) & 0x8000)
				off.y += 1.0f;
			if (GetAsyncKeyState(VK_NUMPAD4) & 0x8000)
				off.x += 1.0f;
			if (GetAsyncKeyState(VK_NUMPAD6) & 0x8000)
				off.x -= 1.0f;
			if (GetAsyncKeyState(VK_NUMPAD7) & 0x8000)
				off.z -= 1.0f;
			if (GetAsyncKeyState(VK_NUMPAD9) & 0x8000)
				off.z += 1.0f;

			vCamPos = m_vCamPosEd + off;
			vCamDir = m_vCamDirEd;

			// Cleared fog
			fForgDensity = 50000.0f;*/

			float fGain = ((float)dwClock / (float)ROAM_SPEED);
			if (fGain > 1.0f)
				fGain = 1.0f;
			//vCamDir = mapVecs[mapIndex].second - mapVecs[mapIndex].first;
			vCamDir = m_vCamDirEd;
			vCamPos = mapVecs[mapIndex].first + ((mapVecs[mapIndex].second - mapVecs[mapIndex].first) * fGain) + D3DXVECTOR3(0.f,-100.f,0.f);

			if (dwClock > ROAM_SPEED) {
				m_dwClock = timeGetTime();				
				mapIndex = rand() % mapVecs.size();
			}

			//fForgDensity = 50000.0f; //Clear
			fForgDensity = ((-4 * fGain * fGain) + (4 * fGain)) * 20000.f;

			break;
		}
	}

	//Fog adjust
	fForgDensity *= m_fFogMulti;

	// Set camera
	RSetCamera( vCamPos, (vCamPos + vCamDir), rvector( 0, 0, 1));

	// Draw
	RSetProjection( D3DX_PI * 70 / 180, RGetScreenWidth() / (float)RGetScreenHeight(), 10.0f, 15000.0f);
	SetFogState( fForgDensity-10000.0f, fForgDensity, 0x00000000);
	D3DXMatrixTranslation( &m_matWorld, 0, 0, 0);
	RGetDevice()->SetTransform( D3DTS_WORLD, &m_matWorld);

	// Draw background
	if ( m_pLogin)
	{
		m_pLogin->Draw();
		m_pLogin->DrawObjects();
	}

	if ( m_pMapDesc)
		m_pMapDesc->DrawMapDesc();

	// Draw effects(smoke, cloud)
//	ZGetEffectManager()->Draw( timeGetTime());

	// Draw maiet logo effect
//	ZGetScreenEffectManager()->DrawEffects();
}
void ZShopEquipInterface::SelectEquipmentFrameList( const char* szName, bool bOpen)
{
	if (szName == NULL)
	{
		SelectEquipmentFrameList("Shop", bOpen);
		SelectEquipmentFrameList("Equip", bOpen);
		return;
	}

	char szTemp[256];

	ZIDLResource* pResource = GetIDLResource();


	// Frame open/close background image
	MPicture* pPicture;
	strcpy( szTemp, szName);
	strcat( szTemp, "_ArmorBGListFrameOpen");
	pPicture = (MPicture*)pResource->FindWidget( szTemp);
	if(pPicture != NULL) {
		if( bOpen && GetArmorWeaponTabIndex() == 0 )  { pPicture->Show(true); } 
		else										{ pPicture->Show(false);}		
	}

	strcpy( szTemp, szName);
	strcat( szTemp, "_ArmorBGListFrameClose");
	pPicture = (MPicture*)pResource->FindWidget( szTemp);
	if(pPicture != NULL) {
		if( !bOpen && GetArmorWeaponTabIndex() == 0 ) { pPicture->Show(true); } 
		else										{ pPicture->Show(false);}		
	}


	// Frame open/close background image
	strcpy( szTemp, szName);
	strcat( szTemp, "_WeaponBGListFrameOpen");
	pPicture = (MPicture*)pResource->FindWidget( szTemp);
	if(pPicture != NULL) {
		if( bOpen && GetArmorWeaponTabIndex() == 1 )  { pPicture->Show(true); } 
		else										{ pPicture->Show(false);}		
	}

	strcpy( szTemp, szName);
	strcat( szTemp, "_WeaponBGListFrameClose");
	pPicture = (MPicture*)pResource->FindWidget( szTemp);
	if(pPicture != NULL) {
		if( !bOpen && GetArmorWeaponTabIndex() == 1 )  { pPicture->Show(true); } 
		else										 { pPicture->Show(false);}		
	}


	// Frame open/close image
	MButton* pButton;
	strcpy( szTemp, szName);
	strcat( szTemp, "_EquipListFrameCloseButton");
	pButton = (MButton*)pResource->FindWidget( szTemp);
	if ( pButton != NULL) pButton->Show( bOpen);

	strcpy( szTemp, szName);
	strcat( szTemp, "_EquipListFrameOpenButton");
	pButton = (MButton*)pResource->FindWidget( szTemp);
	if ( pButton != NULL) pButton->Show( !bOpen);

	// Resize item slot
	char szWidgetName[ 256];
	sprintf( szWidgetName, "%s_EquipmentSlot_Head", szName);
	MWidget* itemSlot = (MWidget*)pResource->FindWidget( szWidgetName);
	if (itemSlot) {
		MRECT rect = itemSlot->GetRect();

		int nWidth;
		if ( bOpen) nWidth = 220.0f * (float)RGetScreenWidth() / 800.0f;
		else		nWidth = min( rect.w, rect.h);

		for ( int i = 0;  i < MMCIP_END;  i++) {
			itemSlot = (MWidget*)pResource->FindWidget( GetItemSlotName( szName, i));

			if (itemSlot) {
				if(GetArmorWeaponTabIndex() == GetArmorWeaponTabIndexContainItemParts((MMatchCharItemParts)i)) {					
					rect = itemSlot->GetRect();

					itemSlot->SetBounds( rect.x, rect.y, nWidth, rect.h);
					itemSlot->Show(true);
				} 
				else {
					itemSlot->Show(false);
				}
			}
		}
	}

	// 상점과 장비창의 탭 버튼 눌림 상태를 동기화해주자 -_-;
	MBmButton* pTabBtn;
	if (GetArmorWeaponTabIndex() == 0)
	{
		pTabBtn = (MBmButton*)pResource->FindWidget("Shop_ArmorEquipmentTab");
		if (pTabBtn) pTabBtn->SetCheck(true);
		pTabBtn = (MBmButton*)pResource->FindWidget("Equip_ArmorEquipmentTab");
		if (pTabBtn) pTabBtn->SetCheck(true);
	}
	else if (GetArmorWeaponTabIndex() == 1)
	{
		pTabBtn = (MBmButton*)pResource->FindWidget("Shop_WeaponEquipmentTab");
		if (pTabBtn) pTabBtn->SetCheck(true);
		pTabBtn = (MBmButton*)pResource->FindWidget("Equip_WeaponEquipmentTab");
		if (pTabBtn) pTabBtn->SetCheck(true);
	}
}
void ZShopEquipInterface::SelectEquipmentTab(int nTabIndex)
{
	if (nTabIndex == -1)
		nTabIndex = m_nEquipTabNum;

	ZIDLResource* pResource = GetIDLResource();

	SetKindableItem( MMIST_NONE);

	// Set filter
	MComboBox* pComboBox = (MComboBox*)pResource->FindWidget( "Equip_AllEquipmentFilter");
	if(pComboBox) {
		int sel = pComboBox->GetSelIndex();

		ZMyItemList* pil = ZGetMyInfo()->GetItemList();
		if ( pil) {
			pil->m_ListFilter = sel;
			pil->Serialize();
		}
	}

	// EQUIPMENTLISTBOX
	MWidget* pWidget = pResource->FindWidget("EquipmentList");
	if (pWidget != NULL) pWidget->Show(nTabIndex==0 ? true:false);
	pWidget = pResource->FindWidget("AccountItemList");
	if (pWidget != NULL) pWidget->Show(nTabIndex==0 ? false:true);

	// 탭 버튼
	MButton* pButton = (MButton*)pResource->FindWidget( "Equip");
	if ( pButton)
	{
		pButton->Show( false);
		pButton->Enable( false);
	}

	pButton = (MButton*)pResource->FindWidget( "SendAccountItemBtn");
	if ( pButton)
	{
		pButton->Show( false);
		pButton->Enable( false);
	}

	pButton = (MButton*)pResource->FindWidget( "BringAccountItemBtn");
	if ( pButton)
	{
		pButton->Show( false);
		pButton->Enable( false);
	}

	pButton = (MButton*)pResource->FindWidget( "BringAccountSpendableItemConfirmOpen");
	if ( pButton)
	{
		pButton->Show( false);
		pButton->Enable( false);
	}

	if ( nTabIndex == 0)
	{
		pButton = (MButton*)pResource->FindWidget( "Equip");
		if (pButton) pButton->Show(true);

		pButton = (MButton*)pResource->FindWidget( "SendAccountItemBtn");
		if (pButton) pButton->Show(true);
	}
	else if ( nTabIndex == 1)
	{
		pButton = (MButton*)pResource->FindWidget( "BringAccountItemBtn");
		if ( pButton) pButton->Show( true);

		pButton = (MButton*)pResource->FindWidget( "BringAccountSpendableItemConfirmOpen");
		if ( pButton) pButton->Show( false);
	}

	pButton = (MButton*)pResource->FindWidget("Equipment_CharacterTab");
	if (pButton)
		pButton->Show( nTabIndex==0 ? false : true);
	pButton = (MButton*)pResource->FindWidget("Equipment_AccountTab");
	if (pButton)
		pButton->Show( nTabIndex==1 ? false : true);


	// 탭 라벨
	MLabel* pLabel;
	pLabel = (MLabel*)pResource->FindWidget("Equipment_FrameTabLabel1");
	if ( pLabel)
		pLabel->Show( nTabIndex==0 ? true : false);
	pLabel = (MLabel*)pResource->FindWidget("Equipment_FrameTabLabel2");
	if ( pLabel)
		pLabel->Show( nTabIndex==1 ? true : false);

	// 탭 리스트
	MPicture* pPicture;
	pPicture = (MPicture*)pResource->FindWidget("Equip_ListLabel1");
	if ( pPicture)
		pPicture->Show( nTabIndex==0 ? true : false);
	pPicture = (MPicture*)pResource->FindWidget("Equip_ListLabel2");
	if ( pPicture)
		pPicture->Show( nTabIndex==1 ? true : false);


	// 프레임 탭
	pPicture = (MPicture*)pResource->FindWidget("Equip_TabLabel");
	MBitmap* pBitmap;
	if ( pPicture)
	{
		if ( nTabIndex == 0)
			pBitmap = MBitmapManager::Get( "framepaneltab1.tga");
		else
			pBitmap = MBitmapManager::Get( "framepaneltab2.tga");

		if ( pBitmap)
			pPicture->SetBitmap( pBitmap);
	}

	// 중앙은행
	if (nTabIndex == 1)
	{
		ZGetMyInfo()->GetItemList()->ClearAccountItems();
		ZGetMyInfo()->GetItemList()->SerializeAccountItem();
	}

	// 아이템 슬롯 Enable/Disable
	for(int i = 0;  i < MMCIP_END;  i++)
	{
		ZItemSlotView* pItemSlot = (ZItemSlotView*)GetIDLResource()->FindWidget( GetItemSlotName( "Equip", i));
		if( pItemSlot ) pItemSlot->EnableDragAndDrop( nTabIndex==0 ? true : false);
	}

	m_nEquipTabNum = nTabIndex;

	DrawCharInfoText();
}
void ZShopEquipInterface::SelectShopTab(int nTabIndex)
{
	if (nTabIndex == -1)
		nTabIndex = m_nShopTabNum;

	ZIDLResource* pResource = GetIDLResource();

	// 프리미엄 샵 - 설정되는 국가대로 하나씩 지워나간다
#ifndef _DEBUG
#if defined(LOCALE_BRAZIL) || defined(LOCALE_INDIA) || defined(LOCALE_US) || defined(LOCALE_JAPAN) || defined(LOCALE_KOREA) || defined(LOCALE_NHNUSA)
	{
		if ( nTabIndex == 2)
			return;
	}
#endif
#endif

	MWidget* pWidget = pResource->FindWidget("AllEquipmentList");
	if (pWidget != NULL) pWidget->Show(nTabIndex==0 ? true : false);
	pWidget = pResource->FindWidget("MyAllEquipmentList");
	if (pWidget != NULL) pWidget->Show(nTabIndex==1 ? true : false);
	pWidget = pResource->FindWidget("CashEquipmentList");
	if (pWidget != NULL) pWidget->Show(nTabIndex==2 ? true : false);


	// Set filter
	MComboBox* pComboBox = (MComboBox*)pResource->FindWidget( "Shop_AllEquipmentFilter");
	if(pComboBox) {
		int sel = pComboBox->GetSelIndex();

		ZMyItemList* pil = ZGetMyInfo()->GetItemList();
		if ( pil) {
			pil->m_ListFilter = sel;
			pil->Serialize();
		}
	}

	// 버튼 설정
	MButton* pButton = (MButton*)pResource->FindWidget( "BuyConfirmCaller");
	if ( pButton)
	{
		pButton->Show( false);
		pButton->Enable( false);
	}
	pButton = (MButton*)pResource->FindWidget( "SellConfirmCaller");
	if ( pButton)
	{
		pButton->Show( false);
		pButton->Enable( false);
	}

	if ( nTabIndex == 0)
	{
		pButton = (MButton*)pResource->FindWidget( "BuyConfirmCaller");
		if ( pButton) pButton->Show( true);
	}
	else if ( nTabIndex == 1)
	{
		pButton = (MButton*)pResource->FindWidget( "SellConfirmCaller");
		if ( pButton)
			pButton->Show( true);
	}
	/* 수년전 만들다만 프리미엄 탭(캐쉬템) 코드임. 제거 예정
	else if ( nTabIndex == 2)
	{
		pButton = (MButton*)pResource->FindWidget( "BuyCashConfirmCaller");
		if ( pButton)
			pButton->Show( true);
	}
	*/


	pButton = (MButton*)pResource->FindWidget("AllEquipmentListCaller");
	if (pButton != NULL)
		pButton->Show(nTabIndex!=0 ? true : false);
	pButton = (MButton*)pResource->FindWidget("MyAllEquipmentListCaller");
	if (pButton != NULL)
		pButton->Show(nTabIndex!=1 ? true : false);
	pButton = (MButton*)pResource->FindWidget("CashEquipmentListCaller");
	if (pButton != NULL)
		pButton->Show(nTabIndex!=2 ? true : false);


	// 구입, 판매 라벨
	MPicture* pPicture;
	MBitmap* pBitmap;
	pPicture = (MPicture*)pResource->FindWidget("Shop_FrameTabLabel1");
	if ( pPicture)
		pPicture->Show(nTabIndex==0 ? true : false);
	pPicture = (MPicture*)pResource->FindWidget("Shop_FrameTabLabel2");
	if ( pPicture)
		pPicture->Show(nTabIndex==1 ? true : false);
	pPicture = (MPicture*)pResource->FindWidget("Shop_FrameTabLabel3");
	if ( pPicture)
		pPicture->Show(nTabIndex==2 ? true : false);


	// 프레임 탭
	pPicture = (MPicture*)pResource->FindWidget("Shop_TabLabel");
	if ( pPicture)
	{
		if ( nTabIndex == 0)
			pBitmap = MBitmapManager::Get( "framepaneltab1.tga");
		else if ( nTabIndex == 1)
			pBitmap = MBitmapManager::Get( "framepaneltab2.tga");
		else if ( nTabIndex == 2)
			pBitmap = MBitmapManager::Get( "framepaneltab3.tga");

		if ( pBitmap)
			pPicture->SetBitmap( pBitmap);
	}


	// 프리미엄 샵 - 설정되는 국가대로 하나씩 지워나간다
#ifndef _DEBUG
#if defined(LOCALE_BRAZIL) || defined(LOCALE_INDIA) || defined(LOCALE_US) || defined(LOCALE_JAPAN) || defined(LOCALE_KOREA) || defined(LOCALE_NHNUSA)
	{
		pWidget = pResource->FindWidget( "Shop_TabLabelBg");
		if ( pWidget)  pWidget->Show( false);

		pWidget = pResource->FindWidget( "CashEquipmentListCaller");
		if ( pWidget)  pWidget->Show( false);

		pWidget = pResource->FindWidget( "Shop_FrameTabLabel3");
		if ( pWidget)  pWidget->Show( false);
	}
#endif
#endif

	m_nShopTabNum = nTabIndex;

	DrawCharInfoText();
}
Exemplo n.º 13
0
void ZGameClient::OnAskAgreement(const MUID& uidProposer, void* pMemberNamesBlob,
					const MMatchProposalMode nProposalMode, const int nRequestID)
{
	// 응답할 수 없는 상황이면 바로 거절한다.
	if ((IsWaitingRepliersAgreement()) || (!ZGetGameInterface()->IsReadyToPropose()))
	{
		char szCharName[MATCHOBJECT_NAME_LENGTH];
		sprintf(szCharName, ZGetMyInfo()->GetCharName());
		ZPostReplyAgreement(uidProposer, GetPlayerUID(), szCharName, nProposalMode, nRequestID, false);

		return;
	}

	char szMemberNames[MAX_REPLIER][256];		// 0 번째는 제안자

	int nMemberCount = MGetBlobArrayCount(pMemberNamesBlob);
	if (nMemberCount < 1) return;

	for (int i = 0; i < nMemberCount; i++)
	{
		MTD_ReplierNode* pReplierNode = (MTD_ReplierNode*)MGetBlobArrayElement(pMemberNamesBlob, i);
		strcpy(szMemberNames[i], pReplierNode->szName);
	}


	m_nProposalMode = nProposalMode;
	m_nRequestID = nRequestID;
	m_uidRequestPlayer = uidProposer;

	ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
	MTextArea* pTextEdit = (MTextArea*)pResource->FindWidget("ProposalAgreementConfirm_Textarea");
	if (pTextEdit)
	{
		// 여기서 각각의 상황에 맞는 대사를 넣어줘야한다.
		char szTemp[256] = "";

		char szMembers[256] = " (";

		for (int i = 0; i < nMemberCount; i++)
		{
			strcat(szMembers, szMemberNames[i]);
			if (i != nMemberCount-1) strcat(szMembers, ", ");
		}
		strcat(szMembers, ")");

		switch (nProposalMode)
		{
		case MPROPOSAL_LADDER_INVITE:
			{
//				ZTransMsg(szTemp, MSG_LADDER_REPLIER_AGREEMENT_LABEL, 1, szMemberNames[0]);
				ZTransMsg(szTemp, MSG_LADDER_REPLIER_AGREEMENT_LABEL, 1, szMemberNames[0]);
				strcat(szTemp, szMembers);
			}
			break;
		case MPROPOSAL_CLAN_INVITE:
			{
//				ZTransMsg(szTemp, MSG_CLANBATTLE_REPLIER_AGREEMENT_LABEL, 1, szMemberNames[0]);
				ZTransMsg(szTemp, MSG_CLANBATTLE_REPLIER_AGREEMENT_LABEL, 1, szMemberNames[0]);
				strcat(szTemp, szMembers);
			}
			break;
		};

		
		pTextEdit->SetText(szTemp);
	}

	MWidget* pWidget = pResource->FindWidget("ProposalAgreementConfirm");
	if(pWidget!=NULL)
	{
		static ZCOUNTDOWN countDown = {PROPOSAL_AGREEMENT_TIMEOUT_SEC,
										"ProposalAgreementConfirm_Remain",
										"ProposalAgreementConfirm",
										OnAskReplierAgreement_OnExpire};
		countDown.nSeconds=PROPOSAL_AGREEMENT_TIMEOUT_SEC;	// static 이므로 재설정
		ZApplication::GetTimer()->SetTimerEvent(0, &OnTimer_CountDown, &countDown, true);

		pWidget->Show(true, true);
	}
}
Exemplo n.º 14
0
void MCreateSample(void)
{
	MWidget* pMainFrame = Mint::GetInstance()->GetMainFrame();
	MWidget* pNew = new MFileDialog("*.*", pMainFrame, pMainFrame);
	//pNew->SetBounds(10, 10, 300, 300);
	pNew->Show(true);

	class MFrameBitmap : public MFrame{
		int			m_nBitmap;
	protected:
		virtual void OnDraw(MDrawContext* pDC){
			MFrame::OnDraw(pDC);

			MRECT r = GetClientRect();

			if(MBitmapManager::GetCount()==0) return;
			m_nBitmap %= MBitmapManager::GetCount();
			pDC->SetBitmap(MBitmapManager::Get(m_nBitmap));
			m_nBitmap++;
			pDC->Draw(r.x, r.y);
			//pDC->Draw(r);
		}
	public:
		MFrameBitmap(const char* szName=NULL, MWidget* pParent=NULL, MListener* pListener=NULL)
			: MFrame(szName, pParent, pListener){
			m_nBitmap = 0;
		}
		virtual ~MFrameBitmap(void){
		}
	};

	MWidget* pNewFrame = new MFrameBitmap("Bitmap Test", pMainFrame, pMainFrame);
	pNewFrame->SetBounds(0, 20, 200, 200);
	pNewFrame->Show(true);

	class MFrameInfo : public MFrame{
		int m_nRenderCount;
		DWORD m_nPrevTime;
		int	m_nFPS;
	protected:
		virtual void OnDraw(MDrawContext* pDC){
			MFrame::OnDraw(pDC);

			MRECT r = GetClientRect();
			char temp[256];

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

			// FPS
			DWORD nCurrTime = timeGetTime();
			if(nCurrTime-m_nPrevTime>1000){
				m_nFPS = m_nRenderCount;
				m_nPrevTime = nCurrTime;
				m_nRenderCount = 0;
			}
			m_nRenderCount++;
			sprintf(temp, "FPS = %d", m_nFPS);
			pDC->Text(r.x, r.y, temp);

			// Cursor Pos
			/*
			POINT p;
			GetCursorPos(&p);
			ScreenToClient(m_hWnd, &p);
			*/
			MPOINT p = MEvent::GetMousePos();
			sprintf(temp, "Cursor Pos = %d, %d", p.x, p.y);
			pDC->Text(r.x, r.y+GetFont()->GetHeight(), temp);

		}
	public:
		MFrameInfo(const char* szName=NULL, MWidget* pParent=NULL, MListener* pListener=NULL)
			: MFrame(szName, pParent, pListener){
			m_nRenderCount = 0;
			m_nPrevTime = timeGetTime();
			m_nFPS = 0;
		}
		virtual ~MFrameInfo(void){
		}
	};

	MWidget* pNewCursorInfo = new MFrameInfo("Á¤º¸", pMainFrame, pMainFrame);
	pNewCursorInfo->SetBounds(400, 0, 200, 200);
	pNewCursorInfo->Show(true);

	class MFrameStar : public MFrame{
	protected:
		virtual void OnDraw(MDrawContext* pDC){
			MFrame::OnDraw(pDC);

			MRECT r = GetClientRect();
			int nRawSize = sizeof(szStar)/sizeof(char*);
			static int nRaw = 0;
			pDC->SetColor(MCOLOR(128,128,255));
			for(int i=0; i<20; i++){
				pDC->Text(r.x, r.y+i*(GetFont()->GetHeight()+2), szStar[(nRaw+i)%nRawSize]);
			}
			nRaw++;
			nRaw%=nRawSize;
		}
		virtual bool OnCommand(MWidget* pWidget, const char* szMessage){
			/*
			if(pWidget->GetID()==MGetResourceID("ID_OK") && IsMsg(szMessage, MBTN_CLK_MSG)==true){
				Hide();
			}
			*/
			return false;
		}
	public:
		MFrameStar(const char* szName=NULL, MWidget* pParent=NULL, MListener* pListener=NULL)
			: MFrame(szName, pParent, pListener){
		}
		virtual ~MFrameStar(void){
		}
	};

	MWidget* pNewStar = new MFrameStar("º° Çì´Â ¹ã", pMainFrame, pMainFrame);
	pNewStar->SetBounds(30, 250, 500, 200);
	pNewStar->Show(true);

	MPopupMenu* pNewMenu = new MPopupMenu("SampleMenu", pMainFrame, pMainFrame, MPMT_HORIZONTAL);
	MMenuItem* pFile = pNewMenu->AddMenuItem("File");
	MMenuItem* pWidget = pNewMenu->AddMenuItem("Widget");
	MPopupMenu* pFileMenu = pFile->CreateSubMenu();
	MPopupMenu* pWidgetMenu = pWidget->CreateSubMenu();
	pFileMenu->AddMenuItem("Open");
	pFileMenu->AddMenuItem("Exit");
	pWidgetMenu->AddMenuItem("Info");
	pWidgetMenu->AddMenuItem("º°Çì´Â¹ã");

	pNewMenu->SetBounds(0, 0, MGetWorkspaceWidth(), 16);
	pNewMenu->Show(0, 0, true);
	pNewMenu->Show(true);
}