void ChatReceived(object sender, ChatEventArgs e) { CpeMessage type = e.Type; if (type == CpeMessage.Normal) { chatIndex++; List <ChatLine> chat = game.Chat.Log; normalChat.PushUpAndReplaceLast(chat[chatIndex + chatLines - 1].Text); int[] metadata = (int[])Metadata; for (int i = 0; i < chatLines - 1; i++) { metadata[i] = metadata[i + 1]; } metadata[chatLines - 1] = chatIndex + chatLines - 1; } else if (type >= CpeMessage.Status1 && type <= CpeMessage.Status3) { status.SetText((int)(type - CpeMessage.Status1), e.Text); } else if (type >= CpeMessage.BottomRight1 && type <= CpeMessage.BottomRight3) { bottomRight.SetText(2 - (int)(type - CpeMessage.BottomRight1), e.Text); } else if (type == CpeMessage.Announcement) { UpdateAnnouncement(e.Text); } }
public void Add( string text, CpeMessage type ) { if( type == CpeMessage.Normal ) { Log.Add( text ); LogChatToFile( text ); } else if( type == CpeMessage.Status1 ) { Status1 = text; } else if( type == CpeMessage.Status2 ) { Status2 = text; } else if( type == CpeMessage.Status3 ) { Status3 = text; } else if( type == CpeMessage.BottomRight1 ) { BottomRight1 = text; } else if( type == CpeMessage.BottomRight2 ) { BottomRight2 = text; } else if( type == CpeMessage.BottomRight3 ) { BottomRight3 = text; } else if( type == CpeMessage.Announcement ) { Announcement = text; } game.Events.RaiseChatReceived( text, type ); }
public void Add(string text, CpeMessage type) { if (type == CpeMessage.Normal) { Log.Add(text); LogChatToFile(text); } else if (type == CpeMessage.Status1) { Status1 = text; } else if (type == CpeMessage.Status2) { Status2 = text; } else if (type == CpeMessage.Status3) { Status3 = text; } else if (type == CpeMessage.BottomRight1) { BottomRight1 = text; } else if (type == CpeMessage.BottomRight2) { BottomRight2 = text; } else if (type == CpeMessage.BottomRight3) { BottomRight3 = text; } else if (type == CpeMessage.Announcement) { Announcement = text; } game.Events.RaiseChatReceived(text, type); }
internal void RaiseChatReceived(string text, CpeMessage type) { chatArgs.Type = type; chatArgs.Text = text; Raise(ChatReceived, chatArgs); }