OSDN Git Service

improved error handling when rezz failed
authorole1986 <ole.k@web.de>
Tue, 22 Jul 2014 13:20:22 +0000 (15:20 +0200)
committerole1986 <ole.k@web.de>
Tue, 22 Jul 2014 13:20:22 +0000 (15:20 +0200)
provide ObjectName when building a new prim
get and set position to the prim
fixed save procedure, now properties are being stored once you press save

plugins/Radegast.Plugin.SimpleBuilder/SimpleBuilder.Designer.cs
plugins/Radegast.Plugin.SimpleBuilder/SimpleBuilder.cs

index f492ea7..066fdb7 100644 (file)
             this.button5 = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
-            this.tbox_Size = new System.Windows.Forms.TextBox();
-            this.tbox_Distance = new System.Windows.Forms.TextBox();
             this.lstPrims = new Radegast.ListViewNoFlicker();
             this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.groupTransform = new System.Windows.Forms.GroupBox();
+            this.posZ = new System.Windows.Forms.NumericUpDown();
+            this.posY = new System.Windows.Forms.NumericUpDown();
+            this.posX = new System.Windows.Forms.NumericUpDown();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
             this.btnSave = new System.Windows.Forms.Button();
             this.label5 = new System.Windows.Forms.Label();
             this.rotZ = new System.Windows.Forms.NumericUpDown();
             this.label3 = new System.Windows.Forms.Label();
             this.numRadius = new System.Windows.Forms.NumericUpDown();
             this.button7 = new System.Windows.Forms.Button();
-            this.groupBox1.SuspendLayout();
+            this.tbox_Distance = new System.Windows.Forms.NumericUpDown();
+            this.tbox_Size = new System.Windows.Forms.NumericUpDown();
+            this.label10 = new System.Windows.Forms.Label();
+            this.lblVersion = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.txt_ObjectName = new System.Windows.Forms.TextBox();
+            this.groupTransform.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.posZ)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.posY)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.posX)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.rotZ)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.rotY)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.rotX)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.scaleY)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.scaleX)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.numRadius)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbox_Distance)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbox_Size)).BeginInit();
             this.SuspendLayout();
             // 
             // btnBuildBox
             // 
-            this.btnBuildBox.Location = new System.Drawing.Point(18, 17);
+            this.btnBuildBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.btnBuildBox.Location = new System.Drawing.Point(17, 73);
             this.btnBuildBox.Name = "btnBuildBox";
             this.btnBuildBox.Size = new System.Drawing.Size(159, 23);
             this.btnBuildBox.TabIndex = 0;
@@ -76,7 +93,8 @@
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(213, 17);
+            this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.button1.Location = new System.Drawing.Point(212, 73);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(159, 23);
             this.button1.TabIndex = 1;
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(213, 46);
+            this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.button2.Location = new System.Drawing.Point(212, 102);
             this.button2.Name = "button2";
             this.button2.Size = new System.Drawing.Size(159, 23);
             this.button2.TabIndex = 2;
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(213, 75);
+            this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.button3.Location = new System.Drawing.Point(212, 131);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(159, 23);
             this.button3.TabIndex = 3;
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(18, 75);
+            this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.button4.Location = new System.Drawing.Point(17, 131);
             this.button4.Name = "button4";
             this.button4.Size = new System.Drawing.Size(159, 23);
             this.button4.TabIndex = 4;
             // 
             // button5
             // 
-            this.button5.Location = new System.Drawing.Point(18, 46);
+            this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.button5.Location = new System.Drawing.Point(17, 102);
             this.button5.Name = "button5";
             this.button5.Size = new System.Drawing.Size(159, 23);
             this.button5.TabIndex = 5;
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(210, 113);
+            this.label1.Location = new System.Drawing.Point(209, 169);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(27, 13);
+            this.label1.Size = new System.Drawing.Size(54, 13);
             this.label1.TabIndex = 6;
-            this.label1.Text = "Size";
+            this.label1.Text = "Initial Size";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(15, 113);
+            this.label2.Location = new System.Drawing.Point(14, 171);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(49, 13);
+            this.label2.Size = new System.Drawing.Size(76, 13);
             this.label2.TabIndex = 8;
