Example #1
0
	bool IsTouchedSlot( AsSlot _slot )
	{
		Vector3 _touchPos;

		if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) 
		{
			_touchPos = Input.GetTouch (0).position;
		}
		else 
		{
			if( Input.touchCount <= 0 )
				return false;

			_touchPos = Input.mousePosition;
		}

		Ray ray =  AsInputManager.Instance.UICamera.ScreenPointToRay(_touchPos);
		RaycastHit hit;
		if(Physics.Raycast(ray, out hit/*, LayerMask.NameToLayer("GUI")*/) == true)
		{
			if(hit.collider.gameObject.layer == LayerMask.NameToLayer("GUI"))
			{
				AsSlot _touchSlot = hit.collider.gameObject.GetComponent<AsSlot>();
				
				if( _touchSlot == _slot )
					return true;
			}
		}

		return false;
	}
Example #2
0
	public bool SetPostBoxToInven( AsSlot _slot, Ray inputRay)
	{
		foreach( UIInvenSlot slot in invenslots)
		{
			if( true == slot.IsIntersect( inputRay))
			{
				if( null == slot.slotItem)
				{
					// send packet
					return true;
				}
				return false;
			}
		}

		return false;
	}
Example #3
0
	public bool SetPostBoxToStorage( AsSlot _slot, Ray inputRay )
	{
		foreach( UIStorageSlot slot in storageslots )
		{
			if( true == slot.IsIntersect( inputRay ) )
			{	
				if( null == slot.slotItem )
				{
					// send packet
					return true;
				}
				return false;
			}
		}
		
		return false;
	}
Example #4
0
	public void InputUp( Ray inputRay)
	{
		if( null != m_ClickDownSlot && null != m_goMoveIcon)
		{				
			GameObject.Destroy( m_goMoveIcon);
			m_ClickDownSlot = null;				
		}
	}
Example #5
0
	public void GuiInputUp( Ray inputRay)
	{
		if( null != m_ClickDownSlot)
		{
			if( null != m_goMoveIcon)			
			{		
				//if( false == AsHudDlgMgr.Instance.skillSettingDlg.SetSkillIcon( inputRay, m_ClickDownSlot.getSkillID, m_ClickDownSlot.getSkillLevel))
				//{	
					if( true == AsQuickSlotManager.Instance.SetMoveInvenSlotInSkill( inputRay, m_ClickDownSlot.getSkillID, m_ClickDownSlot.getSkillLevel))
					{						
						/*if( true == AsHudDlgMgr.Instance.IsOpenedSkillSettingDlg)
						{
							AsHudDlgMgr.Instance.skillSettingDlg.ResetSlots();
						}*/
					}
				//}
				
				GameObject.Destroy( m_goMoveIcon);
			}
			else
			{
				AsSkillTab _skillTab = tab.GetCurSkillTab();
				_skillTab.PromptTooltipBySkillID( m_ClickDownSlot.getSkillID, m_ClickDownSlot.getSkillLevel);
			}

			m_ClickDownSlot = null;
			
			AsQuickSlotManager.Instance.Backward();
		}
	}
Example #6
0
	// begin kij move icon
	public void GuiInputDown( Ray inputRay)
	{
		m_ClickDownSlot = null;
		m_fItemMoveTime = 0.0f;	
		
		AsSkillTab _skillTab = tab.GetCurSkillTab();
		if( null == _skillTab)
			return;
		
		for( int i=0; i<_skillTab.getList().Count; ++i)			
		{
			IUIListObject obj = _skillTab.getList().GetItem(i);
			if( null == obj)
				continue;
			AsSlot _slot = obj.gameObject.GetComponentInChildren<AsSlot>();
			if( null == _slot)
				continue;
			
			if( true == AsUtil.PtInCollider( _slot.collider, inputRay))
			{
				m_ClickDownSlot = _slot;
				break;
			}		
		}
	}
Example #7
0
	private void _AppendItemGet(AsSlot slot, byte slotIndex)
	{
		if( true == _isOpenMsgBox())
			return;

		if( true == readMailInfo.bAccount)
		{
			Color titleColor = new Color( 1.0f, 0.494f, 0.0f, 1.0f);
			string title = titleColor.ToString() + AsTableManager.Instance.GetTbl_String(1442);
			string msg = AsTableManager.Instance.GetTbl_String(1443);
			m_msgboxItem = AsNotify.Instance.MessageBox( title, msg, this, "OnMsgBox_AppendItemGet_Ok", "OnMsgBox_AppendItemGet_Cancel", AsNotify.MSG_BOX_TYPE.MBT_OKCANCEL, AsNotify.MSG_BOX_ICON.MBI_QUESTION);
			m_slotBuf = slot;
			m_slotIndexBuf = slotIndex;
		}
		else
		{
			// server packet
			RecieveMailItem( slotIndex);
			slot.SetEmpty();
		}

		if( false == _isGetItemInReadMailInfo())
		{
			btnTakeAll.SetControlState( UIButton.CONTROL_STATE.DISABLED);
			btnTakeAll.spriteText.Color = Color.gray;
		}
	}
