Exemplo n.º 1
0
	private void OnToggleBtn()
	{
		AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false);
		
		if( true == isMyInfo)
		{
			if( eRankViewType.World == eType || eRankViewType.Friend == eType)
			{
				curPage = 0;
				toggleBtn.Text = AsTableManager.Instance.GetTbl_String(1665);
				pageText.Text = string.Format( "1/{0}", WorldMaxPage);
				
				body_CS_RANK_TOP_LOAD worldRank = new body_CS_RANK_TOP_LOAD( eRANKTYPE.eRANKTYPE_ITEM, 0);
				byte[] sendData = worldRank.ClassToPacketBytes();
				AsNetworkMessageHandler.Instance.Send( sendData);
				
				prevPage.SetControlState( UIButton.CONTROL_STATE.NORMAL);
				nextPage.SetControlState( UIButton.CONTROL_STATE.NORMAL);
			}
            else if (eRankViewType.Week == eType)
            {
                curPage = 0;
                toggleBtn.Text = AsTableManager.Instance.GetTbl_String(1665);
                pageText.Text = string.Format("1/{0}", WeekMaxPage);

                body_CS_RANK_TOP_LOAD weekRank = new body_CS_RANK_TOP_LOAD(eRANKTYPE.eRANKTYPE_AP, 0);
                byte[] sendData = weekRank.ClassToPacketBytes();
                AsNetworkMessageHandler.Instance.Send(sendData);

                prevPage.SetControlState(UIButton.CONTROL_STATE.NORMAL);
                nextPage.SetControlState(UIButton.CONTROL_STATE.NORMAL);
            }
			else
			{
				curPage = 0;
				toggleBtn.Text = AsTableManager.Instance.GetTbl_String(908);
				pageText.Text = string.Format( "1/{0}", PvpWorldMaxPage);
				
				body_CS_RANK_TOP_LOAD PvpworldRank = new body_CS_RANK_TOP_LOAD( eRANKTYPE.eRANKTYPE_ARENA, 0);
				byte[] sendData = PvpworldRank.ClassToPacketBytes();
				AsNetworkMessageHandler.Instance.Send( sendData);
				
				prevPage.SetControlState( UIButton.CONTROL_STATE.NORMAL);
				nextPage.SetControlState( UIButton.CONTROL_STATE.NORMAL);
			}
		}
		else
		{
			if( eRankViewType.World == eType || eRankViewType.Friend == eType)
			{
				toggleBtn.Text = AsTableManager.Instance.GetTbl_String(1670);
				pageText.Text = "1/1";
				
				body_CS_RANK_MYRANK_LOAD myRank = new body_CS_RANK_MYRANK_LOAD( eRANKTYPE.eRANKTYPE_ITEM);
				byte[] sendData = myRank.ClassToPacketBytes();
				AsNetworkMessageHandler.Instance.Send( sendData);
				
				prevPage.SetControlState( UIButton.CONTROL_STATE.DISABLED);
				nextPage.SetControlState( UIButton.CONTROL_STATE.DISABLED);
			}
            else if (eRankViewType.Week == eType)
            {
                toggleBtn.Text = AsTableManager.Instance.GetTbl_String(1670);
                pageText.Text = "1/1";

                body_CS_RANK_MYRANK_LOAD myRank = new body_CS_RANK_MYRANK_LOAD(eRANKTYPE.eRANKTYPE_AP);
                byte[] sendData = myRank.ClassToPacketBytes();
                AsNetworkMessageHandler.Instance.Send(sendData);

                prevPage.SetControlState(UIButton.CONTROL_STATE.DISABLED);
                nextPage.SetControlState(UIButton.CONTROL_STATE.DISABLED);
            }
            else
            {
                toggleBtn.Text = AsTableManager.Instance.GetTbl_String(909);
                pageText.Text = "1/1";

                body_CS_RANK_MYRANK_LOAD PvpmyRank = new body_CS_RANK_MYRANK_LOAD(eRANKTYPE.eRANKTYPE_ARENA);
                byte[] sendData = PvpmyRank.ClassToPacketBytes();
                AsNetworkMessageHandler.Instance.Send(sendData);

                prevPage.SetControlState(UIButton.CONTROL_STATE.DISABLED);
                nextPage.SetControlState(UIButton.CONTROL_STATE.DISABLED);
            }
		}
		
		isMyInfo = !isMyInfo;
	}
Exemplo n.º 2
0
	public void Init( body_SC_RANK_SUMMARY_MYRANK_LOAD_RESULT data)
	{
		eType = eRankViewType.World;
		
		baseDate = data;
		
		//InvokeRepeating( "UpdateRenewalTime", 0.0f, 60.0f);
		renewTime.Hide( true); // ilmeda
		
		myInfo.Init( data);
		
		body_CS_RANK_MYRANK_LOAD myRank = new body_CS_RANK_MYRANK_LOAD( eRANKTYPE.eRANKTYPE_ITEM);
		byte[] sendData = myRank.ClassToPacketBytes();
		AsNetworkMessageHandler.Instance.Send( sendData);

#if false
		WorldMaxPage = (Int16)( data.nWorldItemRankMaxCount / ItemsPerPage);
		if( 0 != ( data.nWorldItemRankMaxCount % ItemsPerPage))
			WorldMaxPage++;
		
		FriendMaxPage = (Int16)( data.nFriendItemRankMaxCount / ItemsPerPage);
		if( 0 != ( data.nFriendItemRankMaxCount % ItemsPerPage))
			FriendMaxPage++;
#endif

		_SetString_SubTitle( eType);

		//toggleBtn.Text = AsTableManager.Instance.GetTbl_String(1670);
		pageText.Text = "1/1";
		
		prevPage.SetControlState( UIButton.CONTROL_STATE.DISABLED);
		nextPage.SetControlState( UIButton.CONTROL_STATE.DISABLED);
	}
Exemplo n.º 3
0
	private void OnPvpWorldTab()
	{
		if( eRankViewType.PvpWorld == eType)
			return;
		
		AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false);
		
		eType = eRankViewType.PvpWorld;
		curPage = 0;
		
		toggleBtn.spriteText.color = Color.black;
		_SetString_SubTitle( eType);

        btnRewardLineup.gameObject.SetActive(false);

		pageText.Text = "1/1";
		prevPage.SetControlState( UIButton.CONTROL_STATE.DISABLED);
		nextPage.SetControlState( UIButton.CONTROL_STATE.DISABLED);
		toggleBtn.SetControlState( UIButton.CONTROL_STATE.NORMAL);
		
		body_CS_RANK_MYRANK_LOAD myRank = new body_CS_RANK_MYRANK_LOAD( eRANKTYPE.eRANKTYPE_ARENA);
		byte[] sendData = myRank.ClassToPacketBytes();
		AsNetworkMessageHandler.Instance.Send( sendData);
	}