Example #1
0
 public ChatBufferItem(DateTime timestamp, string from, UUID id, string text, ChatBufferTextStyle style)
 {
     this.timestamp = timestamp;
     this.from = from;
     this.id = id;
     this.text = text;
     this.style = style;
 }
 public ChatBufferItem(DateTime timestamp, string text, ChatBufferTextStyle style)
 {
     this.timestamp = timestamp;
     this.text = text;
     this.style = style;
 }
Example #3
0
 public ChatNotificationEventArgs(string message, ChatBufferTextStyle style)
 {
     Message = message;
     Style = style;
 }
Example #4
0
        /// <summary>
        /// Displays notification in the main chat tab
        /// </summary>
        /// <param name="msg">Message to be printed in the chat tab</param>
        /// <param name="style">Style of the message to be printed, normal, object, etc.</param>
        /// <param name="highlightChatTab">Highligt (and flash in taskbar) chat tab if not selected</param>
        public void DisplayNotificationInChat(string msg, ChatBufferTextStyle style, bool highlightChatTab)
        {
            if (InvokeRequired)
            {
                if (!instance.MonoRuntime || IsHandleCreated)
                    BeginInvoke(new MethodInvoker(() => DisplayNotificationInChat(msg, style, highlightChatTab)));
                return;
            }

            if (style != ChatBufferTextStyle.Invisible)
            {
                ChatBufferItem line = new ChatBufferItem(
                    DateTime.Now,
                    string.Empty,
                    UUID.Zero,
                    msg,
                    style
                );

                try
                {
                    mainChatManger.ProcessBufferItem(line, true);
                    if (highlightChatTab)
                    {
                        tabs["chat"].Highlight();
                    }
                }
                catch (Exception) { }
            }

            if (OnChatNotification != null)
            {
                try { OnChatNotification(this, new ChatNotificationEventArgs(msg, style)); }
                catch { }
            }
        }
Example #5
0
 /// <summary>
 /// Displays notification in the main chat tab
 /// </summary>
 /// <param name="msg">Message to be printed in the chat tab</param>
 /// <param name="style">Style of the message to be printed, normal, object, etc.</param>
 public void DisplayNotificationInChat(string msg, ChatBufferTextStyle style)
 {
     DisplayNotificationInChat(msg, style, true);
 }
Example #6
0
        public static OpenTK.Graphics.Color4 GetColorForStyle(ChatBufferTextStyle style)
        {
            switch (style)
            {
                case ChatBufferTextStyle.StatusBlue:
                    return new OpenTK.Graphics.Color4(0.2f, 0.2f, 1f, 1f);
                case ChatBufferTextStyle.StatusDarkBlue:
                    return new OpenTK.Graphics.Color4(0f, 0f, 1f, 1f);
                case ChatBufferTextStyle.ObjectChat:
                    return new OpenTK.Graphics.Color4(0.7f, 0.9f, 0.7f, 1f);
                case ChatBufferTextStyle.OwnerSay:
                    return new OpenTK.Graphics.Color4(0.99f, 0.99f, 0.69f, 1f);
                case ChatBufferTextStyle.Alert:
                    return new OpenTK.Graphics.Color4(0.8f, 1f, 1f, 1f);
                case ChatBufferTextStyle.Error:
                    return new OpenTK.Graphics.Color4(0.82f, 0.27f, 0.27f, 1f);

                default:
                    return new OpenTK.Graphics.Color4(1f, 1f, 1f, 1f);

            }
        }