OSDN Git Service

RAD-322 RAD-409: Add ability to show/hide script errors in the main chat console
authorLatif Khalifa <latifer@streamgrid.net>
Mon, 4 Mar 2013 16:47:38 +0000 (17:47 +0100)
committerLatif Khalifa <latifer@streamgrid.net>
Mon, 4 Mar 2013 16:47:38 +0000 (17:47 +0100)
Radegast/Core/ChatTextManager.cs
Radegast/GUI/Dialogs/Settings.Designer.cs
Radegast/GUI/Dialogs/Settings.cs

index 72898a9..87809e3 100644 (file)
@@ -238,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 =>
@@ -317,6 +323,10 @@ namespace Radegast
                     {
                         item.Style = ChatBufferTextStyle.OwnerSay;
                     }
+                    else if (e.Type == ChatType.Debug)
+                    {
+                        item.Style = ChatBufferTextStyle.Error;
+                    }
                     else
                     {
                         item.Style = ChatBufferTextStyle.ObjectChat;
index f01f44a..831637f 100644 (file)
@@ -128,6 +128,7 @@ namespace Radegast
             this.autoSitUUID = new System.Windows.Forms.TextBox();
             this.autoSitName = new System.Windows.Forms.TextBox();
             this.autoSitNameLabel = new System.Windows.Forms.Label();
+            this.cbShowScriptErrors = new System.Windows.Forms.CheckBox();
             this.tcGraphics.SuspendLayout();
             this.tbpGeneral.SuspendLayout();
             this.cbHighLight.SuspendLayout();
@@ -239,6 +240,7 @@ namespace Radegast
             // 
             // cbMisc
             // 
+            this.cbMisc.Controls.Add(this.cbShowScriptErrors);
             this.cbMisc.Controls.Add(this.cbDisableHTTPInventory);
             this.cbMisc.Controls.Add(this.cbHideLoginGraphics);
             this.cbMisc.Controls.Add(this.cbDisableLookAt);
@@ -934,6 +936,16 @@ namespace Radegast
             this.autoSitNameLabel.Text = "Name";
             this.autoSitNameLabel.Click += new System.EventHandler(this.autoSitNameLabel_Click);
             // 
+            // cbShowScriptErrors
+            // 
+            this.cbShowScriptErrors.AutoSize = true;
+            this.cbShowScriptErrors.Location = new System.Drawing.Point(6, 280);
+            this.cbShowScriptErrors.Name = "cbShowScriptErrors";
+            this.cbShowScriptErrors.Size = new System.Drawing.Size(110, 17);
+            this.cbShowScriptErrors.TabIndex = 17;
+            this.cbShowScriptErrors.Text = "Show Script Erros";
+            this.cbShowScriptErrors.UseVisualStyleBackColor = true;
+            // 
             // frmSettings
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1041,6 +1053,7 @@ namespace Radegast
         public System.Windows.Forms.Label lblLSLUUID;
         public System.Windows.Forms.TextBox tbLSLAllowedOwner;
         private System.Windows.Forms.Label label3;
+        public System.Windows.Forms.CheckBox cbShowScriptErrors;
 
 
     }
index e7587c0..2d8fde4 100644 (file)
@@ -309,6 +309,11 @@ namespace Radegast
                 s["disable_http_inventory"] = cbDisableHTTPInventory.Checked;
             };
 
+            cbShowScriptErrors.Checked = s["show_script_errors"];
+            cbShowScriptErrors.CheckedChanged += (sender, e) =>
+            {
+                s["show_script_errors"] = cbShowScriptErrors.Checked;
+            };
 
             autoSitPrefsUpdate();
             pseudoHomePrefsUpdated();