-            this.label2.Text = "Distance";
-            // 
-            // tbox_Size
-            // 
-            this.tbox_Size.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.tbox_Size.Location = new System.Drawing.Point(313, 113);
-            this.tbox_Size.MaxLength = 5;
-            this.tbox_Size.Name = "tbox_Size";
-            this.tbox_Size.Size = new System.Drawing.Size(59, 20);
-            this.tbox_Size.TabIndex = 10;
-            this.tbox_Size.Text = "0.500";
-            // 
-            // tbox_Distance
-            // 
-            this.tbox_Distance.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.tbox_Distance.Location = new System.Drawing.Point(118, 113);
-            this.tbox_Distance.MaxLength = 5;
-            this.tbox_Distance.Name = "tbox_Distance";
-            this.tbox_Distance.Size = new System.Drawing.Size(59, 20);
-            this.tbox_Distance.TabIndex = 11;
-            this.tbox_Distance.Text = "1.000";
+            this.label2.Text = "Initial Distance";
             // 
             // lstPrims
             // 
             this.lstPrims.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
             this.lstPrims.HideSelection = false;
             this.lstPrims.LabelWrap = false;
-            this.lstPrims.Location = new System.Drawing.Point(392, 43);
+            this.lstPrims.Location = new System.Drawing.Point(391, 71);
             this.lstPrims.MultiSelect = false;
             this.lstPrims.Name = "lstPrims";
             this.lstPrims.ShowGroups = false;
-            this.lstPrims.Size = new System.Drawing.Size(274, 262);
+            this.lstPrims.Size = new System.Drawing.Size(274, 292);
             this.lstPrims.TabIndex = 12;
             this.lstPrims.UseCompatibleStateImageBehavior = false;
             this.lstPrims.View = System.Windows.Forms.View.Details;
             // 
             this.columnHeader1.Width = 270;
             // 
-            // groupBox1
-            // 
-            this.groupBox1.Controls.Add(this.btnSave);
-            this.groupBox1.Controls.Add(this.label5);
-            this.groupBox1.Controls.Add(this.rotZ);
-            this.groupBox1.Controls.Add(this.rotY);
-            this.groupBox1.Controls.Add(this.rotX);
-            this.groupBox1.Controls.Add(this.label4);
-            this.groupBox1.Controls.Add(this.scaleZ);
-            this.groupBox1.Controls.Add(this.scaleY);
-            this.groupBox1.Controls.Add(this.scaleX);
-            this.groupBox1.Location = new System.Drawing.Point(18, 152);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(354, 155);
-            this.groupBox1.TabIndex = 13;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Transform";
+            // groupTransform
+            // 
+            this.groupTransform.Controls.Add(this.posZ);
+            this.groupTransform.Controls.Add(this.posY);
+            this.groupTransform.Controls.Add(this.posX);
+            this.groupTransform.Controls.Add(this.label9);
+            this.groupTransform.Controls.Add(this.label8);
+            this.groupTransform.Controls.Add(this.label7);
+            this.groupTransform.Controls.Add(this.label6);
+            this.groupTransform.Controls.Add(this.btnSave);
+            this.groupTransform.Controls.Add(this.label5);
+            this.groupTransform.Controls.Add(this.rotZ);
+            this.groupTransform.Controls.Add(this.rotY);
+            this.groupTransform.Controls.Add(this.rotX);
+            this.groupTransform.Controls.Add(this.label4);
+            this.groupTransform.Controls.Add(this.scaleZ);
+            this.groupTransform.Controls.Add(this.scaleY);
+            this.groupTransform.Controls.Add(this.scaleX);
+            this.groupTransform.Location = new System.Drawing.Point(17, 208);
+            this.groupTransform.Name = "groupTransform";
+            this.groupTransform.Size = new System.Drawing.Size(354, 155);
+            this.groupTransform.TabIndex = 13;
+            this.groupTransform.TabStop = false;
+            this.groupTransform.Text = "Transform";
+            // 
+            // posZ
+            // 
+            this.posZ.DecimalPlaces = 5;
+            this.posZ.Increment = new decimal(new int[] {
+            1,
+            0,
+            0,
+            131072});
+            this.posZ.Location = new System.Drawing.Point(261, 90);
+            this.posZ.Maximum = new decimal(new int[] {
+            1000,
+            0,
+            0,
+            0});
+            this.posZ.Name = "posZ";
+            this.posZ.Size = new System.Drawing.Size(87, 20);
+            this.posZ.TabIndex = 31;
+            this.posZ.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
+            // 
+            // posY
+            // 
+            this.posY.DecimalPlaces = 5;
+            this.posY.Increment = new decimal(new int[] {
+            1,
+            0,
+            0,
+            131072});
+            this.posY.Location = new System.Drawing.Point(168, 90);
+            this.posY.Maximum = new decimal(new int[] {
+            1000,
+            0,
+            0,
+            0});
+            this.posY.Name = "posY";
+            this.posY.Size = new System.Drawing.Size(87, 20);
+            this.posY.TabIndex = 30;
+            this.posY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
+            // 
+            // posX
+            // 
+            this.posX.DecimalPlaces = 5;
+            this.posX.Increment = new decimal(new int[] {
+            1,
+            0,
+            0,
+            131072});
+            this.posX.Location = new System.Drawing.Point(76, 90);
+            this.posX.Maximum = new decimal(new int[] {
+            1000,
+            0,
+            0,
+            0});
+            this.posX.Name = "posX";
+            this.posX.Size = new System.Drawing.Size(86, 20);
+            this.posX.TabIndex = 29;
+            this.posX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label9.Location = new System.Drawing.Point(15, 92);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(52, 13);
+            this.label9.TabIndex = 28;
+            this.label9.Text = "Position";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
+            this.label8.Location = new System.Drawing.Point(292, 16);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(15, 15);
+            this.label8.TabIndex = 27;
+            this.label8.Text = "Z";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+            this.label7.Location = new System.Drawing.Point(203, 16);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(15, 15);
+            this.label7.TabIndex = 26;
+            this.label7.Text = "Y";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            this.label6.Location = new System.Drawing.Point(106, 16);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(16, 15);
+            this.label6.TabIndex = 25;
+            this.label6.Text = "X";
             // 
             // btnSave
             // 
