Exemple #1
0
void ZCrossHair::OnDrawOptionCrossHairPreview(void* pCanvas, MDrawContext *pDC)
{
	MBitmap* pBitmaps[CH_MAX] = {NULL, };

	int nSelIndex = 0;
	MComboBox* pComboBox = (MComboBox*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget("CrossHairComboBox");
	if (pComboBox)
	{
		nSelIndex = pComboBox->GetSelIndex();
	}

	int width = 64, height = 64;
	if (pCanvas != NULL)
	{
		ZCanvas* pcanvas = (ZCanvas*)pCanvas;
		width = pcanvas->GetClientRect().w;
		height = pcanvas->GetClientRect().h;
	}

	GetBitmaps(pBitmaps, NULL, ZCrossHairPreset(nSelIndex));

	pDC->SetColor(0, 0, 0);
	pDC->FillRectangle(0, 0, width, height);
	

	float sizefactor = 1.0f;
	MPOINT center(width/2,height/2);
	float fFactor = 0.5f + 0.2f;

	DrawCrossHair(pDC, pBitmaps, center, sizefactor, fFactor);

	pDC->SetColor(128, 128, 128);
	pDC->Rectangle(0,0,width, height);
}
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();
}