예제 #1
0
	public void GuiInputDClickUp( Ray inputRay)
	{
		m_bMovePageEnable = false;

		if( false == IsUseInput() || AsHudDlgMgr.Instance.IsOpenPStoreGoodsBox == true)	//$ yde
			return;

		if( null != moveItemSlot.slotItem)
		{
			SetRestoreSlot();
		}
		else if( null != m_ClickDownItemSlot && m_ClickDownItemSlot.IsIntersect( inputRay))
		{
			if( null != m_ClickDownItemSlot.slotItem)
			{
				Item.eITEM_TYPE type = m_ClickDownItemSlot.slotItem.realItem.item.ItemData.GetItemType();
				int iSubType = m_ClickDownItemSlot.slotItem.realItem.item.ItemData.GetSubType();

				if( m_ClickDownItemSlot.slotItem.realItem.getSlot != m_ClickDownItemSlot.slotIndex)
				{
					Debug.LogError( "m_ClickDownItemSlot.slotItem.realItem.sItem.nSlot != m_ClickDownItemSlot.slotIndex");
				}
				else
				{
					// < ilmeda, 20120917
					if( true == AsHudDlgMgr.Instance.IsOpenTrade && false == m_ClickDownItemSlot.isMoveLock)
					{
						AsHudDlgMgr.Instance.SendMoveItem_InvenToTrade( m_ClickDownItemSlot.slotItem.realItem);
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenStrengthenDlg)
					{
						switch( type)
						{
						case Item.eITEM_TYPE.CosEquipItem:
						case Item.eITEM_TYPE.EquipItem:
							AsHudDlgMgr.Instance.strengthenDlg.ResetUIInvenItem( m_ClickDownItemSlot.slotItem.realItem);
							break;
						default:
							AsHudDlgMgr.Instance.SetMsgBox( AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(75),
								null, "", AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE));
							break;
						}
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenEnchantDlg)
					{
						switch( type)
						{
						case Item.eITEM_TYPE.CosEquipItem:
						case Item.eITEM_TYPE.EquipItem:

							bool isHaveEnchant = TooltipMgr.IsEnableEnchant( m_ClickDownItemSlot.slotItem.realItem.sItem.nEnchantInfo, m_ClickDownItemSlot.slotItem.realItem.sItem.nStrengthenCount);
							if( isHaveEnchant == true )
							{
								AsHudDlgMgr.Instance.enchantDlg.SetEquipItem( m_ClickDownItemSlot.slotItem.realItem);
								AsSoundManager.Instance.PlaySound( m_ClickDownItemSlot.slotItem.realItem.item.ItemData.m_strDropSound, Vector3.zero, false);
							}
							break;
						case Item.eITEM_TYPE.EtcItem:
							if( (int)Item.eEtcItem.Enchant == iSubType)
							{
								AsHudDlgMgr.Instance.enchantDlg.SetEnchantItem( m_ClickDownItemSlot.slotItem.realItem);
								AsSoundManager.Instance.PlaySound( m_ClickDownItemSlot.slotItem.realItem.item.ItemData.m_strDropSound, Vector3.zero, false);
							}
							break;
						}
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenedPostBox)
					{
						if( false == m_ClickDownItemSlot.isMoveLock)
						{
//							AsHudDlgMgr.Instance.postBoxDlg.SetDClickSlotItem( m_ClickDownItemSlot);
							AsPostBoxDlg postBox = AsHudDlgMgr.Instance.postBoxDlgObj.GetComponentInChildren<AsPostBoxDlg>();
							Debug.Assert( null != postBox);
							postBox.SetDClickSlotItem( m_ClickDownItemSlot);
							AsHudDlgMgr.Instance.invenDlg.ApplySlotMoveLock();
						}
					}
//					else if( true == AsHudDlgMgr.Instance.IsOpenSynthesisDlg)
//					{
//						if( false == m_ClickDownItemSlot.isMoveLock)
//							AsHudDlgMgr.Instance.m_SynthesisDlg.SetSlotItem( m_ClickDownItemSlot.slotItem.realItem);
//					}
					else if( true == AsHudDlgMgr.Instance.IsOpenNpcStore)
					{
						if( CanProcessInput())
							AsHudDlgMgr.Instance.npcStore.SellItemFromInventory( m_ClickDownItemSlot.slotItem.realItem);
					}
					//$ yde - 20130118
					else if( true == AsHudDlgMgr.Instance.IsOpenStorage)
					{
						if( m_ClickDownItemSlot.slotItem.realItem.item.ItemData.m_bItem_Storage_Limit == false)
						{
							body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE( eSTORAGE_MOVE_TYPE.eSTORAGE_MOVE_TYPE_INPUT,
								( short)m_ClickDownItemSlot.slotIndex, m_ClickDownItemSlot.slotItem.realItem.sItem.nOverlapped, 0);
							AsCommonSender.Send( move.ClassToPacketBytes());

							AsSoundManager.Instance.PlaySound( m_ClickDownItemSlot.slotItem.realItem.item.ItemData.getStrDropSound, Vector3.zero, false);
						}
						else
						{
							AsNotify.Instance.MessageBox( 
								AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(195),
								AsNotify.MSG_BOX_TYPE.MBT_OK);
						}
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenSynEnchantDlg && false == m_ClickDownItemSlot.isMoveLock )						
					{
						 AsHudDlgMgr.Instance.m_SynEnchantDlg.SetDClickRealItem( m_ClickDownItemSlot.slotItem.realItem );
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenSynCosDlg  && false == m_ClickDownItemSlot.isMoveLock )						
					{
						AsHudDlgMgr.Instance.m_SynCosDlg.SetDClickRealItem( m_ClickDownItemSlot.slotItem.realItem );
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenSynOptionDlg && false == m_ClickDownItemSlot.isMoveLock )						
					{
						AsHudDlgMgr.Instance.m_SynOptionDlg.SetDClickRealItem( m_ClickDownItemSlot.slotItem.realItem );
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenSynDisDlg && false == m_ClickDownItemSlot.isMoveLock )						
					{
						AsHudDlgMgr.Instance.m_SynDisDlg.SetDClickRealItem( m_ClickDownItemSlot.slotItem.realItem );
					}
					else if( null != AsPetManager.Instance.PetSynthesisDlg && false == m_ClickDownItemSlot.isMoveLock )						
					{
						AsPetManager.Instance.PetSynthesisDlg.SetClickRealItem( m_ClickDownItemSlot.slotItem.realItem );
						AsHudDlgMgr.Instance.invenDlg.ApplySlotMoveLock();
					}
					else if( true == AsHudDlgMgr.Instance.IsOpenPStore && false == m_ClickDownItemSlot.isMoveLock)
					{
						AsHudDlgMgr.Instance.pstoreDlg.SendMoveItem_InvenToPStore( m_ClickDownItemSlot);
					}
					else if( m_ClickDownItemSlot.isMoveLock == false)
					{
						switch( type)
						{
						case Item.eITEM_TYPE.CosEquipItem:
							SendDClickCosEquipItem( m_ClickDownItemSlot.slotItem.realItem);
							break;
						case Item.eITEM_TYPE.EquipItem:
							if( CheckPetItem( m_ClickDownItemSlot.slotItem.realItem) == false)
								SendDClickEquipItem( m_ClickDownItemSlot.slotItem.realItem);
							else
								DClickProc_Pet( m_ClickDownItemSlot.slotItem.realItem);
							break;
						case Item.eITEM_TYPE.EtcItem:
							break;
						case Item.eITEM_TYPE.UseItem:
							if( false == AsPStoreManager.Instance.UnableActionByPStore())//$yde
							{
								if (iSubType == (int)Item.eUSE_ITEM.Random || iSubType == (int)Item.eUSE_ITEM.QuestRandom)
								{
									AsHudDlgMgr.Instance.OpenRandomItemDlg( m_ClickDownItemSlot.slotItem.realItem);
								}
								else if ((int)Item.eUSE_ITEM.SkillReset == iSubType)
								{
									ConfirmSkillReset();
								}
								else if ((int)Item.eUSE_ITEM.Gold == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())//$yde
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.Miracle == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())//$yde
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.ConsumeQuest == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.InfiniteQuest == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.GetQuest == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.Summon == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.ConsumeHair == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
									{
										SetUseHairItem(m_ClickDownItemSlot.slotItem.realItem, 109, 2124);
									}
									//m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.ChatServer == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.ChatChannel == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.CharacterNameReset == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.GuildNameReset == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.PetEgg == iSubType ||
									(int)Item.eUSE_ITEM.PetFood == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if ((int)Item.eUSE_ITEM.Event == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else if((int)Item.eUSE_ITEM.ImageGet == iSubType)
								{
									if (false == AsPStoreManager.Instance.UnableActionByPStore())
										m_ClickDownItemSlot.slotItem.realItem.SendUseItem();
									break;
								}
								else 
								{
									AsPStoreManager.Instance.ItemUsed(m_ClickDownItemSlot);
								}
							}
							else
								AsPStoreManager.Instance.ItemUsed( m_ClickDownItemSlot);
							break;
						case Item.eITEM_TYPE.ActionItem:						
							if( m_ClickDownItemSlot.slotItem.realItem.IsCanCoolTimeActive() == false)
							{
								if( false == IsPvpUseEnable(m_ClickDownItemSlot.slotItem.realItem.item))
								{
									AsMyProperty.Instance.AlertNotInPvp();
								}
								else if( false == IsRaidUseEnable(m_ClickDownItemSlot.slotItem.realItem.item) )
								{
									AsMyProperty.Instance.AlertNotInRaid();
								}
                                else if (false == IsFieldUseEnable(m_ClickDownItemSlot.slotItem.realItem.item))
                                {
                                    AsMyProperty.Instance.AlertNotInField();
                                }
								else if (false == IsIndunUseEnable(m_ClickDownItemSlot.slotItem.realItem.item))
								{
									AsMyProperty.Instance.AlertNotInIndun();
								}
								else
								{
									AsUserEntity user = AsUserInfo.Instance.GetCurrentUserEntity();
									user.HandleMessage( new Msg_Player_Use_ActionItem( m_ClickDownItemSlot.slotItem.realItem));
								}
								
								

//								AsUserEntity user = AsUserInfo.Instance.GetCurrentUserEntity();
//								user.HandleMessage( new Msg_Player_Use_ActionItem( m_ClickDownItemSlot.slotItem.realItem));
							}
							break;
						}
					}
					// ilmeda, 20120917 >
				}
			}
		}
	}