-            this.btnSave.Location = new System.Drawing.Point(272, 129);
+            this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.btnSave.Location = new System.Drawing.Point(273, 126);
             this.btnSave.Name = "btnSave";
             this.btnSave.Size = new System.Drawing.Size(75, 23);
             this.btnSave.TabIndex = 24;
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(15, 58);
+            this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label5.Location = new System.Drawing.Point(15, 66);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(97, 13);
+            this.label5.Size = new System.Drawing.Size(45, 13);
             this.label5.TabIndex = 23;
-            this.label5.Text = "Rotate ( X / Y / Z )";
+            this.label5.Text = "Rotate";
             // 
             // rotZ
             // 
-            this.rotZ.DecimalPlaces = 4;
+            this.rotZ.DecimalPlaces = 5;
             this.rotZ.Increment = new decimal(new int[] {
             1,
             0,
             0,
             131072});
-            this.rotZ.Location = new System.Drawing.Point(288, 51);
+            this.rotZ.Location = new System.Drawing.Point(261, 64);
             this.rotZ.Name = "rotZ";
-            this.rotZ.Size = new System.Drawing.Size(60, 20);
+            this.rotZ.Size = new System.Drawing.Size(87, 20);
             this.rotZ.TabIndex = 22;
+            this.rotZ.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // rotY
             // 
-            this.rotY.DecimalPlaces = 4;
+            this.rotY.DecimalPlaces = 5;
             this.rotY.Increment = new decimal(new int[] {
             1,
             0,
             0,
             131072});
-            this.rotY.Location = new System.Drawing.Point(209, 51);
+            this.rotY.Location = new System.Drawing.Point(168, 64);
             this.rotY.Name = "rotY";
-            this.rotY.Size = new System.Drawing.Size(60, 20);
+            this.rotY.Size = new System.Drawing.Size(87, 20);
             this.rotY.TabIndex = 21;
+            this.rotY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // rotX
             // 
-            this.rotX.DecimalPlaces = 4;
+            this.rotX.DecimalPlaces = 5;
             this.rotX.Increment = new decimal(new int[] {
             1,
             0,
             0,
             131072});
-            this.rotX.Location = new System.Drawing.Point(126, 53);
+            this.rotX.Location = new System.Drawing.Point(76, 64);
             this.rotX.Name = "rotX";
-            this.rotX.Size = new System.Drawing.Size(60, 20);
+            this.rotX.Size = new System.Drawing.Size(86, 20);
             this.rotX.TabIndex = 20;
+            this.rotX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(15, 26);
+            this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label4.Location = new System.Drawing.Point(15, 41);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 13);
+            this.label4.Size = new System.Drawing.Size(39, 13);
             this.label4.TabIndex = 19;
-            this.label4.Text = "Scale ( X / Y / Z )";
+            this.label4.Text = "Scale";
             // 
             // scaleZ
             // 
