Ejemplo n.º 1
0
	void PrivateShop_ItemBuy( byte[] _packet)
	{
		body_SC_PRIVATESHOP_ITEMBUY buy = new body_SC_PRIVATESHOP_ITEMBUY();
		buy.PacketBytesToClass( _packet);

		AsPStoreManager.Instance.Recv_ItemBuy( buy);
	}
Ejemplo n.º 2
0
	public void Recv_ItemBuy(body_SC_PRIVATESHOP_ITEMBUY _buy)
	{
		switch(_buy.eResult)
		{
		case eRESULTCODE.eRESULT_SUCC:
			if(_buy.nPrivateShopUID == m_CurShopUId && AsHudDlgMgr.Instance.IsOpenPStore == true)
				AsHudDlgMgr.Instance.pstoreDlg.ItemSold(_buy);

			if( m_SearchDlg != null)
				m_SearchDlg.PurchaseComplete( _buy);
			break;
		case eRESULTCODE.eRESULT_FAIL_PRIVATESHOP_NOTITEM:
			AsNotify.Instance.MessageBox("", AsTableManager.Instance.GetTbl_String(329), AsNotify.MSG_BOX_TYPE.MBT_OK);
			if( m_SearchDlg != null)
				m_SearchDlg.RequestSearch();
			break;
		case eRESULTCODE.eRESULT_FAIL_PRIVATESHOP_LESS:
			AsNotify.Instance.MessageBox("", AsTableManager.Instance.GetTbl_String(329), AsNotify.MSG_BOX_TYPE.MBT_OK);
			if( m_SearchDlg != null)
				m_SearchDlg.RequestSearch();
			break;
		case eRESULTCODE.eRESULT_FAIL_PRIVATESHOP_NOTENTER:
			AsNotify.Instance.MessageBox("", AsTableManager.Instance.GetTbl_String(329), AsNotify.MSG_BOX_TYPE.MBT_OK);
			if( m_SearchDlg != null)
				m_SearchDlg.RequestSearch();
			break;
		case eRESULTCODE.eRESULT_FAIL_PRIVATESHOP_NOTGOLD:
			AsNotify.Instance.MessageBox("", AsTableManager.Instance.GetTbl_String(28), AsNotify.MSG_BOX_TYPE.MBT_OK);
			break;
		case eRESULTCODE.eRESULT_FAIL_PRIVATESHOP_INVENTORYFULL:
			AsNotify.Instance.MessageBox("", AsTableManager.Instance.GetTbl_String(1399), AsNotify.MSG_BOX_TYPE.MBT_OK);
			break;
		}
		
		Debug.Log("AsPStoreManager::Recv_ItemBuy: " + _buy.eResult);
	}
Ejemplo n.º 3
0
	public void BuyProc( body_SC_PRIVATESHOP_ITEMBUY _buy)
	{
		Item item = ItemMgr.ItemManagement.GetItem( m_SearchInfo.sItem.nItemTableIdx);
		string name = AsTableManager.Instance.GetTbl_String( item.ItemData.nameId);
		string header = AsTableManager.Instance.GetTbl_String(1145);
		string body = string.Format(AsTableManager.Instance.GetTbl_String(376), name);
		AsNotify.Instance.MessageBox(header, body);
		
		m_SearchInfo.sItem.nOverlapped -= _buy.nItemCount;
		if( count_ != null)
		{
			if( m_SearchInfo.sItem.nOverlapped > 1)
				count_.Text = m_SearchInfo.sItem.nOverlapped.ToString();
			else if( m_SearchInfo.sItem.nOverlapped == 1)
				count_.Text = "";
		}
		
//		if( m_SearchInfo.sItem.nOverlapped < 1)
//			container.GetScrollList().RemoveItem( container, true);
	}
Ejemplo n.º 4
0
	public void ItemSold(body_SC_PRIVATESHOP_ITEMBUY _item)
	{
		Debug.Log("UIPStoreDlg::ItemSold: _item.nPrivateShopSlot = "  + _item.nPrivateShopSlot + ", _item.nItemCount = " + _item.nItemCount);
		
		string name = AsTableManager.Instance.GetTbl_String( slots[_item.nPrivateShopSlot].slotItem.realItem.item.ItemData.nameId);
		string header = AsTableManager.Instance.GetTbl_String(1145);
		string body = string.Format(AsTableManager.Instance.GetTbl_String(376), name);
		AsNotify.Instance.MessageBox(header, body);
		
		int curQuantity = slots[_item.nPrivateShopSlot].slotItem.realItem.sItem.nOverlapped;
		int resultCount = curQuantity - _item.nItemCount;
		Debug.Log("UIPStoreDlg::ItemSold: resultCount = "  + resultCount);
		if(resultCount < 1)
			slots[_item.nPrivateShopSlot].Clear();
		else
		{
			slots[_item.nPrivateShopSlot].slotItem.realItem.sItem.nOverlapped = resultCount; 
			slots[_item.nPrivateShopSlot].slotItem.SetItemCountText(resultCount);
			scrollList.ClipItems();
		}
	}
Ejemplo n.º 5
0
	public void RemovePStoreItem(body_SC_PRIVATESHOP_ITEMBUY _item)
	{
		if( ( slots.Count - 1) < _item.nPrivateShopSlot || _item.nPrivateShopSlot < 0)
			return;
		
		slots[_item.nPrivateShopSlot].Clear();
		
		SetRestoreSlot();
	}
Ejemplo n.º 6
0
	public void PurchaseComplete( body_SC_PRIVATESHOP_ITEMBUY _buy)
	{
		m_SavedSlot.BuyProc( _buy);
		
		if( m_SavedSlot.SearchInfo.sItem.nOverlapped < 1)
		{
			SetCoolTime();
			
			StartCoroutine( "Cool_CR");
			
			if( m_PageIdx == 0) m_PageIdx = 1;
			
			body_CS_PRIVATESHOP_SEARCH search = new body_CS_PRIVATESHOP_SEARCH(
				m_PageIdx, m_ItemTableIdx, m_Class,
				m_Category1, m_Category2, m_LevelMin, m_LevelMax,
				m_Grade, m_MapIdx, m_SearchType);
			
			AsCommonSender.Send(search.ClassToPacketBytes());
		}
	}