/// <summary>
/// Display an IM message in its currently open window. If there is no window, this will create a new one.
/// </summary>
public void PassMessage(MessageAuthor Sender, string Message)
{
UIMessageGroup group = GetMessageGroup(Sender.Author, UIMessageType.IM);
if (group == null)
{
group = new UIMessageGroup(UIMessageType.IM, Sender, this);
MessageWindows.Add(group);
this.Add(group);
ReorderIcons();
group.Show(null);
if (Message != null)
{
HITVM.Get().PlaySoundEvent(UISounds.CallRecieveFirst);
}
}
else
{
HITVM.Get().PlaySoundEvent((soundAlt) ? UISounds.CallRecieve : UISounds.CallRecieveNext);
soundAlt = !soundAlt;
}
if (Message != null)
{
group.AddMessage(Message);
}
}