-            this.scaleZ.DecimalPlaces = 4;
+            this.scaleZ.DecimalPlaces = 5;
             this.scaleZ.Increment = new decimal(new int[] {
             1,
             0,
             0,
             131072});
-            this.scaleZ.Location = new System.Drawing.Point(288, 19);
+            this.scaleZ.Location = new System.Drawing.Point(261, 39);
             this.scaleZ.Name = "scaleZ";
-            this.scaleZ.Size = new System.Drawing.Size(60, 20);
+            this.scaleZ.Size = new System.Drawing.Size(87, 20);
             this.scaleZ.TabIndex = 18;
+            this.scaleZ.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // scaleY
             // 
-            this.scaleY.DecimalPlaces = 4;
+            this.scaleY.DecimalPlaces = 5;
             this.scaleY.Increment = new decimal(new int[] {
             1,
             0,
             0,
             131072});
-            this.scaleY.Location = new System.Drawing.Point(209, 19);
+            this.scaleY.Location = new System.Drawing.Point(168, 39);
             this.scaleY.Name = "scaleY";
-            this.scaleY.Size = new System.Drawing.Size(60, 20);
+            this.scaleY.Size = new System.Drawing.Size(87, 20);
             this.scaleY.TabIndex = 17;
+            this.scaleY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // scaleX
             // 
-            this.scaleX.DecimalPlaces = 4;
+            this.scaleX.DecimalPlaces = 5;
             this.scaleX.Increment = new decimal(new int[] {
             1,
             0,
             0,
             131072});
-            this.scaleX.Location = new System.Drawing.Point(126, 21);
+            this.scaleX.Location = new System.Drawing.Point(76, 39);
             this.scaleX.Name = "scaleX";
-            this.scaleX.Size = new System.Drawing.Size(60, 20);
+            this.scaleX.Size = new System.Drawing.Size(86, 20);
             this.scaleX.TabIndex = 16;
+            this.scaleX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(392, 17);
+            this.label3.Location = new System.Drawing.Point(389, 20);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(115, 13);
             this.label3.TabIndex = 14;
             // 
             // button7
             // 
+            this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button7.Location = new System.Drawing.Point(591, 15);
             this.button7.Name = "button7";
             this.button7.Size = new System.Drawing.Size(75, 23);
             this.button7.UseVisualStyleBackColor = true;
             this.button7.Click += new System.EventHandler(this.button7_Click);
             // 
+            // tbox_Distance
+            // 
+            this.tbox_Distance.DecimalPlaces = 5;
+            this.tbox_Distance.Increment = new decimal(new int[] {
+            1,
+            0,
+            0,
+            131072});
+            this.tbox_Distance.Location = new System.Drawing.Point(90, 169);
+            this.tbox_Distance.Name = "tbox_Distance";
+            this.tbox_Distance.Size = new System.Drawing.Size(86, 20);
+            this.tbox_Distance.TabIndex = 26;
+            this.tbox_Distance.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
+            this.tbox_Distance.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // tbox_Size
+            // 
+            this.tbox_Size.DecimalPlaces = 5;
+            this.tbox_Size.Increment = new decimal(new int[] {
+            1,
+            0,
+            0,
+            131072});
+            this.tbox_Size.Location = new System.Drawing.Point(285, 164);
+            this.tbox_Size.Name = "tbox_Size";
+            this.tbox_Size.Size = new System.Drawing.Size(86, 20);
+            this.tbox_Size.TabIndex = 27;
+            this.tbox_Size.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
+            this.tbox_Size.Value = new decimal(new int[] {
+            5,
+            0,
+            0,
+            65536});
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(15, 20);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(252, 13);
+            this.label10.TabIndex = 28;
+            this.label10.Text = "Build a prim by pressing one of these Buttons below:";
+            // 
+            // lblVersion
+            // 
+            this.lblVersion.AutoSize = true;
+            this.lblVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblVersion.Location = new System.Drawing.Point(17, 366);
+            this.lblVersion.Name = "lblVersion";
+            this.lblVersion.Size = new System.Drawing.Size(82, 13);
+            this.lblVersion.TabIndex = 30;
+            this.lblVersion.Text = "Version 0.0.3";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label11.Location = new System.Drawing.Point(16, 46);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(80, 13);
+            this.label11.TabIndex = 31;
+            this.label11.Text = "Object Name";
+            // 
+            // txt_ObjectName
+            // 
+            this.txt_ObjectName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.txt_ObjectName.Location = new System.Drawing.Point(102, 43);
+            this.txt_ObjectName.MaxLength = 63;
+            this.txt_ObjectName.Name = "txt_ObjectName";
+            this.txt_ObjectName.Size = new System.Drawing.Size(269, 20);
+            this.txt_ObjectName.TabIndex = 32;
+            // 
             // SimpleBuilder
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.txt_ObjectName);
+            this.Controls.Add(this.label11);
+            this.Controls.Add(this.lblVersion);
+            this.Controls.Add(this.label10);
+            this.Controls.Add(this.tbox_Size);
+            this.Controls.Add(this.tbox_Distance);
             this.Controls.Add(this.button7);
             this.Controls.Add(this.numRadius);
             this.Controls.Add(this.label3);
