void ZItemCountDlg::UpdateDlg()
{
	char szText[ 256];

	CCPicture* pPicture = (CCPicture*)GetIDLResource()->FindWidget( "TradeCountableItem_ItemIcon");
	if ( pPicture && m_pItemIcon)
		pPicture->SetBitmap( m_pItemIcon);

	// 현재 수량이 올바른 범위내에 있는지 검사
	m_nCurrCount = max(m_nCurrCount, m_nMin);
	m_nCurrCount = min(m_nCurrCount, m_nMax);

	CCLabel* pLabel = (CCLabel*)GetIDLResource()->FindWidget( "TradeCountableItem_Calculate");
	if (pLabel)
	{
		if (m_mode == ZICD_SENDACCOUNT || m_mode == ZICD_BRINGACCOUNT)
		{
			sprintf( szText, "%s x %d", m_strItemName.c_str(), m_nCurrCount);
			pLabel->SetText( szText);
		}
		else if (m_mode == ZICD_SELL || m_mode == ZICD_BUY)
		{
			sprintf( szText, "%s (%d bounty) x %d", m_strItemName.c_str(), m_nPrice, m_nCurrCount);
			pLabel->SetText( szText);
		}
	}

	if (m_mode == ZICD_SELL || m_mode == ZICD_BUY)
	{
		pLabel = (CCLabel*)GetIDLResource()->FindWidget( "TradeCountableItem_Total");
		if (pLabel)
		{
			sprintf( szText, "= %d bounty", m_nPrice * m_nCurrCount);
			pLabel->SetText(szText);
		}
	}

	CCEdit* pEdit = (CCEdit*)GetIDLResource()->FindWidget( "TradeCountableItem_CountNum");
	if ( pEdit)
	{
		// 현재 에디트박스에 기입된 수량이 다르다면 갱신해준다
		const char* sz = pEdit->GetText();
		int count = atoi(sz);

		if (m_nCurrCount != count)
		{
			stringstream ss;
			ss << m_nCurrCount;
			pEdit->SetText( ss.str().c_str());
		}
	}
}
void WidgetEnableShow(const char* szWidget, bool bEnable, bool bShow)
{
	MWidget* pWidget = GetIDLResource()->FindWidget( szWidget);
	if (pWidget)
	{
		pWidget->Enable(bEnable);
		pWidget->Show(bShow);
	}
}
// 이렇게 된 곳도 있는데 이건 왜 숨기기만 하는지 모르겠다 -_-;
void WidgetHideDisable(const char* szWidget)
{
	MWidget* pWidget = GetIDLResource()->FindWidget( szWidget);
	if ( pWidget)
	{
		pWidget->Show( false);
		pWidget->Enable( false);
		//pWidget->Show( true);
	}
}
void ZItemCountDlg::OnEditBoxChanged()
{
	CCEdit* pEdit = (CCEdit*)GetIDLResource()->FindWidget( "TradeCountableItem_CountNum");
	if ( pEdit)
	{
		const char* sz = pEdit->GetText();
		int count = atoi(sz);
		m_nCurrCount = count;
	}

	UpdateDlg();
}
void ZItemCountDlg::Open(ZITEMCOUNTDLG_MODE mode, const char* szItemName, CCBitmap* pIcon, int price, int nMin, int nMax, IItemCountDlgDoneHandler* pHandler )
{
	m_mode = mode;
	m_strItemName = szItemName;
	m_pItemIcon = pIcon;
	m_nPrice = price;
	m_nMin = nMin;
	m_nMax = nMax;
	m_pDoneHandler = pHandler;

	if (m_nMin > m_nMax || m_nMin < 0 || m_nMax < 0)
	{
		_ASSERT(0);
		m_nMin = m_nMax = 0;
	}

	m_nCurrCount = 1;

	CCFrame* pFrame = (CCFrame*)GetIDLResource()->FindWidget("TradeCountableItemFrame");
	CCLabel* pLabel1 = (CCLabel*)GetIDLResource()->FindWidget("TradeCountableItem_Message");
	CCLabel* pLabel2 = (CCLabel*)GetIDLResource()->FindWidget("TradeCountableItem_NullLabel");
	CCButton* pBtn = (CCButton*)GetIDLResource()->FindWidget("TradeCountableItem_Ok");

	switch (m_mode) {
		case ZICD_SELL:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_SELL_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_SELL_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_SELL_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_SELL_BUTTON));
			break;
		case ZICD_BUY:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_BUY_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_BUY_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_BUY_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_BUY_BUTTON));
			break;
		case ZICD_SENDACCOUNT:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_SEND_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_SEND_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_SEND_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_SEND_BUTTON));
			break;
		case ZICD_BRINGACCOUNT:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_BRING_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_BRING_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_BRING_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_BRING_BUTTON));
			break;
	}

	UpdateDlg();

	CCWidget* pWidget = GetIDLResource()->FindWidget( "TradeCountableItemFrame");
	if ( pWidget)
		pWidget->Show( true, true);

	pWidget = GetIDLResource()->FindWidget( "TradeCountableItem_CountNum");
	if ( pWidget)
		pWidget->SetFocus();
}
// 장비 아이콘 드래그 앤 드롭 상태일때 장착 가능한 ItemSlot 뷰 설정하기
void ZShopEquipInterface::SetKindableItem( MMatchItemSlotType nSlotType)
{
	ZItemSlotView* itemSlot;
	for ( int i = 0;  i < MMCIP_END;  i++)
	{
		itemSlot = (ZItemSlotView*)GetIDLResource()->FindWidget( GetItemSlotName( "Equip", i));
		if ( itemSlot)
		{
			bool bKindable = IsKindableItem(itemSlot->GetParts(), nSlotType);
			itemSlot->SetKindable( bKindable);
		}
	}
}
void ZSellCashItemConfirmDlg::Update()
{
	if (!m_bWaitActivatingOkBtn) return;

	DWORD currTime = timeGetTime();
	if (currTime - m_nWaitActivatingOkBtnBeginTime > 3000)
	{
		m_bWaitActivatingOkBtn = false;

		CCButton* pButton = (CCButton*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Sell");
		if (pButton)
			pButton->Enable(true);
	}
}
// 주어진 슬롯타입을 담고 있는 탭을 선택해준다 - 리스트에서 어떤 아이템을 선택한 경우 그 아이템에 맞는 방어구/무기탭을 자동변경해주는 기능을 위해
void ZShopEquipInterface::SelectArmorWeaponTabWithSlotType(MMatchItemSlotType nSlotType)
{
	ZItemSlotView* pItemSlot;
	for ( int i = 0;  i < MMCIP_END;  i++)
	{
		pItemSlot = (ZItemSlotView*)GetIDLResource()->FindWidget( GetItemSlotName( "Equip", i));
		if ( pItemSlot)
		{
			if (IsKindableItem(pItemSlot->GetParts(), nSlotType))
			{
				int tabIndex = GetArmorWeaponTabIndexContainItemParts(pItemSlot->GetParts());
				
				bool bOpened = ZGetGameInterface()->GetShopEquipInterface()->IsEquipmentFrameListOpened();
				ZGetGameInterface()->GetShopEquipInterface()->SetArmorWeaponTabIndex(tabIndex);
				ZGetGameInterface()->GetShopEquipInterface()->SelectEquipmentFrameList(NULL, bOpened);

				return;
			}
		}
	}
}
bool ZShopEquipInterface::IsEquipmentFrameListOpened( const char* szName)
{
	ZIDLResource* pResource = GetIDLResource();

	char szTemp[256];
	MPicture* pPicture;
	strcpy( szTemp, szName);
	if (GetArmorWeaponTabIndex() == 0)
	{
		strcat( szTemp, "_ArmorBGListFrameOpen");
		pPicture = (MPicture*)pResource->FindWidget( szTemp);
		if (pPicture) 
			return pPicture->IsVisible();
	}
	else if (GetArmorWeaponTabIndex() == 1)
	{
		strcat( szTemp, "_WeaponBGListFrameOpen");
		pPicture = (MPicture*)pResource->FindWidget( szTemp);
		if (pPicture) 
			return pPicture->IsVisible();
	}
	return false;
}
void ZSellCashItemConfirmDlg::Open(const char* szItemName, CCBitmap* pIcon, int price, int count, ISellCashItemConfirmDlgDoneHandler* pHandler)
{
	CCPicture* pPicture = (CCPicture*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Thumbnail");
	if (pPicture)
		pPicture->SetBitmap(pIcon);

	CCLabel* pLabel = (CCLabel*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_ItemName");
	if (pLabel)
		pLabel->SetText(szItemName);

	char szPrice[256];
	sprintf(szPrice, "%d %s", price, ZMsg(MSG_CHARINFO_BOUNTY));
	pLabel = (CCLabel*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Bounty");
	if (pLabel)
		pLabel->SetText(szPrice);

	CCTextArea* pTextArea = (CCTextArea*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Warning");
	if (pTextArea)
		pTextArea->SetText( ZMsg(MSG_SHOPEQUIP_SELL_CASHITEM_CONFIRM));

	CCFrame* pFrame = (CCFrame*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame");
	if (pFrame)
	{
		pFrame->Show(true, true);
	}

	m_pDoneHandler = pHandler;

	// 유저가 지금 팔고자 하는 캐쉬아이템을 확실히 인지할수 있는 시간을 주기 위해 OK 버튼을 몇초후 활성화시킨다
	CCButton* pButton = (CCButton*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Sell");
	if (pButton)
	{
		pButton->Enable(false);
		m_bWaitActivatingOkBtn = true;
		m_nWaitActivatingOkBtnBeginTime = timeGetTime();
	}
}
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();
}
void ZShopEquipInterface::DrawCharInfoText(char* szShopOrEquip, int nReqLevel, int nNewWT, int nNewMaxWT, int nNewHP, int nNewAP, int nReqBounty, int nReqCash)
{
	if (szShopOrEquip == NULL) 
	{
		DrawCharInfoText("Shop", nReqLevel, nNewWT, nNewMaxWT, nNewHP, nNewAP, nReqBounty, nReqCash);
		DrawCharInfoText("Equip", nReqLevel, nNewWT, nNewMaxWT, nNewHP, nNewAP, nReqBounty, nReqCash);
		return;
	}

	if (0!=strcmp(szShopOrEquip, "Shop") && 0!=strcmp(szShopOrEquip, "Equip")) return;

	MTextArea* pTextArea[3];
	char sz1[256], sz2[256], szTextArea[64];
	const char* szRed	= "^1";
	const char* szGreen	= "^2";
	const char* szGray	= "^9";
	const char* szColor	= NULL;

	// prefix에 따라서 "Shop_MyInfo1" "Shop_MyInfo2" "Shop_MyInfo3" "Equip_MyInfo1" "Equip_MyInfo2" "Equip_MyInfo3"의 이름을 구성
	// (가로로 늘어놓은 TextArea 세개에 나눠서 표시하기 때문에..)
	for (int i=0; i<3; ++i)
	{
		sprintf(szTextArea, "%s_MyInfo%d", szShopOrEquip, i+1);
		pTextArea[i] = (MTextArea*)GetIDLResource()->FindWidget(szTextArea);
		if (NULL == pTextArea[i])
		{
			_ASSERT(0);
			return;	// 하나라도 못찾으면 리턴해버리자
		}

		pTextArea[i]->Clear();
	}

	// 첫번째 TextArea (레벨, 무게)
	szColor = szGray;
	if (nReqLevel > ZGetMyInfo()->GetLevel())
		szColor = szRed;
	sprintf(sz1, "^9%s : %s%d ^9%s", ZMsg(MSG_CHARINFO_LEVEL), szColor, ZGetMyInfo()->GetLevel(), ZMsg(MSG_CHARINFO_LEVELMARKER));
	pTextArea[0]->AddText(sz1);

	int nCurrMaxWT = ZGetMyInfo()->GetItemList()->GetMaxWeight();
	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_WEIGHT));
	szColor = (nNewWT > nNewMaxWT) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, nNewWT);
	strcat(sz1, sz2);
	sprintf(sz2, "^9/%d", nCurrMaxWT);
	strcat(sz1, sz2);
	int nDiffMaxWT = nNewMaxWT - nCurrMaxWT;
	if (nDiffMaxWT != 0)
	{
		szColor = (nDiffMaxWT > 0) ? szGreen : szRed;
		sprintf(sz2, "%s%+d", szColor, nDiffMaxWT);
		strcat(sz1, sz2);
	}
	pTextArea[0]->AddText(sz1);



	// 두번째 TextArea (체력, 방어)
	sprintf(sz1, "^9%s : %d ", ZMsg(MSG_CHARINFO_HP), ZGetMyInfo()->GetHP());
	int nDiffHP = nNewHP - ZGetMyInfo()->GetHP();
	if (nDiffHP != 0)
	{
		szColor = (nDiffHP > 0) ? szGreen : szRed;
		sprintf(sz2, "%s%+d", szColor, nDiffHP);
		strcat(sz1, sz2);
	}
	pTextArea[1]->AddText(sz1);

	sprintf(sz1, "^9%s : %d ", ZMsg(MSG_CHARINFO_AP), ZGetMyInfo()->GetAP());
	int nDiffAP = nNewAP - ZGetMyInfo()->GetAP();
	if (nDiffAP != 0)
	{
		szColor = (nDiffAP > 0) ? szGreen : szRed;
		sprintf(sz2, "%s%+d", szColor, nDiffAP);
		strcat(sz1, sz2);
	}
	pTextArea[1]->AddText(sz1);


	// 세번째 TextArea (바운티, 캐시)

	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_BOUNTY));
	szColor = (nReqBounty > ZGetMyInfo()->GetBP()) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, ZGetMyInfo()->GetBP());
	strcat(sz1, sz2);
	pTextArea[2]->AddText(sz1);

	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_CASH));
	szColor = (nReqBounty > ZGetMyInfo()->GetECoins()) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, ZGetMyInfo()->GetECoins());
	strcat(sz1, sz2);
	pTextArea[2]->AddText(sz1);

/*	보유 캐쉬는 캐쉬템 구입이 가능해질때 보여주자
	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_CASH));
	szColor = (nReqCash > ZGetMyInfo()->GetCash()) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, ZGetMyInfo()->GetCash());
	strcat(sz1, sz2);
	pTextArea[2]->AddText(sz1);
	*/
}
void ZItemCountDlg::Close()
{
	CCWidget* pWidget = GetIDLResource()->FindWidget( "TradeCountableItemFrame");
	if ( pWidget) pWidget->Show( false);
}
void ZSellCashItemConfirmDlg::Close()
{
	CCWidget* pWidget = GetIDLResource()->FindWidget( "SellCashItemConfirmFrame");
	if ( pWidget) pWidget->Show( false);
}