OSDN Git Service

-Add RLV @FindFolder command support
[radegast/radegast.git] / Radegast / Core / ChatTextManager.cs
index 7305768..0053d1f 100644 (file)
@@ -1,6 +1,6 @@
 // 
 // Radegast Metaverse Client
-// Copyright (c) 2009-2012, Radegast Development Team
+// Copyright (c) 2009-2014, Radegast Development Team
 // All rights reserved.
 // 
 // Redistribution and use in source and binary forms, with or without
@@ -187,7 +187,15 @@ namespace Radegast
                         break;
                 }
 
-                textPrinter.PrintTextLine(item.From + item.Text);
+                if (item.Style == ChatBufferTextStyle.Normal && item.ID != UUID.Zero && instance.GlobalSettings["av_name_link"])
+                {
+                    textPrinter.InsertLink(item.From, string.Format("secondlife:///app/agent/{0}/about", item.ID));
+                    textPrinter.PrintTextLine(item.Text);
+                }
+                else
+                {
+                    textPrinter.PrintTextLine(item.From + item.Text);
+                }
             }
         }
 
@@ -230,6 +238,12 @@ namespace Radegast
                 null != client.Self.MuteList.Find(me => me.Type == MuteType.Resident && me.ID == e.SourceID)
                 ) return;
 
+            // Check if it's script debug
+            if (e.Type == ChatType.Debug && !instance.GlobalSettings["show_script_errors"])
+            {
+                return;
+            }
+
             // Check if sender object is muted
             if (e.SourceType == ChatSourceType.Object &&
                 null != client.Self.MuteList.Find(me =>
@@ -242,7 +256,9 @@ namespace Radegast
             {
                 instance.RLV.TryProcessCMD(e);
 #if !DEBUG
-                return;
+                if (!instance.RLV.EnabledDebugCommands) {
+                    return;
+                }
 #endif
             }
 
@@ -309,6 +325,10 @@ namespace Radegast
                     {
                         item.Style = ChatBufferTextStyle.OwnerSay;
                     }
+                    else if (e.Type == ChatType.Debug)
+                    {
+                        item.Style = ChatBufferTextStyle.Error;
+                    }
                     else
                     {
                         item.Style = ChatBufferTextStyle.ObjectChat;