-            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.groupTransform);
             this.Controls.Add(this.lstPrims);
-            this.Controls.Add(this.tbox_Distance);
-            this.Controls.Add(this.tbox_Size);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.button5);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.btnBuildBox);
             this.Name = "SimpleBuilder";
-            this.Size = new System.Drawing.Size(697, 349);
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
+            this.Size = new System.Drawing.Size(679, 392);
+            this.groupTransform.ResumeLayout(false);
+            this.groupTransform.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.posZ)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.posY)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.posX)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.rotZ)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.rotY)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.rotX)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.scaleY)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.scaleX)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.numRadius)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbox_Distance)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbox_Size)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
         private System.Windows.Forms.Button button5;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.TextBox tbox_Size;
-        private System.Windows.Forms.TextBox tbox_Distance;
-        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.GroupBox groupTransform;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.NumericUpDown numRadius;
         public System.Windows.Forms.ColumnHeader columnHeader1;
         private System.Windows.Forms.NumericUpDown rotX;
         private System.Windows.Forms.Button btnSave;
         private System.Windows.Forms.Button button7;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.NumericUpDown posZ;
+        private System.Windows.Forms.NumericUpDown posY;
+        private System.Windows.Forms.NumericUpDown posX;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.NumericUpDown tbox_Distance;
+        private System.Windows.Forms.NumericUpDown tbox_Size;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label lblVersion;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.TextBox txt_ObjectName;
     }
 }
index bda23bc..ba44036 100644 (file)
@@ -54,6 +54,8 @@ namespace SimpleBuilderNamespace
     [Radegast.Plugin(Name = "SimpleBuilder Plugin", Description = "Allows you to build some basic prims, like boxes, cylinder, tubes, ... (requires permission!)", Version = "1.0")]
     public partial class SimpleBuilder : RadegastTabControl, IRadegastPlugin
     {
+        System.Threading.AutoResetEvent primDone = new System.Threading.AutoResetEvent(false);
+
         private string pluginName = "SimpleBuilder";
         // Methods needed for proper registration of a GUI tab
         #region Template for GUI radegast tab
@@ -76,15 +78,23 @@ namespace SimpleBuilderNamespace
             }
             set
             {
-                if(value == null)
+                if(value == null){
                     btnSave.Enabled = false;
+                    groupTransform.Text = "Transform";
+                }
                 else
+                {
                     btnSave.Enabled = true;
+                    groupTransform.Text = "Transform: " + value.Properties.Name;
+                }
+                    
 
                 m_selectedPrim = value;
             }
         }
 
