From 837f54f91bc8db5f2b74f7fba477327a85a4b72d Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Fri, 15 Apr 2011 16:03:24 +0000 Subject: [PATCH] Enable viewing attachments. Disable threaded texture download. git-svn-id: https://radegast.googlecode.com/svn/trunk@844 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- Radegast/GUI/Consoles/AttachmentDetail.Designer.cs | 17 +++++++++++++-- Radegast/GUI/Consoles/AttachmentDetail.cs | 25 ++++++++++++++++++++++ Radegast/GUI/Dialogs/PrimWorkshop.cs | 6 +++--- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/Radegast/GUI/Consoles/AttachmentDetail.Designer.cs b/Radegast/GUI/Consoles/AttachmentDetail.Designer.cs index 596b569..d727d47 100644 --- a/Radegast/GUI/Consoles/AttachmentDetail.Designer.cs +++ b/Radegast/GUI/Consoles/AttachmentDetail.Designer.cs @@ -65,6 +65,7 @@ namespace Radegast this.btnSave = new System.Windows.Forms.Button(); this.lblPrimCount = new System.Windows.Forms.Label(); this.lblAttachmentPoint = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lblAttachment @@ -118,10 +119,10 @@ namespace Radegast // // btnSave // - this.btnSave.Location = new System.Drawing.Point(87, 46); + this.btnSave.Location = new System.Drawing.Point(168, 44); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 2; + this.btnSave.TabIndex = 4; this.btnSave.Text = "Save..."; this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); @@ -144,11 +145,22 @@ namespace Radegast this.lblAttachmentPoint.TabIndex = 0; this.lblAttachmentPoint.Text = "Point"; // + // button1 + // + this.button1.Location = new System.Drawing.Point(87, 44); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 3; + this.button1.Text = "3D View"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // // AttachmentDetail // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.Controls.Add(this.button1); this.Controls.Add(this.lblPrimCount); this.Controls.Add(this.btnSave); this.Controls.Add(this.btnTouch); @@ -175,6 +187,7 @@ namespace Radegast public System.Windows.Forms.Button btnSave; public System.Windows.Forms.Label lblPrimCount; public System.Windows.Forms.Label lblAttachmentPoint; + private System.Windows.Forms.Button button1; } } diff --git a/Radegast/GUI/Consoles/AttachmentDetail.cs b/Radegast/GUI/Consoles/AttachmentDetail.cs index f5fc131..438cd98 100644 --- a/Radegast/GUI/Consoles/AttachmentDetail.cs +++ b/Radegast/GUI/Consoles/AttachmentDetail.cs @@ -154,5 +154,30 @@ namespace Radegast } } + + private void button1_Click(object sender, EventArgs e) + { + var prims = instance.Client.Network.CurrentSim.ObjectsPrimitives.FindAll((Primitive p) => p.ParentID == attachment.LocalID || p.LocalID == attachment.LocalID); + var root = prims.Find((Primitive p) => p.LocalID == attachment.LocalID); + if (root != null) + { + prims.Remove(root); + root = new Primitive(root); + root.ParentID = 0; + + frmPrimWorkshop pw = new frmPrimWorkshop(instance); + pw.Shown += (xsender, xe) => + { + Thread.Sleep(500); + pw.SetupGLControl(); + if (pw.RenderingEnabled) + { + pw.loadPrims(prims); + } + }; + pw.Show(); + + } + } } } diff --git a/Radegast/GUI/Dialogs/PrimWorkshop.cs b/Radegast/GUI/Dialogs/PrimWorkshop.cs index 5b835bf..1a573d7 100644 --- a/Radegast/GUI/Dialogs/PrimWorkshop.cs +++ b/Radegast/GUI/Dialogs/PrimWorkshop.cs @@ -636,8 +636,8 @@ namespace Radegast data.TexCoords[k * 2 + 1] = face.Vertices[k].TexCoord.Y; } - ThreadPool.QueueUserWorkItem(sync => - { + //ThreadPool.QueueUserWorkItem(sync => + // { // Texture for this face if (LoadTexture(teFace.TextureID, ref data.Texture, false)) { @@ -695,7 +695,7 @@ namespace Radegast )); } } - }); + //}); // Set the UserData for this face to our FaceData struct face.UserData = data; -- 2.11.0