예제 #2
0
	public void GuiInputDClickUp(Ray inputRay)
	{ 
		m_bMovePageEnable = false;
		
		if( false == IsUseInput() )
			return;				
			
		if( null != moveItemSlot.slotItem )
		{
			SetRestoreSlot();
		}
		else if( null != m_ClickDownItemSlot && m_ClickDownItemSlot.IsIntersect( inputRay ) )
		{
			if( null != m_ClickDownItemSlot.slotItem )
			{
//				Item.eITEM_TYPE type = m_ClickDownItemSlot.slotItem.realItem.item.ItemData.GetItemType();
//				int iSubType = m_ClickDownItemSlot.slotItem.realItem.item.ItemData.GetSubType();
					
				if( m_ClickDownItemSlot.slotItem.realItem.getSlot != m_ClickDownItemSlot.slotIndex )
				{
					Debug.LogError("m_ClickDownItemSlot.slotItem.realItem.sItem.nSlot != m_ClickDownItemSlot.slotIndex");
				}
				else
				{
					if( true == AsHudDlgMgr.Instance.IsOpenInven)
					{
						body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE(eSTORAGE_MOVE_TYPE.eSTORAGE_MOVE_TYPE_OUTPUT,
							(short)m_ClickDownItemSlot.slotIndex, m_ClickDownItemSlot.slotItem.realItem.sItem.nOverlapped, 0);
						AsCommonSender.Send(move.ClassToPacketBytes());
					}
				}
				
			}
			
		}		
	}
