Exemplo n.º 1
0
	private void ActivateChatList( eCHATTYPE type, UIListItem chatItem, bool isMe)
	{
		if( CHAT_FILTER_TYPE.General != filterType)
		{
			if( CHAT_FILTER_TYPE.None != filterType)
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					chatItem.gameObject.SetActiveRecursively( false);
					break;
				default:
					break;
				}
			}
		}
		else
		{
			if( false == isMe)
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					break;
				}
			}
			else
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					break;
				}
			}
		}
	}
Exemplo n.º 2
0
	public body_CS_CHAT_MESSAGE(string chat, eCHATTYPE type, bool useFiltering = true, int slotIndex = 0)
	{
		Category = (byte)PACKET_CATEGORY._CATEGORY_CS;
		switch( type)
		{
		case eCHATTYPE.eCHATTYPE_MAP:
			Protocol = (byte)PROTOCOL_CS.CS_CHAT_MAP;
			break;
		case eCHATTYPE.eCHATTYPE_PUBLIC:
			Protocol = (byte)PROTOCOL_CS.CS_CHAT_LOCAL;
			break;
		case eCHATTYPE.eCHATTYPE_SERVER:
			Protocol = (byte)PROTOCOL_CS.CS_CHAT_WORLD;
			break;
		case eCHATTYPE.eCHATTYPE_PARTY:
			Protocol = (byte)PROTOCOL_CS.CS_CHAT_PARTY;
			break;
		case eCHATTYPE.eCHATTYPE_GUILD:
			Protocol = (byte)PROTOCOL_CS.CS_CHAT_GUILD;
			break;
		}
		bUseFiltering = useFiltering;
		pMsg = System.Text.UTF8Encoding.UTF8.GetBytes( chat);
		nMsgLen = (Int16)pMsg.Length;
		nSlotIndex = slotIndex;
	}