Example #8
0
	public void GuiInputDown( Ray inputRay)
	{
		if( AsPStoreManager.Instance.UnableActionByPStore() == true) //$yde
			return;

		if( false == isLock)
			return;

		m_ClickDownSlot = null;
		m_fItemMoveTime = 0.0f;
		m_iClickDownQuickSlotIndex = -1;

		int	nSlotIndex = 0;
		foreach( AsSlot _slot in m_arraySlot )
		{
			if( false == _slot.Disable && true == AsUtil.PtInCollider( _slot.collider, inputRay))
			{
				if( ( null != _slot.getIcon) && ( ( true == _slot.IsEnableItem) || ( true == _slot.IsEnableSkill)))
				{
					m_ClickDownSlot = _slot;
					m_iClickDownQuickSlotIndex = nSlotIndex;
				}

				break;
			}
			
			nSlotIndex++;
		}
	}
Example #9
0
	public void GuiInputUp(Ray inputRay)
	{
		if( true == _isOpenMsgBox())
			return;

		if( null != m_ClickDownSlot && null == m_goMoveIcon)
		{
			foreach( AsSlot _slot in sendItemSlots)
			{
				if( true == AsUtil.PtInCollider( _slot.collider, inputRay))
				{
					if( true == _slot.IsEnableItem)
					{
						TooltipMgr.Instance.OpenTooltip( TooltipMgr.eOPEN_DLG.left, _slot.getRealItem);
						return;
					}
				}
			}

			foreach( AsSlot _slot in recvItemSlots)
			{
				if( true == AsUtil.PtInCollider( _slot.collider, inputRay))
				{
					if( null != _slot.getSItem)
					{
						TooltipMgr.Instance.OpenTooltip( TooltipMgr.eOPEN_DLG.left, _slot.getSItem, 0f);
						return;
					}
				}
			}
		}
		else if( null != m_ClickDownSlot && null != m_goMoveIcon)
		{
			if( TabState == ePostBoxDlgState.ReadTab)
			{
				m_goMoveIcon.transform.position = new Vector3( 	m_ClickDownSlot.transform.position.x ,
																m_ClickDownSlot.transform.position.y,
																m_ClickDownSlot.transform.position.z - 0.5f);
			}
			else if( true == AsHudDlgMgr.Instance.IsOpenInven && true == AsHudDlgMgr.Instance.invenDlg.SetPostBoxToInven( m_ClickDownSlot, inputRay))
			{
				m_ClickDownSlot.SetEmpty();
				textSendCost.Text = _GetPostCost().ToString( "#,#0", CultureInfo.InvariantCulture);
			}
			else
			{
				m_goMoveIcon.transform.position = new Vector3( 	m_ClickDownSlot.transform.position.x ,
																m_ClickDownSlot.transform.position.y,
																m_ClickDownSlot.transform.position.z - 0.5f);
			}

			m_goMoveIcon = null;
			m_ClickDownSlot = null;
		}
	}
Example #10
0
	public void InputUp( Ray inputRay)
	{
		if( true == _isOpenMsgBox())
			return;

		if( null != m_ClickDownSlot && null != m_goMoveIcon)
		{
			RaycastHit hit;
			if(Physics.Raycast(inputRay, out hit, 10000f, 1<<LayerMask.NameToLayer("GUI")) == false)
			{
				m_goMoveIcon.transform.position = new Vector3( m_ClickDownSlot.transform.position.x ,
					m_ClickDownSlot.transform.position.y,
					m_ClickDownSlot.transform.position.z - 0.5f);
				m_ClickDownSlot = null;
				m_goMoveIcon = null;
			}
		}
	}