예제 #3
0
	private void ReallyRemoveItem()
	{
		if( 0 == m_iReallyRemoveItemSlotIndex || 0 == m_iReallyRemoveItemCount )
				return;
		
		body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE(eSTORAGE_MOVE_TYPE.eSTORAGE_MOVE_TYPE_REMOVE,
			(short)m_iReallyRemoveItemSlotIndex, m_iReallyRemoveItemCount, 0);
		AsCommonSender.Send(move.ClassToPacketBytes());
			
		m_iReallyRemoveItemSlotIndex = 0;
		m_iReallyRemoveItemCount  = 0;
			
	}
예제 #4
0
	public void GuiInputUp(Ray inputRay)
	{ 			
		if( false == IsUseInput() )
			return;
		
//		if( true == this.quantityDlg.IsOpen() )
//		{
//			quantityDlg.GuiInputUp( inputRay );
//			return;
//		}
//		
//		if( true == this.additionDlg.IsOpen() )
//		{
//			additionDlg.GuiInputUp( inputRay );
//			return;
//		}
		
		sortButton.GuiInputUp( inputRay, page.curPage );
		
		if( true == CheckLineLockClicked(inputRay) )
		{
			if( null == moveItemSlot.slotItem && true == m_bMovePageEnable )
			{		
				StorageAdditionDlg();			
				
				m_bMovePageEnable = false;
				return;
			}
			
			if( null != moveItemSlot.slotItem)
			{
				SetRestoreSlot();
				return;
			}
		}
		
//		if( null == moveItemSlot.slotItem && true == m_bMovePageEnable )
//		{
//			if( true == CheckLineLockClicked(inputRay) )
//			{				
//				StorageAdditionDlg();			
//				
//				m_bMovePageEnable = false;
//				return;
//			}
//		}		
		
		if( null != moveItemSlot.slotItem && null != m_ClickDownItemSlot )
		{
			if( m_ClickDownItemSlot.IsIntersect( inputRay ) )
			{				
				if( m_ClickDownItemSlot.slotIndex == moveItemSlot.slotIndex )
				{
					SetRestoreSlot();						
				}
				else
				{
					if( true == AsHudDlgMgr.Instance.IsDontMoveState)
//					if( false == AsHudDlgMgr.Instance.IsOpenTrade && false == AsHudDlgMgr.Instance.IsOpenEnchantDlg && false == AsHudDlgMgr.Instance.IsOpenStrengthenDlg )
					{
						PlayDropSound( moveItemSlot.slotItem.realItem.item );
						
						body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE(eSTORAGE_MOVE_TYPE.eSTORAGE_MOVE_TYPE_INSIDE,
								(short)moveItemSlot.slotIndex, moveItemSlot.slotItem.realItem.sItem.nOverlapped, (short)m_ClickDownItemSlot.slotIndex);
						
						Debug.Log(moveItemSlot.slotIndex + " -> " + m_ClickDownItemSlot.slotIndex + "(count:" + moveItemSlot.slotItem.realItem.sItem.nOverlapped + ")");
						AsCommonSender.Send(move.ClassToPacketBytes());
						moveItemSlot.DeleteSlotItem();
					}
				}
			}
			else
			{		
				bool bExistSlot = false;
				foreach( UIStorageSlot slot in storageslots )
				{
					if( slot.IsIntersect( inputRay ) )
					{				
						if( null != slot.slotItem  )
						{
							if( moveItemSlot.slotItem.realItem.sItem.nItemTableIdx == slot.slotItem.realItem.sItem.nItemTableIdx )
							{
								if( slot.slotItem.realItem.sItem.nOverlapped >= slot.slotItem.realItem.item.ItemData.overlapCount )
								{
									break;
								}
							}
						}
						
						//if( true == AsHudDlgMgr.Instance.IsDontMoveState)
						if( false == AsHudDlgMgr.Instance.IsOpenTrade && false == AsHudDlgMgr.Instance.IsOpenEnchantDlg && false == AsHudDlgMgr.Instance.IsOpenStrengthenDlg )
						{
							PlayDropSound( moveItemSlot.slotItem.realItem.item );
							
							body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE(eSTORAGE_MOVE_TYPE.eSTORAGE_MOVE_TYPE_INSIDE,
								(short)moveItemSlot.slotIndex, moveItemSlot.slotItem.realItem.sItem.nOverlapped, (short)slot.slotIndex);
							
							Debug.Log(moveItemSlot.slotIndex + " -> " + slot.slotIndex + "(count:" + moveItemSlot.slotItem.realItem.sItem.nOverlapped + ")");
							AsCommonSender.Send(move.ClassToPacketBytes());
							moveItemSlot.DeleteSlotItem();
						}
						else
							SetRestoreSlot();
						
						bExistSlot = true;
						break;
					}
				}
				
				if( false == bExistSlot )
				{
					if( true == AsHudDlgMgr.Instance.SendMoveItem_StorageToInven(inputRay, moveItemSlot))  //AsQuickSlotManager.Instance.SetMoveInvenSlotInItemSlot( inputRay, moveItemSlot ) )
					{
						SetRestoreSlot();
					}
					else
					{
						SetRestoreSlot();
//						body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE(eSTORAGE_MOVE_TYPE.eSTORAGE_MOVE_TYPE_REMOVE,
//							(short)moveItemSlot.slotIndex, moveItemSlot.slotItem.realItem.sItem.nOverlapped, 0);
//						AsCommonSender.Send(move.ClassToPacketBytes());
//						moveItemSlot.DeleteSlotItem();
////						SetRestoreSlot();
					}
				}
			}		
		}
		else if( null != m_ClickDownItemSlot && true == m_ClickDownItemSlot.IsIntersect( inputRay ) )			
		{							
			OpenTooltip();			
		}		
//		else if( true == m_bMovePageEnable )
//		{
//			if( true == page.IsPageeRectIntersect( inputRay ) )
//			{
//				
//				Vector2 vec2Direction = Vector2.zero;
//				vec2Direction.x =  inputRay.origin.x;
//				vec2Direction.y =  inputRay.origin.y;
//				
//				vec2Direction = vec2Direction - m_vec2DownPosition;      		
//				if( dragPageMoveDistance < vec2Direction.magnitude)
//				{
//					if( 0 > Vector2.Dot( Vector2.right, vec2Direction.normalized ) )
//					{
//						NextPage();
//					}
//					else
//					{
//						PrePage();
//					}
//				}
//			}
//		}
		
		m_bMovePageEnable = false;
		
		
	}	
예제 #5
0
	// < private
	private void _OkBtnDelegate(ref POINTER_INFO ptr)
	{
		if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP)
		{
			if( null != m_RealItem)
			{
				body_CS_STORAGE_MOVE move = new body_CS_STORAGE_MOVE(m_MoveType,
					(short)m_RootSlotIdx , m_nCurCount, (short)m_TargetSlotIdx);
				AsCommonSender.Send(move.ClassToPacketBytes());
				
				
				AsSoundManager.Instance.PlaySound( m_RealItem.item.ItemData.getStrDropSound, Vector3.zero, false);
				
				Debug.Log("_OkBtnDelegate: m_MoveType:" + m_MoveType + ", m_RootSlotIdx:" + m_RootSlotIdx + 
					", m_nCurCount:" + ", m_TargetSlotIdx:" + m_TargetSlotIdx);
				
//				invenSlot.DeleteSlotItem();
			}
			
			AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false);
			Close();
		}
	}