+        public string ObjectName { get; set; }
+
         /// <summary>Default constructor. Never used. Needed for VS designer</summary>
         public SimpleBuilder()
         {
@@ -357,26 +367,43 @@ namespace SimpleBuilderNamespace
         private void BuildAndRez(PrimType primType)
         {
             float size, distance;
-            if (!float.TryParse(tbox_Size.Text,  System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out size))
-            {
-                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Invalid size", ChatBufferTextStyle.Error);
-                return;
-            }
 
-            if (!float.TryParse(tbox_Distance.Text, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out distance))
-            {
-                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Invalid distance", ChatBufferTextStyle.Error);
-                return;
-            }
+            size = (float)tbox_Size.Value;
+            distance = (float)tbox_Distance.Value;
 
             Primitive.ConstructionData primData = ObjectManager.BuildBasicShape(primType);
 
             Vector3 rezpos = new Vector3(distance, 0, 0);
             rezpos = client.Self.SimPosition + rezpos * client.Self.Movement.BodyRotation;
 
+            ObjectName = txt_ObjectName.Text;
+            client.Objects.ObjectUpdate += new EventHandler<PrimEventArgs>(Objects_OnNewPrim);
             client.Objects.AddPrim(client.Network.CurrentSim, primData, UUID.Zero, rezpos, new Vector3(size), Quaternion.Identity);
+            if (!primDone.WaitOne(10000, false))
+                throw new Exception("Rez failed, timed out while creating the prim.");
 
-            instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Object built and rezzed", ChatBufferTextStyle.Normal);
+            txt_ObjectName.Text = ObjectName;
+        }
+
+        void Objects_OnNewPrim(object sender, PrimEventArgs e)
+        {
+            Primitive prim = e.Prim;
+
+            if ((prim.Flags & PrimFlags.CreateSelected) == 0)
+                return; // We received an update for an object we didn't create
+
+            if (String.IsNullOrEmpty(ObjectName))
+                ObjectName = "SimpleBuilder " + DateTime.Now.ToString("hmmss");
+
+            client.Objects.SetName(client.Network.CurrentSim, prim.LocalID, ObjectName);
+
+            client.Objects.ObjectUpdate -= Objects_OnNewPrim;
+
+            primDone.Set();
+
+            instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Object '"+ txt_ObjectName.Text +"' has been successfully built and rezzed", ChatBufferTextStyle.Normal);
+
+            MessageBox.Show("Object '" + txt_ObjectName.Text + "' has been built and rezzed", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
 
         #endregion Implementation of the custom tab functionality
@@ -388,6 +415,7 @@ namespace SimpleBuilderNamespace
                 selectedPrim = Prims[lstPrims.SelectedIndices[0]];
                 getScaleFromSelection();
                 getRotFromSelection();
+                getPosFromSelection();
             }
             else
             {
@@ -414,6 +442,16 @@ namespace SimpleBuilderNamespace
             rotZ.Value = (Decimal)selectedPrim.Rotation.Z;
         }
 
+        private void getPosFromSelection()
+        {
+            if (selectedPrim == null) return;
+            if (selectedPrim.Position == null) return;
+
+            posX.Value = (Decimal)selectedPrim.Position.X;
+            posY.Value = (Decimal)selectedPrim.Position.Y;
+            posZ.Value = (Decimal)selectedPrim.Position.Z;
+        }
+
         private void setRotToSelection()
         {
             if (selectedPrim != null && selectedPrim.Rotation != null)
@@ -421,6 +459,8 @@ namespace SimpleBuilderNamespace
                 selectedPrim.Rotation.X = (float)rotX.Value;
                 selectedPrim.Rotation.Y = (float)rotY.Value;
                 selectedPrim.Rotation.Z = (float)rotZ.Value;
+
+                client.Objects.SetRotation(client.Network.CurrentSim, selectedPrim.LocalID, selectedPrim.Rotation);
             }
         }
 
@@ -431,6 +471,20 @@ namespace SimpleBuilderNamespace
                 selectedPrim.Scale.X = (float)scaleX.Value;
                 selectedPrim.Scale.Y = (float)scaleY.Value;
                 selectedPrim.Scale.Z = (float)scaleZ.Value;
+
+                client.Objects.SetScale(client.Network.CurrentSim, selectedPrim.LocalID, selectedPrim.Scale, true, false);
+            }
+        }
+
+        private void setPositionToSelection()
+        {
+            if (selectedPrim != null && selectedPrim.Position != null)
+            {
+                selectedPrim.Position.X = (float)posX.Value;
+                selectedPrim.Position.Y = (float)posY.Value;
+                selectedPrim.Position.Z = (float)posZ.Value;
+
+                client.Objects.SetPosition(client.Network.CurrentSim, selectedPrim.LocalID, selectedPrim.Position);
             }
         }
 
@@ -464,8 +518,26 @@ namespace SimpleBuilderNamespace
 
         private void btn_Save_Click(object sender, EventArgs e)
         {
-            setScaleToSelection();
-            setRotToSelection();
+            if (selectedPrim == null) return;
+
+            try
+            {
+                setScaleToSelection();
+                setRotToSelection();
+                setPositionToSelection();
+
+                MessageBox.Show("Object saved!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            }
+            catch (Exception ex)
+            {
+                if(selectedPrim.Properties != null)
+                    instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Failed to save object '" + selectedPrim.Properties.Name + "'", ChatBufferTextStyle.Error);
+                else
+                    instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Failed to save object", ChatBufferTextStyle.Error);
+
+                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ":" + ex.ToString(), ChatBufferTextStyle.Error);
+            }
+            
         }
     }
 }