Example #11
0
	public void GuiInputDown( Ray inputRay)
	{
		if( true == _isOpenMsgBox())
			return;

		if( null!= m_ClickDownSlot && null != m_goMoveIcon)
		{
			m_goMoveIcon.transform.position = new Vector3( m_ClickDownSlot.transform.position.x ,
				m_ClickDownSlot.transform.position.y,
				m_ClickDownSlot.transform.position.z - 0.5f);
		}
		m_ClickDownSlot = null;
		m_goMoveIcon = null;
		m_fItemMoveTime = 0.0f;

		foreach( AsSlot _slot in recvItemSlots)
		{
//			if( true == _slot.collider.bounds.IntersectRay( inputRay))
			if( true == AsUtil.PtInCollider( _slot.collider, inputRay))
			{
				if( 0 != _slot.getItemID)
				{
					AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false);
					m_ClickDownSlot = _slot;
				}

				return;
			}
		}

		foreach( AsSlot _slot in sendItemSlots)
		{
//			if( true == _slot.collider.bounds.IntersectRay( inputRay))
			if( true == AsUtil.PtInCollider( _slot.collider, inputRay))
			{
				if( 0 != _slot.getItemID)
				{
					AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false);
					m_ClickDownSlot = _slot;
				}

				return;
			}
		}
	}
Example #12
0
	public void Open( ePostBoxDlgState state=ePostBoxDlgState.ListTab)
	{
		RequestMailList();

		gameObject.SetActiveRecursively( true);
		TabChange( state);

		ItemMgr.HadItemManagement.Inven.ResetInvenSlotMoveLock();
		m_curSlotUseOpenDlg = null;
	}
Example #13
0
	public void OnMsgBox_AppendItemGetAll_Cancel()
	{
		m_slotBuf = null;
		m_slotIndexBuf = 0;
	}
Example #14
0
	private void _AppendItemGetAll()
	{
		if( false == _isGetItemInReadMailInfo())
			return;

		if( true == _isOpenMsgBox())
			return;

		//if( -1 == ItemMgr.HadItemManagement.Inven.GetEmptyInvenSlot())
		if( _isGetItemCountInReadMailInfo() > ItemMgr.HadItemManagement.Inven.GetEmptyInvenSlotCount())
		{
			AsMessageBox msgBox = AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(103), AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
			msgBox.SetOkText( AsTableManager.Instance.GetTbl_String(1152));
			return;
		}

		if( true == readMailInfo.bAccount)
		{
			Color titleColor = new Color( 1.0f, 0.494f, 0.0f, 1.0f);
			string title = titleColor.ToString() + AsTableManager.Instance.GetTbl_String(1442);
			string msg = AsTableManager.Instance.GetTbl_String(1443);
			m_msgboxItem = AsNotify.Instance.MessageBox( title, msg, this, "OnMsgBox_AppendItemGetAll_Ok", "OnMsgBox_AppendItemGetAll_Cancel", AsNotify.MSG_BOX_TYPE.MBT_OKCANCEL, AsNotify.MSG_BOX_ICON.MBI_QUESTION);
			m_slotBuf = null;
			m_slotIndexBuf = 0;
		}
		else
		{
			// server packet
			RecieveMailItem( 4, true);

			for( int i = 0; i < 4; i++)
				recvItemSlots[i].SetEmpty();

			if( readMailInfo.nGold > 0)
			{
				recvGold.Text = "0";
				readMailInfo.nGold = 0;
			}
		}

		if( false == _isGetItemInReadMailInfo())
		{
			btnTakeAll.SetControlState( UIButton.CONTROL_STATE.DISABLED);
			btnTakeAll.spriteText.Color = Color.gray;
			return;
		}
	}
Example #15
0
	private void SetSlotsInSlot( AsSlot _slot, int iBeginIndex, sQUICKSLOT[] qucikSlots, int i)
	{
		if( iBeginIndex+i >= qucikSlots.Length )
		{
			Debug.LogError("AsQuickSlotManager SetSlotsInSlot array index overflow![" + (iBeginIndex+i).ToString() + "]"); 
			return;
		}
		
		sQUICKSLOT _quickSlot = qucikSlots[ iBeginIndex + i];
		if( (int)eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_ITEM == _quickSlot.eType)
		{
			if( _quickSlot.nValue == 0)
				_slot.SetEmpty();
			else
				_slot.SetItem( _quickSlot.nValue);
		}
		else if( (int)eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_SKILL == _quickSlot.eType)
		{
			if( _quickSlot.nValue == 0)
			{
				_slot.SetEmpty();
			}
			else if( SkillBook.Instance.dicCurSkill.ContainsKey(_quickSlot.nValue) ) 
			{
				SkillView _skill = SkillBook.Instance.dicCurSkill[_quickSlot.nValue];
				_slot.SetSkill( _skill.nSkillTableIdx, _skill.nSkillLevel);
			}
		}
		else
		{
			_slot.SetEmpty();
		}
	}