Exemplo n.º 3
0
	public void InsertSystemChat( string msg, eCHATTYPE type=eCHATTYPE.eCHATTYPE_PUBLIC, bool isMe=false)
	{
		UIScrollList destList = allList;
		m_nScroll = 0;
		
		NewMsgAlarm( type, isMe);
		
		switch( type)
		{
		case eCHATTYPE.eCHATTYPE_PUBLIC:
			//
			chatBuff_normal.Add( msg);
			if( chatBuff_normal.Count > MAX_CHAT_HISTORY)
				chatBuff_normal.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_normal[chatBuff_normal.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_PRIVATE:
			string[] tokens = msg.Split( TOKEN_SPLIT);
			latestWhisperer = tokens[1];
			//
			chatBuff_whisper.Add( msg);
			if( chatBuff_whisper.Count > MAX_CHAT_HISTORY)
				chatBuff_whisper.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_whisper[chatBuff_whisper.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_PARTY:
			//
			chatBuff_party.Add( msg);
			if( chatBuff_party.Count > MAX_CHAT_HISTORY)
				chatBuff_party.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_party[chatBuff_party.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_GUILD:
			//
			chatBuff_guild.Add( msg);
			if( chatBuff_guild.Count > MAX_CHAT_HISTORY)
				chatBuff_guild.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_guild[chatBuff_guild.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_MAP:
			//
			chatBuff_normal.Add( msg);
			if( chatBuff_normal.Count > MAX_CHAT_HISTORY)
				chatBuff_normal.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_normal[chatBuff_normal.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SERVER:
			//
			chatBuff_normal.Add( msg);
			if( chatBuff_normal.Count > MAX_CHAT_HISTORY)
				chatBuff_normal.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_normal[chatBuff_normal.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM:
			//
			chatBuff_system.Add( msg);
			if( chatBuff_system.Count > MAX_CHAT_HISTORY)
				chatBuff_system.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_system[chatBuff_system.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM_ITEM:
			//
			chatBuff_system.Add( msg);
			if( chatBuff_system.Count > MAX_CHAT_HISTORY)
				chatBuff_system.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_system[chatBuff_system.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM_QUEST:
			//
			chatBuff_system.Add( msg);
			if( chatBuff_system.Count > MAX_CHAT_HISTORY)
				chatBuff_system.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_system[chatBuff_system.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		default:
			Debug.LogWarning( "Invalid chatting type");
			destList = null;
			break;
		}

		chatBuff_all.Add( msg);
		if( chatBuff_all.Count > MAX_CHAT_HISTORY)
			chatBuff_all.RemoveAt( 0);
		for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
		{
			UIListItem chatItem = destList.GetItem( i) as UIListItem;
			chatItem.Text = chatBuff_all[chatBuff_all.Count - MAX_CHAT_SHOWLIST + i];
			ActivateChatList( type, chatItem, isMe);
		}
	}
Exemplo n.º 4
0
	public void InsertChat( string msg, eCHATTYPE type=eCHATTYPE.eCHATTYPE_PUBLIC, bool isMe=false, bool useFiltering = true)
	{
//		if( msg.IndexOf( '[') < msg.IndexOf( ']') && msg.IndexOf( ']') < msg.IndexOf( ':') && msg.IndexOf( ':') < msg.IndexOf( '/'))
//			return;
		
		if( msg.IndexOf(':') + 2 == msg.IndexOf( '/'))
			return;

		UIScrollList destList = allList;
		m_nScroll = 0;
		
		NewMsgAlarm( type, isMe);
		
		Color strColor = AsChatManager.Instance.m_Color_All;
		switch( type)
		{
		case eCHATTYPE.eCHATTYPE_PUBLIC:
			strColor = AsChatManager.Instance.m_Color_All;
			//
			chatBuff_normal.Add( msg);
			if( chatBuff_normal.Count > MAX_CHAT_HISTORY)
				chatBuff_normal.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_normal[chatBuff_normal.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_PRIVATE:
			strColor = AsChatManager.Instance.m_Color_Whisper;
			string[] tokens = msg.Split( TOKEN_SPLIT);
			latestWhisperer = tokens[1];
			//
			chatBuff_whisper.Add( msg);
			if( chatBuff_whisper.Count > MAX_CHAT_HISTORY)
				chatBuff_whisper.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_whisper[chatBuff_whisper.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_PARTY:
			strColor = AsChatManager.Instance.m_Color_Party;
			//
			chatBuff_party.Add( msg);
			if( chatBuff_party.Count > MAX_CHAT_HISTORY)
				chatBuff_party.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_party[chatBuff_party.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_GUILD:
			strColor = AsChatManager.Instance.m_Color_Guild;
			//
			chatBuff_guild.Add( msg);
			if( chatBuff_guild.Count > MAX_CHAT_HISTORY)
				chatBuff_guild.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_guild[chatBuff_guild.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_MAP:
			strColor = new Color( 0.85f, 0.07f, 0.0f, 1.0f);
			//
			chatBuff_normal.Add( msg);
			if( chatBuff_normal.Count > MAX_CHAT_HISTORY)
				chatBuff_normal.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_normal[chatBuff_normal.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SERVER:
			strColor = new Color( 0.5f, 0.0f, 1.0f, 1.0f);
			//
			chatBuff_normal.Add( msg);
			if( chatBuff_normal.Count > MAX_CHAT_HISTORY)
				chatBuff_normal.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_normal[chatBuff_normal.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM:
			strColor = AsChatManager.Instance.m_Color_System;
			//
			chatBuff_system.Add( msg);
			if( chatBuff_system.Count > MAX_CHAT_HISTORY)
				chatBuff_system.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_system[chatBuff_system.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM_ITEM:
			strColor = new Color( 1.0f, 0.6f, 0.6f, 1.0f);
			//
			chatBuff_system.Add( msg);
			if( chatBuff_system.Count > MAX_CHAT_HISTORY)
				chatBuff_system.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_system[chatBuff_system.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM_QUEST:
			strColor = new Color( 0.6f, 0.6f, 1.0f, 1.0f);
			//
			chatBuff_system.Add( msg);
			if( chatBuff_system.Count > MAX_CHAT_HISTORY)
				chatBuff_system.RemoveAt( 0);
			for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
			{
				UIListItem chatItem = destList.GetItem( i) as UIListItem;
				chatItem.Text = chatBuff_system[chatBuff_system.Count - MAX_CHAT_SHOWLIST + i];
				ActivateChatList( type, chatItem, isMe);
			}
			//
			break;
		default:
			Debug.LogWarning( "Invalid chatting type");
			destList = null;
			break;
		}

		chatBuff_all.Add( msg);
		if( chatBuff_all.Count > MAX_CHAT_HISTORY)
			chatBuff_all.RemoveAt( 0);
		for( int i = 0; i < MAX_CHAT_SHOWLIST; i++)
		{
			UIListItem chatItem = destList.GetItem( i) as UIListItem;
			chatItem.Text = chatBuff_all[chatBuff_all.Count - MAX_CHAT_SHOWLIST + i];
			ActivateChatList( type, chatItem, isMe);
		}
			
		_InitScroll();			
	}
Exemplo n.º 5
0
	public void ShowChatBalloon( UInt32 uniqueIdx, string msg, eCHATTYPE type, bool useFiltering = true)
	{
		if( msg.IndexOf( '/') == 0)
		{
			AsEmotionManager.Instance.SystemProcess( uniqueIdx, msg);
			return;
		}
		
		AsUserEntity entity = AsEntityManager.Instance.GetUserEntityByUniqueId( uniqueIdx);
		if( null == entity)
			return;
		
		string colorTag = "RGBA( 0, 0, 0, 1.0)";
		switch( type)
		{
		case eCHATTYPE.eCHATTYPE_PUBLIC:
			colorTag = AsChatManager.Instance.m_Color_All.ToString();
			break;
		case eCHATTYPE.eCHATTYPE_PRIVATE:
			colorTag = AsChatManager.Instance.m_Color_Whisper.ToString();
			break;
		case eCHATTYPE.eCHATTYPE_PARTY:
			colorTag = AsChatManager.Instance.m_Color_Party.ToString();
			break;
		case eCHATTYPE.eCHATTYPE_GUILD:
			colorTag = AsChatManager.Instance.m_Color_Guild.ToString();
			break;
		case eCHATTYPE.eCHATTYPE_MAP:
			colorTag = AsChatManager.Instance.m_Color_Map.ToString();
			break;
		case eCHATTYPE.eCHATTYPE_SERVER:
			colorTag = AsChatManager.Instance.m_Color_World.ToString();
			break;
		case eCHATTYPE.eCHATTYPE_SYSTEM:
			colorTag = AsChatManager.Instance.m_Color_System.ToString();
			break;
		default:
			Debug.LogWarning( "Invalid chatting type");
			break;
		}
		
		//$yde - 20130108
		if (useFiltering == true)
			msg = AsTableManager.Instance.TextFiltering_Balloon( msg);
		
		entity.AddChatBalloon( chatBalloon, colorTag + msg);
	}
Exemplo n.º 6
0
	private void NewMsgAlarm( eCHATTYPE type, bool isMe)
	{
		if( false == gameObject.active)
			return;
		
		switch( filterType)
		{
		case CHAT_FILTER_TYPE.General:
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PRIVATE:
					news[ (int)CHAT_FILTER_TYPE.Whisper].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PARTY:
					news[ (int)CHAT_FILTER_TYPE.Party].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_GUILD:
					news[ (int)CHAT_FILTER_TYPE.Guild].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_SYSTEM:
					news[ (int)CHAT_FILTER_TYPE.System].NewMsgExist = true;
					break;
				}
			}
			break;
		case CHAT_FILTER_TYPE.Party:
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					if( true == isMe)
						break;
					news[ (int)CHAT_FILTER_TYPE.General].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PRIVATE:
					news[ (int)CHAT_FILTER_TYPE.Whisper].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_GUILD:
					news[ (int)CHAT_FILTER_TYPE.Guild].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_SYSTEM:
					news[ (int)CHAT_FILTER_TYPE.System].NewMsgExist = true;
					break;
				}
			}
			break;
		case CHAT_FILTER_TYPE.Guild:
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					if( true == isMe)
						break;
					news[ (int)CHAT_FILTER_TYPE.General].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PARTY:
					news[ (int)CHAT_FILTER_TYPE.Party].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PRIVATE:
					news[ (int)CHAT_FILTER_TYPE.Whisper].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_SYSTEM:
					news[ (int)CHAT_FILTER_TYPE.System].NewMsgExist = true;
					break;
				}
			}
			break;
		case CHAT_FILTER_TYPE.Whisper:
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					if( true == isMe)
						break;
					news[ (int)CHAT_FILTER_TYPE.General].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PARTY:
					news[ (int)CHAT_FILTER_TYPE.Party].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_GUILD:
					news[ (int)CHAT_FILTER_TYPE.Guild].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_SYSTEM:
					news[ (int)CHAT_FILTER_TYPE.System].NewMsgExist = true;
					break;
				}
			}
			break;
		case CHAT_FILTER_TYPE.System:
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					if( true == isMe)
						break;
					news[ (int)CHAT_FILTER_TYPE.General].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PARTY:
					news[ (int)CHAT_FILTER_TYPE.Party].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_GUILD:
					news[ (int)CHAT_FILTER_TYPE.Guild].NewMsgExist = true;
					break;
				case eCHATTYPE.eCHATTYPE_PRIVATE:
					news[ (int)CHAT_FILTER_TYPE.Whisper].NewMsgExist = true;
					break;
				}
			}
			break;
		}
	}
Exemplo n.º 7
0
	public void ShowChatBalloon( UInt32 uniqueIdx, string msg, eCHATTYPE type, bool useFiltering = true)
	{
		AsChatFullPanel.Instance.ShowChatBalloon( uniqueIdx, msg, type, useFiltering);
	}
Exemplo n.º 8
0
	private void ActivateChatList( eCHATTYPE type, UIListItem chatItem, bool isMe)
	{
		if( CHAT_FILTER_TYPE.General != filterType)
		{
			if( CHAT_FILTER_TYPE.None != filterType)
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					chatItem.gameObject.SetActiveRecursively( false);
					break;
				default:
					StartModifyTransparency();
					break;
				}
			}
			else
				StartModifyTransparency();
		}
		else
		{
			if( false == isMe)
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					chatItem.spriteText.Color = new Color( 1.0f, 1.0f, 1.0f, bgColor.a);
					break;
				}
			}
			else
			{
				switch( type)
				{
				case eCHATTYPE.eCHATTYPE_PUBLIC:
				case eCHATTYPE.eCHATTYPE_MAP:
				case eCHATTYPE.eCHATTYPE_SERVER:
					StartModifyTransparency();
					break;
				}
			}
		}
	}
Exemplo n.º 9
0
	//end kij
	
	/*
	public void InsertChat( string msg, eCHATTYPE type=eCHATTYPE.eCHATTYPE_PUBLIC, bool isMe=false, bool useFiltering = true)
	{
		if( msg.IndexOf('[') < msg.IndexOf(']') && msg.IndexOf(']') < msg.IndexOf(':') && msg.IndexOf(':') < msg.IndexOf('/'))
			return;

		if( MAX_CHAT_HISTORY <= allList.Count)
			allList.RemoveItem( 0, true);

		UIListItem chatItem = allList.CreateItem( chatListItem) as UIListItem;
		chatItem.collider.enabled = false;
		chatItem.transform.localPosition = new Vector3( -allList.viewableArea.x * 0.5f, chatItem.transform.localPosition.y, chatItem.transform.localPosition.z);
		chatItem.SetSize( allList.viewableArea.x, 1.0f);
		chatItem.spriteText.maxWidth = background.center.PixelSize.x - m_btnChatFull.PixelSize.x;
		chatItem.UpdateCamera();

		if (useFiltering == true)
			msg = AsTableManager.Instance.TextFiltering_Chat(msg);

		m_sbInsertSystemChatTemp.Remove( 0, m_sbInsertSystemChatTemp.Length);
		m_sbInsertSystemChatTemp.Append( GetChatTypeColor( type));
		m_sbInsertSystemChatTemp.Append( msg);

		chatItem.Text = m_sbInsertSystemChatTemp.ToString();
		ActivateChatList( type, chatItem, isMe);
		allList.ScrollListTo( 1.0f);
		allList.UpdateCamera();

		AsChatFullPanel.Instance.InsertChat( msg, type, isMe, useFiltering);
	}
	*/

	public void InsertChat( string msg, eCHATTYPE type=eCHATTYPE.eCHATTYPE_PUBLIC, bool isMe=false, bool useFiltering = true)
	{
//		if( msg.IndexOf('[') < msg.IndexOf(']') && msg.IndexOf(']') < msg.IndexOf(':') && msg.IndexOf(':') < msg.IndexOf('/'))
//			return;
		
		if( msg.IndexOf(':') + 2 == msg.IndexOf( '/'))
			return;
		
		if (useFiltering == true)
			msg = AsTableManager.Instance.TextFiltering_Chat(msg);

		m_sbInsertSystemChatTemp.Remove( 0, m_sbInsertSystemChatTemp.Length);
		m_sbInsertSystemChatTemp.Append( GetChatTypeColor( type));
		m_sbInsertSystemChatTemp.Append( msg);

		chatBuff.Add( m_sbInsertSystemChatTemp.ToString());
		
		if( chatBuff.Count > MAX_CHAT_HISTORY)
			chatBuff.RemoveAt( 0);
		
		for( int i = 0; i < MAX_CHAT_HISTORY - 1; i++)
		{
			UIListItem chatItemBuff = allList.GetItem( i) as UIListItem;
			chatItemBuff.Text = chatBuff[i];
		}
		
		UIListItem chatItem = allList.GetItem( MAX_CHAT_HISTORY - 1) as UIListItem;

		chatItem.Text = m_sbInsertSystemChatTemp.ToString();
		ActivateChatList( type, chatItem, isMe);
		allList.ScrollListTo( 1.0f);
		allList.UpdateCamera();

		AsChatFullPanel.Instance.InsertChat( m_sbInsertSystemChatTemp.ToString(), type, isMe, useFiltering);
	}
Exemplo n.º 10
0
	public Color GetChatTypeColor( eCHATTYPE type)
	{
		switch( type)
		{
		case eCHATTYPE.eCHATTYPE_PUBLIC:	return m_Color_All;
		case eCHATTYPE.eCHATTYPE_PRIVATE:	return m_Color_Whisper;
		case eCHATTYPE.eCHATTYPE_PARTY:	return m_Color_Party;
		case eCHATTYPE.eCHATTYPE_GUILD:	return m_Color_Guild;
		case eCHATTYPE.eCHATTYPE_MAP:	return m_Color_Map;
		case eCHATTYPE.eCHATTYPE_SERVER:	return m_Color_World;
		case eCHATTYPE.eCHATTYPE_SYSTEM:	return m_Color_System;
		case eCHATTYPE.eCHATTYPE_SYSTEM_ITEM:	return m_Color_System_Item;
		case eCHATTYPE.eCHATTYPE_SYSTEM_QUEST:	return m_Color_System_Quest;
		default:
			Debug.LogWarning( "Invalid chatting type");
			break;
		}

		return m_Color_All;
	}
Exemplo n.º 11
0
	/*
	public void InsertSystemChat( string msg, eCHATTYPE type=eCHATTYPE.eCHATTYPE_PUBLIC, bool isMe=false)
	{
		UIListItem chatItem = allList.CreateItem( chatListItem) as UIListItem;
		chatItem.collider.enabled = false;
		chatItem.transform.localPosition = new Vector3( -allList.viewableArea.x * 0.5f, chatItem.transform.localPosition.y, chatItem.transform.localPosition.z);
		chatItem.SetSize( allList.viewableArea.x, 1.0f);
		chatItem.spriteText.maxWidth = background.center.PixelSize.x - m_btnChatFull.PixelSize.x;
		chatItem.UpdateCamera();

		m_sbInsertSystemChatTemp.Remove( 0, m_sbInsertSystemChatTemp.Length);
		m_sbInsertSystemChatTemp.Append( GetChatTypeColor( type));
		m_sbInsertSystemChatTemp.Append( msg);

		chatItem.Text = m_sbInsertSystemChatTemp.ToString();
		ActivateChatList( type, chatItem, isMe);
		allList.ScrollListTo( 1.0f);
		allList.UpdateCamera();

		AsChatFullPanel.Instance.InsertSystemChat( m_sbInsertSystemChatTemp.ToString(), type, isMe);
	}
	*/
	public void InsertSystemChat( string msg, eCHATTYPE type=eCHATTYPE.eCHATTYPE_PUBLIC, bool isMe=false)
	{
		m_sbInsertSystemChatTemp.Remove( 0, m_sbInsertSystemChatTemp.Length);
		m_sbInsertSystemChatTemp.Append( GetChatTypeColor( type));
		m_sbInsertSystemChatTemp.Append( msg);

		chatBuff.Add( m_sbInsertSystemChatTemp.ToString());
		
		if( chatBuff.Count > MAX_CHAT_HISTORY)
			chatBuff.RemoveAt( 0);

		for( int i = 0; i < MAX_CHAT_HISTORY - 1; i++)
		{
			UIListItem chatItemBuff = allList.GetItem( i) as UIListItem;
			chatItemBuff.Text = chatBuff[i];
		}
		
		UIListItem chatItem = allList.GetItem( MAX_CHAT_HISTORY - 1) as UIListItem;

		chatItem.Text = m_sbInsertSystemChatTemp.ToString();
		ActivateChatList( type, chatItem, isMe);
		allList.ScrollListTo( 1.0f);
		allList.UpdateCamera();

		AsChatFullPanel.Instance.InsertSystemChat( m_sbInsertSystemChatTemp.ToString(), type, isMe);
	}