Example #16
0
	private bool GuiInputUpSlot( AsSlot _slot, Ray inputRay, int i)
	{
		if( true == AsUtil.PtInCollider( _slot.collider, inputRay))
		{
			if( _slot == m_ClickDownSlot)
			{
				m_goMoveIcon.transform.position = m_ClickDownSlot.transform.position;
				m_goMoveIcon.transform.localPosition = new Vector3( 0f, 0f, -0.5f);
			}
			else
			{
				int slot_1 = m_iClickDownQuickSlotIndex;
				int data_1 = 0;//slot.getItemID;
				eQUICKSLOT_TYPE type_1 = eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_NOTHING;

				int slot_2 = i;
				int data_2 = 0;//m_ClickDownSlot.getItemID;
				eQUICKSLOT_TYPE type_2 = eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_NOTHING;

				if( _slot.IsEnableItem)
				{
					data_1 = _slot.getItemID;
					type_1 = eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_ITEM;
				}
				else if( _slot.IsEnableSkill)
				{
					data_1 = _slot.getSkillID;
					type_1 = eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_SKILL;
				}

				if( m_ClickDownSlot.IsEnableItem)
				{
					data_2 = m_ClickDownSlot.getItemID;
					type_2 = eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_ITEM;
				}
				else if( m_ClickDownSlot.IsEnableSkill)
				{
					data_2 = m_ClickDownSlot.getSkillID;
					type_2 = eQUICKSLOT_TYPE.eQUICKSLOT_TYPE_SKILL;
				}

				AsCommonSender.SendQuickslotChange( (short)slot_1, data_1, type_1);
				AsCommonSender.SendQuickslotChange( (short)slot_2, data_2, type_2);
				ItemMgr.HadItemManagement.QuickSlot.SetQuickSlot( slot_1, data_1, type_1);
				ItemMgr.HadItemManagement.QuickSlot.SetQuickSlot( slot_2, data_2, type_2);

				AsSoundManager.Instance.PlaySound( strIconDownSound, Vector3.zero, false);
			}
			return true;
		}

		return false;
	}
Example #17
0
	private void SetSlotItem( AsSlot _slot, UIInvenSlot _InvenSlot)
	{
		if( true == _InvenSlot.slotItem.realItem.item.ItemData.isTradeLimit ||
			true == _InvenSlot.slotItem.realItem.item.ItemData.isDump ||
			false == _InvenSlot.slotItem.realItem.sItem.IsTradeEnable() )
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(109), AsTableManager.Instance.GetTbl_String(29),
				null, null, AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
			return;
		}

		if( 1 < _InvenSlot.slotItem.realItem.sItem.nOverlapped)
		{
			if( true == AsHudDlgMgr.Instance.IsOpenInven)
			{
				m_curSlotUseOpenDlg = _slot;
				AsHudDlgMgr.Instance.invenDlg.OpenRemoveItemDlg( _InvenSlot.slotItem.realItem.getSlot, _InvenSlot.slotItem.realItem.sItem.nOverlapped,
					UIRemoveItemDlg.eDLG_TYPE.POSTBOX);
			}
			return;
		}
		else
		{
			if( true == _slot.IsEnableItem )
			{
				ItemMgr.HadItemManagement.Inven.SetSlotMoveLock( _slot.getRealItem.getSlot, false);
			}
			
			_slot.SetType( AsSlot.SLOT_TYPE.SLT_IT_POST );
			_slot.SetItem( _InvenSlot.slotItem.realItem, 1);
			ItemMgr.HadItemManagement.Inven.SetSlotMoveLock( _InvenSlot.slotItem.realItem.getSlot, true);

			textSendCost.Text = _GetPostCost().ToString( "#,#0", CultureInfo.InvariantCulture);
			AsSoundManager.Instance.PlaySound( _InvenSlot.slotItem.realItem.item.ItemData.getStrDropSound, Vector3.zero, false);
			return;
		}
	}
Example #18
0
	public void GuiInputUp( Ray inputRay)
	{
		if( false == isLock)
			return;

		if( null != m_goMoveIcon && null != m_ClickDownSlot &&
			AsPStoreManager.Instance.UnableActionByPStore() == false) //$yde
		{
			if( false == GuiInputUpItem(inputRay))
			{
				m_goMoveIcon.transform.position = m_ClickDownSlot.transform.position;
				m_goMoveIcon.transform.localPosition = new Vector3( 0f, 0f, -0.5f);
			}

			m_ClickDownSlot.Disable = false;
			m_goMoveIcon = null;
			m_ClickDownSlot = null;
		}
	}
Example #19
0
	private void _AppendItemCancel(AsSlot slot)
	{
		ItemMgr.HadItemManagement.Inven.SetSlotMoveLock(slot.getRealItem.getSlot, false);
		if (true == AsHudDlgMgr.Instance.IsOpenInven)
			AsHudDlgMgr.Instance.invenDlg.ApplySlotMoveLock();
		slot.SetEmpty();
	}