From d16e5a027f9c8d05b7b964d9d3505ef0dd5f1b5e Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 25 Jun 2022 16:53:13 +0200 Subject: [PATCH] [WIP] update generateModel --- .../generateModel.Designer.cs | 1101 +++---- .../Forms/Skins-And-Textures/generateModel.cs | 2429 ++++++-------- .../Skins-And-Textures/generateModel.resx | 2805 ++++++----------- 3 files changed, 2223 insertions(+), 4112 deletions(-) diff --git a/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.Designer.cs b/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.Designer.cs index 03ec8d2a..c1c76829 100644 --- a/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.Designer.cs +++ b/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.Designer.cs @@ -30,42 +30,18 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(generateModel)); - this.buttonImportModel = new System.Windows.Forms.Button(); - this.buttonExportModel = new System.Windows.Forms.Button(); - this.checkTextureGenerate = new System.Windows.Forms.CheckBox(); - this.checkGuide = new System.Windows.Forms.CheckBox(); - this.labelView = new System.Windows.Forms.Label(); - this.button2 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.label7 = new System.Windows.Forms.Label(); - this.textTextureY = new System.Windows.Forms.TextBox(); - this.textTextureX = new System.Windows.Forms.TextBox(); - this.buttonIMPORT = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.buttonZcplus = new System.Windows.Forms.Button(); - this.buttonXcminus = new System.Windows.Forms.Button(); - this.buttonYcminus = new System.Windows.Forms.Button(); - this.buttonZcminus = new System.Windows.Forms.Button(); - this.buttonYcplus = new System.Windows.Forms.Button(); - this.buttonXcplus = new System.Windows.Forms.Button(); - this.buttonZfplus = new System.Windows.Forms.Button(); - this.buttonXfminus = new System.Windows.Forms.Button(); - this.buttonYfminus = new System.Windows.Forms.Button(); - this.buttonZfminus = new System.Windows.Forms.Button(); - this.buttonYfplus = new System.Windows.Forms.Button(); - this.buttonXfplus = new System.Windows.Forms.Button(); - this.buttonEXPORT = new System.Windows.Forms.Button(); - this.labelTextureMappingPreview = new System.Windows.Forms.Label(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cloneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.changeColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.buttonDone = new System.Windows.Forms.Button(); - this.textYc = new System.Windows.Forms.TextBox(); - this.textZc = new System.Windows.Forms.TextBox(); - this.textXf = new System.Windows.Forms.TextBox(); - this.textYf = new System.Windows.Forms.TextBox(); - this.textZf = new System.Windows.Forms.TextBox(); - this.textXc = new System.Windows.Forms.TextBox(); - this.buttonTemplate = new System.Windows.Forms.Button(); + this.labelView = new System.Windows.Forms.Label(); + this.rotateRightBtn = new System.Windows.Forms.Button(); + this.rotateLeftBtn = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.tabBody = new System.Windows.Forms.TabControl(); + this.tabArmor = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.myTablePanel2 = new PckStudio.Forms.MyTablePanel(); this.offsetArms = new System.Windows.Forms.TextBox(); @@ -76,272 +52,95 @@ this.label13 = new System.Windows.Forms.Label(); this.offsetHead = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); - this.tabArmor = new System.Windows.Forms.TabPage(); - this.myTablePanel1 = new PckStudio.Forms.MyTablePanel(); - this.label8 = new System.Windows.Forms.Label(); - this.offsetBoots = new System.Windows.Forms.TextBox(); - this.offsetPants = new System.Windows.Forms.TextBox(); - this.offsetTool = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.offsetHelmet = new System.Windows.Forms.TextBox(); - this.label15 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.offsetShoulder = new System.Windows.Forms.TextBox(); - this.offsetWaist = new System.Windows.Forms.TextBox(); - this.Chest = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.comboParent = new System.Windows.Forms.ComboBox(); - this.labelModeParts = new System.Windows.Forms.Label(); - this.listViewBoxes = new System.Windows.Forms.ListView(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.cloneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.changeColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.label5 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.checkBoxArmor = new System.Windows.Forms.CheckBox(); - this.labelTheme = new System.Windows.Forms.Label(); - this.listViewBGs = new System.Windows.Forms.ListView(); - this.tableLayoutPanelMain = new System.Windows.Forms.TableLayoutPanel(); - this.OpenJSONButton = new System.Windows.Forms.Button(); - this.displayBox = new System.Windows.Forms.PictureBox(); + this.buttonEXPORT = new System.Windows.Forms.Button(); + this.label7 = new System.Windows.Forms.Label(); + this.buttonIMPORT = new System.Windows.Forms.Button(); this.texturePreview = new System.Windows.Forms.PictureBox(); + this.labelTextureMappingPreview = new System.Windows.Forms.Label(); + this.buttonImportModel = new System.Windows.Forms.Button(); + this.displayBox = new System.Windows.Forms.PictureBox(); + this.buttonExportModel = new System.Windows.Forms.Button(); + this.OpenJSONButton = new System.Windows.Forms.Button(); + this.buttonTemplate = new MetroFramework.Controls.MetroButton(); + this.checkTextureGenerate = new MetroFramework.Controls.MetroCheckBox(); + this.checkGuide = new MetroFramework.Controls.MetroCheckBox(); + this.checkBoxArmor = new MetroFramework.Controls.MetroCheckBox(); + this.SizeXUpDown = new System.Windows.Forms.NumericUpDown(); + this.SizeYUpDown = new System.Windows.Forms.NumericUpDown(); + this.SizeZUpDown = new System.Windows.Forms.NumericUpDown(); + this.TextureXUpDown = new System.Windows.Forms.NumericUpDown(); + this.TextureYUpDown = new System.Windows.Forms.NumericUpDown(); + this.PosZUpDown = new System.Windows.Forms.NumericUpDown(); + this.PosYUpDown = new System.Windows.Forms.NumericUpDown(); + this.PosXUpDown = new System.Windows.Forms.NumericUpDown(); + this.Part = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.X = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Y = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Z = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Width = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Height = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Length = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.U = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.V = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.listViewBoxes = new System.Windows.Forms.ListView(); + this.contextMenuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.tabBody.SuspendLayout(); this.tabPage1.SuspendLayout(); this.myTablePanel2.SuspendLayout(); - this.tabArmor.SuspendLayout(); - this.myTablePanel1.SuspendLayout(); - this.contextMenuStrip1.SuspendLayout(); - this.tableLayoutPanelMain.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.displayBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.texturePreview)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.displayBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.TextureXUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.TextureYUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).BeginInit(); this.SuspendLayout(); // - // buttonImportModel + // contextMenuStrip1 // - resources.ApplyResources(this.buttonImportModel, "buttonImportModel"); - this.buttonImportModel.ForeColor = System.Drawing.Color.White; - this.buttonImportModel.Name = "buttonImportModel"; - this.buttonImportModel.UseVisualStyleBackColor = true; - this.buttonImportModel.Click += new System.EventHandler(this.buttonImportModel_Click); + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.createToolStripMenuItem, + this.cloneToolStripMenuItem, + this.deleteToolStripMenuItem, + this.changeColorToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); // - // buttonExportModel + // createToolStripMenuItem // - resources.ApplyResources(this.buttonExportModel, "buttonExportModel"); - this.buttonExportModel.ForeColor = System.Drawing.Color.White; - this.buttonExportModel.Name = "buttonExportModel"; - this.buttonExportModel.UseVisualStyleBackColor = true; - this.buttonExportModel.Click += new System.EventHandler(this.buttonExportModel_Click); + resources.ApplyResources(this.createToolStripMenuItem, "createToolStripMenuItem"); + this.createToolStripMenuItem.Name = "createToolStripMenuItem"; + this.createToolStripMenuItem.Click += new System.EventHandler(this.createToolStripMenuItem_Click); // - // checkTextureGenerate + // cloneToolStripMenuItem // - resources.ApplyResources(this.checkTextureGenerate, "checkTextureGenerate"); - this.checkTextureGenerate.Checked = true; - this.checkTextureGenerate.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkTextureGenerate.ForeColor = System.Drawing.Color.White; - this.checkTextureGenerate.Name = "checkTextureGenerate"; - this.checkTextureGenerate.UseVisualStyleBackColor = true; - this.checkTextureGenerate.CheckedChanged += new System.EventHandler(this.checkTextureGenerate_CheckedChanged); + resources.ApplyResources(this.cloneToolStripMenuItem, "cloneToolStripMenuItem"); + this.cloneToolStripMenuItem.Name = "cloneToolStripMenuItem"; + this.cloneToolStripMenuItem.Click += new System.EventHandler(this.cloneToolStripMenuItem_Click); // - // checkGuide + // deleteToolStripMenuItem // - resources.ApplyResources(this.checkGuide, "checkGuide"); - this.checkGuide.ForeColor = System.Drawing.Color.White; - this.checkGuide.Name = "checkGuide"; - this.checkGuide.UseVisualStyleBackColor = true; - this.checkGuide.CheckedChanged += new System.EventHandler(this.checkGuide_CheckedChanged); + resources.ApplyResources(this.deleteToolStripMenuItem, "deleteToolStripMenuItem"); + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // - // labelView + // changeColorToolStripMenuItem // - resources.ApplyResources(this.labelView, "labelView"); - this.labelView.ForeColor = System.Drawing.Color.White; - this.labelView.Name = "labelView"; - // - // button2 - // - resources.ApplyResources(this.button2, "button2"); - this.button2.ForeColor = System.Drawing.Color.White; - this.button2.Name = "button2"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button1 - // - resources.ApplyResources(this.button1, "button1"); - this.button1.ForeColor = System.Drawing.Color.White; - this.button1.Name = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // label7 - // - resources.ApplyResources(this.label7, "label7"); - this.label7.ForeColor = System.Drawing.Color.White; - this.label7.Name = "label7"; - // - // textTextureY - // - resources.ApplyResources(this.textTextureY, "textTextureY"); - this.tableLayoutPanelMain.SetColumnSpan(this.textTextureY, 2); - this.textTextureY.Name = "textTextureY"; - this.textTextureY.TextChanged += new System.EventHandler(this.textTextureY_TextChanged); - this.textTextureY.Leave += new System.EventHandler(this.textXc_Leave); - // - // textTextureX - // - this.tableLayoutPanelMain.SetColumnSpan(this.textTextureX, 2); - resources.ApplyResources(this.textTextureX, "textTextureX"); - this.textTextureX.Name = "textTextureX"; - this.textTextureX.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - this.textTextureX.Leave += new System.EventHandler(this.textXc_Leave); - // - // buttonIMPORT - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonIMPORT, 3); - resources.ApplyResources(this.buttonIMPORT, "buttonIMPORT"); - this.buttonIMPORT.ForeColor = System.Drawing.Color.White; - this.buttonIMPORT.Name = "buttonIMPORT"; - this.buttonIMPORT.UseVisualStyleBackColor = true; - this.buttonIMPORT.Click += new System.EventHandler(this.buttonIMPORT_Click); - // - // label5 - // - resources.ApplyResources(this.label5, "label5"); - this.tableLayoutPanelMain.SetColumnSpan(this.label5, 3); - this.label5.ForeColor = System.Drawing.Color.White; - this.label5.Name = "label5"; - // - // buttonZcplus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonZcplus, 2); - resources.ApplyResources(this.buttonZcplus, "buttonZcplus"); - this.buttonZcplus.ForeColor = System.Drawing.Color.White; - this.buttonZcplus.Name = "buttonZcplus"; - this.buttonZcplus.UseVisualStyleBackColor = true; - this.buttonZcplus.Click += new System.EventHandler(this.buttonZcplus_Click); - // - // buttonXcminus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonXcminus, 2); - resources.ApplyResources(this.buttonXcminus, "buttonXcminus"); - this.buttonXcminus.ForeColor = System.Drawing.Color.White; - this.buttonXcminus.Name = "buttonXcminus"; - this.buttonXcminus.UseVisualStyleBackColor = true; - this.buttonXcminus.Click += new System.EventHandler(this.buttonXcminus_Click); - // - // buttonYcminus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonYcminus, 2); - resources.ApplyResources(this.buttonYcminus, "buttonYcminus"); - this.buttonYcminus.ForeColor = System.Drawing.Color.White; - this.buttonYcminus.Name = "buttonYcminus"; - this.buttonYcminus.UseVisualStyleBackColor = true; - this.buttonYcminus.Click += new System.EventHandler(this.buttonYcminus_Click); - // - // buttonZcminus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonZcminus, 2); - resources.ApplyResources(this.buttonZcminus, "buttonZcminus"); - this.buttonZcminus.ForeColor = System.Drawing.Color.White; - this.buttonZcminus.Name = "buttonZcminus"; - this.buttonZcminus.UseVisualStyleBackColor = true; - this.buttonZcminus.Click += new System.EventHandler(this.buttonZcminus_Click); - // - // buttonYcplus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonYcplus, 2); - resources.ApplyResources(this.buttonYcplus, "buttonYcplus"); - this.buttonYcplus.ForeColor = System.Drawing.Color.White; - this.buttonYcplus.Name = "buttonYcplus"; - this.buttonYcplus.UseVisualStyleBackColor = true; - this.buttonYcplus.Click += new System.EventHandler(this.buttonYcplus_Click); - // - // buttonXcplus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonXcplus, 2); - resources.ApplyResources(this.buttonXcplus, "buttonXcplus"); - this.buttonXcplus.ForeColor = System.Drawing.Color.White; - this.buttonXcplus.Name = "buttonXcplus"; - this.buttonXcplus.UseVisualStyleBackColor = true; - this.buttonXcplus.Click += new System.EventHandler(this.buttonXcplus_Click); - // - // buttonZfplus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonZfplus, 2); - resources.ApplyResources(this.buttonZfplus, "buttonZfplus"); - this.buttonZfplus.ForeColor = System.Drawing.Color.White; - this.buttonZfplus.Name = "buttonZfplus"; - this.buttonZfplus.UseVisualStyleBackColor = true; - this.buttonZfplus.Click += new System.EventHandler(this.buttonZfplus_Click); - // - // buttonXfminus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonXfminus, 2); - resources.ApplyResources(this.buttonXfminus, "buttonXfminus"); - this.buttonXfminus.ForeColor = System.Drawing.Color.White; - this.buttonXfminus.Name = "buttonXfminus"; - this.buttonXfminus.UseVisualStyleBackColor = true; - this.buttonXfminus.Click += new System.EventHandler(this.buttonXfminus_Click); - // - // buttonYfminus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonYfminus, 2); - resources.ApplyResources(this.buttonYfminus, "buttonYfminus"); - this.buttonYfminus.ForeColor = System.Drawing.Color.White; - this.buttonYfminus.Name = "buttonYfminus"; - this.buttonYfminus.UseVisualStyleBackColor = true; - this.buttonYfminus.Click += new System.EventHandler(this.buttonYfminus_Click); - // - // buttonZfminus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonZfminus, 2); - resources.ApplyResources(this.buttonZfminus, "buttonZfminus"); - this.buttonZfminus.ForeColor = System.Drawing.Color.White; - this.buttonZfminus.Name = "buttonZfminus"; - this.buttonZfminus.UseVisualStyleBackColor = true; - this.buttonZfminus.Click += new System.EventHandler(this.buttonZfminus_Click); - // - // buttonYfplus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonYfplus, 2); - resources.ApplyResources(this.buttonYfplus, "buttonYfplus"); - this.buttonYfplus.ForeColor = System.Drawing.Color.White; - this.buttonYfplus.Name = "buttonYfplus"; - this.buttonYfplus.UseVisualStyleBackColor = true; - this.buttonYfplus.Click += new System.EventHandler(this.buttonYfplus_Click); - // - // buttonXfplus - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonXfplus, 2); - resources.ApplyResources(this.buttonXfplus, "buttonXfplus"); - this.buttonXfplus.ForeColor = System.Drawing.Color.White; - this.buttonXfplus.Name = "buttonXfplus"; - this.buttonXfplus.UseVisualStyleBackColor = true; - this.buttonXfplus.Click += new System.EventHandler(this.buttonXfplus_Click); - // - // buttonEXPORT - // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonEXPORT, 3); - resources.ApplyResources(this.buttonEXPORT, "buttonEXPORT"); - this.buttonEXPORT.ForeColor = System.Drawing.Color.White; - this.buttonEXPORT.Name = "buttonEXPORT"; - this.buttonEXPORT.UseVisualStyleBackColor = true; - this.buttonEXPORT.Click += new System.EventHandler(this.buttonEXPORT_Click); - // - // labelTextureMappingPreview - // - resources.ApplyResources(this.labelTextureMappingPreview, "labelTextureMappingPreview"); - this.tableLayoutPanelMain.SetColumnSpan(this.labelTextureMappingPreview, 6); - this.labelTextureMappingPreview.ForeColor = System.Drawing.Color.White; - this.labelTextureMappingPreview.Name = "labelTextureMappingPreview"; + resources.ApplyResources(this.changeColorToolStripMenuItem, "changeColorToolStripMenuItem"); + this.changeColorToolStripMenuItem.Name = "changeColorToolStripMenuItem"; + this.changeColorToolStripMenuItem.Click += new System.EventHandler(this.changeColorToolStripMenuItem_Click); // // buttonDone // - this.tableLayoutPanelMain.SetColumnSpan(this.buttonDone, 3); this.buttonDone.DialogResult = System.Windows.Forms.DialogResult.OK; resources.ApplyResources(this.buttonDone, "buttonDone"); this.buttonDone.ForeColor = System.Drawing.Color.White; @@ -349,79 +148,50 @@ this.buttonDone.UseVisualStyleBackColor = true; this.buttonDone.Click += new System.EventHandler(this.buttonDone_Click); // - // textYc + // labelView // - this.tableLayoutPanelMain.SetColumnSpan(this.textYc, 2); - resources.ApplyResources(this.textYc, "textYc"); - this.textYc.Name = "textYc"; - this.textYc.TextChanged += new System.EventHandler(this.textYc_TextChanged); - this.textYc.Leave += new System.EventHandler(this.textXc_Leave); + resources.ApplyResources(this.labelView, "labelView"); + this.labelView.ForeColor = System.Drawing.Color.White; + this.labelView.Name = "labelView"; // - // textZc + // rotateRightBtn // - this.tableLayoutPanelMain.SetColumnSpan(this.textZc, 2); - resources.ApplyResources(this.textZc, "textZc"); - this.textZc.Name = "textZc"; - this.textZc.TextChanged += new System.EventHandler(this.textZc_TextChanged); - this.textZc.Leave += new System.EventHandler(this.textXc_Leave); + resources.ApplyResources(this.rotateRightBtn, "rotateRightBtn"); + this.rotateRightBtn.ForeColor = System.Drawing.Color.White; + this.rotateRightBtn.Name = "rotateRightBtn"; + this.rotateRightBtn.UseVisualStyleBackColor = true; + this.rotateRightBtn.Click += new System.EventHandler(this.rotateRightBtn_Click); // - // textXf + // rotateLeftBtn // - this.tableLayoutPanelMain.SetColumnSpan(this.textXf, 2); - resources.ApplyResources(this.textXf, "textXf"); - this.textXf.Name = "textXf"; - this.textXf.TextChanged += new System.EventHandler(this.textXf_TextChanged); - this.textXf.Leave += new System.EventHandler(this.textXc_Leave); - // - // textYf - // - this.tableLayoutPanelMain.SetColumnSpan(this.textYf, 2); - resources.ApplyResources(this.textYf, "textYf"); - this.textYf.Name = "textYf"; - this.textYf.TextChanged += new System.EventHandler(this.textYf_TextChanged); - this.textYf.Leave += new System.EventHandler(this.textXc_Leave); - // - // textZf - // - this.tableLayoutPanelMain.SetColumnSpan(this.textZf, 2); - resources.ApplyResources(this.textZf, "textZf"); - this.textZf.Name = "textZf"; - this.textZf.TextChanged += new System.EventHandler(this.textZf_TextChanged); - this.textZf.Leave += new System.EventHandler(this.textXc_Leave); - // - // textXc - // - this.tableLayoutPanelMain.SetColumnSpan(this.textXc, 2); - resources.ApplyResources(this.textXc, "textXc"); - this.textXc.Name = "textXc"; - this.textXc.TextChanged += new System.EventHandler(this.textXc_TextChanged); - this.textXc.Leave += new System.EventHandler(this.textXc_Leave); - // - // buttonTemplate - // - resources.ApplyResources(this.buttonTemplate, "buttonTemplate"); - this.buttonTemplate.Name = "buttonTemplate"; - this.buttonTemplate.UseVisualStyleBackColor = true; - this.buttonTemplate.Click += new System.EventHandler(this.buttonTemplate_Click); + resources.ApplyResources(this.rotateLeftBtn, "rotateLeftBtn"); + this.rotateLeftBtn.ForeColor = System.Drawing.Color.White; + this.rotateLeftBtn.Name = "rotateLeftBtn"; + this.rotateLeftBtn.UseVisualStyleBackColor = true; + this.rotateLeftBtn.Click += new System.EventHandler(this.rotateLeftBtn_Click); // // groupBox1 // - this.tableLayoutPanelMain.SetColumnSpan(this.groupBox1, 6); this.groupBox1.Controls.Add(this.tabBody); - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.ForeColor = System.Drawing.Color.White; + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; - this.tableLayoutPanelMain.SetRowSpan(this.groupBox1, 2); this.groupBox1.TabStop = false; // // tabBody // - this.tabBody.Controls.Add(this.tabPage1); this.tabBody.Controls.Add(this.tabArmor); + this.tabBody.Controls.Add(this.tabPage1); resources.ApplyResources(this.tabBody, "tabBody"); this.tabBody.Name = "tabBody"; this.tabBody.SelectedIndex = 0; // + // tabArmor + // + this.tabArmor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + resources.ApplyResources(this.tabArmor, "tabArmor"); + this.tabArmor.Name = "tabArmor"; + // // tabPage1 // this.tabPage1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); @@ -490,113 +260,6 @@ this.label12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); this.label12.Name = "label12"; // - // tabArmor - // - this.tabArmor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); - this.tabArmor.Controls.Add(this.myTablePanel1); - resources.ApplyResources(this.tabArmor, "tabArmor"); - this.tabArmor.Name = "tabArmor"; - // - // myTablePanel1 - // - resources.ApplyResources(this.myTablePanel1, "myTablePanel1"); - this.myTablePanel1.Controls.Add(this.label8, 0, 6); - this.myTablePanel1.Controls.Add(this.offsetBoots, 1, 3); - this.myTablePanel1.Controls.Add(this.offsetPants, 1, 2); - this.myTablePanel1.Controls.Add(this.offsetTool, 1, 1); - this.myTablePanel1.Controls.Add(this.label4, 0, 1); - this.myTablePanel1.Controls.Add(this.label9, 0, 0); - this.myTablePanel1.Controls.Add(this.offsetHelmet, 1, 0); - this.myTablePanel1.Controls.Add(this.label15, 0, 3); - this.myTablePanel1.Controls.Add(this.label16, 0, 2); - this.myTablePanel1.Controls.Add(this.label1, 0, 5); - this.myTablePanel1.Controls.Add(this.label2, 0, 4); - this.myTablePanel1.Controls.Add(this.offsetShoulder, 1, 4); - this.myTablePanel1.Controls.Add(this.offsetWaist, 1, 5); - this.myTablePanel1.Controls.Add(this.Chest, 1, 6); - this.myTablePanel1.Name = "myTablePanel1"; - // - // label8 - // - resources.ApplyResources(this.label8, "label8"); - this.label8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.label8.Name = "label8"; - // - // offsetBoots - // - resources.ApplyResources(this.offsetBoots, "offsetBoots"); - this.offsetBoots.Name = "offsetBoots"; - this.offsetBoots.TextChanged += new System.EventHandler(this.offsetBoots_TextChanged); - // - // offsetPants - // - resources.ApplyResources(this.offsetPants, "offsetPants"); - this.offsetPants.Name = "offsetPants"; - this.offsetPants.TextChanged += new System.EventHandler(this.offsetPants_TextChanged); - // - // offsetTool - // - resources.ApplyResources(this.offsetTool, "offsetTool"); - this.offsetTool.Name = "offsetTool"; - this.offsetTool.TextChanged += new System.EventHandler(this.offsetTool_TextChanged); - // - // label4 - // - resources.ApplyResources(this.label4, "label4"); - this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); - this.label4.Name = "label4"; - // - // label9 - // - resources.ApplyResources(this.label9, "label9"); - this.label9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.label9.Name = "label9"; - // - // offsetHelmet - // - resources.ApplyResources(this.offsetHelmet, "offsetHelmet"); - this.offsetHelmet.Name = "offsetHelmet"; - this.offsetHelmet.TextChanged += new System.EventHandler(this.offsetHelmet_TextChanged); - // - // label15 - // - resources.ApplyResources(this.label15, "label15"); - this.label15.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - this.label15.Name = "label15"; - // - // label16 - // - resources.ApplyResources(this.label16, "label16"); - this.label16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); - this.label16.Name = "label16"; - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.label1.Name = "label1"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); - this.label2.Name = "label2"; - // - // offsetShoulder - // - resources.ApplyResources(this.offsetShoulder, "offsetShoulder"); - this.offsetShoulder.Name = "offsetShoulder"; - // - // offsetWaist - // - resources.ApplyResources(this.offsetWaist, "offsetWaist"); - this.offsetWaist.Name = "offsetWaist"; - // - // Chest - // - resources.ApplyResources(this.Chest, "Chest"); - this.Chest.Name = "Chest"; - // // label6 // resources.ApplyResources(this.label6, "label6"); @@ -617,154 +280,76 @@ this.comboParent.Name = "comboParent"; this.comboParent.SelectedValueChanged += new System.EventHandler(this.comboParent_SelectedIndexChanged); // - // labelModeParts + // label5 // - resources.ApplyResources(this.labelModeParts, "labelModeParts"); - this.labelModeParts.ForeColor = System.Drawing.Color.White; - this.labelModeParts.Name = "labelModeParts"; - // - // listViewBoxes - // - this.listViewBoxes.Activation = System.Windows.Forms.ItemActivation.OneClick; - this.listViewBoxes.ContextMenuStrip = this.contextMenuStrip1; - resources.ApplyResources(this.listViewBoxes, "listViewBoxes"); - this.listViewBoxes.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.listViewBoxes.HideSelection = false; - this.listViewBoxes.LabelEdit = true; - this.listViewBoxes.MultiSelect = false; - this.listViewBoxes.Name = "listViewBoxes"; - this.tableLayoutPanelMain.SetRowSpan(this.listViewBoxes, 14); - this.listViewBoxes.UseCompatibleStateImageBehavior = false; - this.listViewBoxes.View = System.Windows.Forms.View.Details; - this.listViewBoxes.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); - this.listViewBoxes.Click += new System.EventHandler(this.listView1_Click); - this.listViewBoxes.DoubleClick += new System.EventHandler(this.listView1_DoubleClick_1); - this.listViewBoxes.KeyDown += new System.Windows.Forms.KeyEventHandler(this.delStuffUsingDelKey); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.createToolStripMenuItem, - this.cloneToolStripMenuItem, - this.deleteToolStripMenuItem, - this.changeColorToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); - // - // createToolStripMenuItem - // - resources.ApplyResources(this.createToolStripMenuItem, "createToolStripMenuItem"); - this.createToolStripMenuItem.Name = "createToolStripMenuItem"; - this.createToolStripMenuItem.Click += new System.EventHandler(this.createToolStripMenuItem_Click); - // - // cloneToolStripMenuItem - // - resources.ApplyResources(this.cloneToolStripMenuItem, "cloneToolStripMenuItem"); - this.cloneToolStripMenuItem.Name = "cloneToolStripMenuItem"; - this.cloneToolStripMenuItem.Click += new System.EventHandler(this.cloneToolStripMenuItem_Click); - // - // deleteToolStripMenuItem - // - resources.ApplyResources(this.deleteToolStripMenuItem, "deleteToolStripMenuItem"); - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); - // - // changeColorToolStripMenuItem - // - resources.ApplyResources(this.changeColorToolStripMenuItem, "changeColorToolStripMenuItem"); - this.changeColorToolStripMenuItem.Name = "changeColorToolStripMenuItem"; - this.changeColorToolStripMenuItem.Click += new System.EventHandler(this.changeColorToolStripMenuItem_Click); + resources.ApplyResources(this.label5, "label5"); + this.label5.ForeColor = System.Drawing.Color.White; + this.label5.Name = "label5"; // // label3 // resources.ApplyResources(this.label3, "label3"); - this.tableLayoutPanelMain.SetColumnSpan(this.label3, 2); this.label3.ForeColor = System.Drawing.Color.White; this.label3.Name = "label3"; // - // checkBoxArmor + // buttonEXPORT // - resources.ApplyResources(this.checkBoxArmor, "checkBoxArmor"); - this.checkBoxArmor.ForeColor = System.Drawing.Color.White; - this.checkBoxArmor.Name = "checkBoxArmor"; - this.checkBoxArmor.UseVisualStyleBackColor = true; - this.checkBoxArmor.Click += new System.EventHandler(this.checkBoxArmor_Click); + resources.ApplyResources(this.buttonEXPORT, "buttonEXPORT"); + this.buttonEXPORT.ForeColor = System.Drawing.Color.White; + this.buttonEXPORT.Name = "buttonEXPORT"; + this.buttonEXPORT.UseVisualStyleBackColor = true; + this.buttonEXPORT.Click += new System.EventHandler(this.buttonEXPORT_Click); // - // labelTheme + // label7 // - resources.ApplyResources(this.labelTheme, "labelTheme"); - this.labelTheme.ForeColor = System.Drawing.Color.White; - this.labelTheme.Name = "labelTheme"; + resources.ApplyResources(this.label7, "label7"); + this.label7.ForeColor = System.Drawing.Color.White; + this.label7.Name = "label7"; // - // listViewBGs + // buttonIMPORT // - resources.ApplyResources(this.listViewBGs, "listViewBGs"); - this.listViewBGs.HideSelection = false; - this.listViewBGs.Items.AddRange(new System.Windows.Forms.ListViewItem[] { - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items1"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items2"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items3"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items4"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items5"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items6"))), - ((System.Windows.Forms.ListViewItem)(resources.GetObject("listViewBGs.Items7")))}); - this.listViewBGs.Name = "listViewBGs"; - this.listViewBGs.UseCompatibleStateImageBehavior = false; - this.listViewBGs.SelectedIndexChanged += new System.EventHandler(this.listViewBGs_SelectedIndexChanged); - this.listViewBGs.Click += new System.EventHandler(this.listViewBGs_Click); + resources.ApplyResources(this.buttonIMPORT, "buttonIMPORT"); + this.buttonIMPORT.ForeColor = System.Drawing.Color.White; + this.buttonIMPORT.Name = "buttonIMPORT"; + this.buttonIMPORT.UseVisualStyleBackColor = true; + this.buttonIMPORT.Click += new System.EventHandler(this.buttonIMPORT_Click); // - // tableLayoutPanelMain + // texturePreview // - resources.ApplyResources(this.tableLayoutPanelMain, "tableLayoutPanelMain"); - this.tableLayoutPanelMain.Controls.Add(this.labelModeParts, 0, 0); - this.tableLayoutPanelMain.Controls.Add(this.OpenJSONButton, 1, 0); - this.tableLayoutPanelMain.Controls.Add(this.listViewBoxes, 0, 1); - this.tableLayoutPanelMain.Controls.Add(this.buttonExportModel, 3, 0); - this.tableLayoutPanelMain.Controls.Add(this.displayBox, 1, 1); - this.tableLayoutPanelMain.Controls.Add(this.buttonImportModel, 2, 0); - this.tableLayoutPanelMain.Controls.Add(this.labelTextureMappingPreview, 5, 0); - this.tableLayoutPanelMain.Controls.Add(this.texturePreview, 5, 1); - this.tableLayoutPanelMain.Controls.Add(this.buttonIMPORT, 5, 6); - this.tableLayoutPanelMain.Controls.Add(this.label7, 5, 7); - this.tableLayoutPanelMain.Controls.Add(this.buttonEXPORT, 8, 6); - this.tableLayoutPanelMain.Controls.Add(this.textTextureY, 6, 7); - this.tableLayoutPanelMain.Controls.Add(this.textTextureX, 8, 7); - this.tableLayoutPanelMain.Controls.Add(this.label3, 5, 8); - this.tableLayoutPanelMain.Controls.Add(this.buttonXfplus, 5, 9); - this.tableLayoutPanelMain.Controls.Add(this.textXf, 5, 10); - this.tableLayoutPanelMain.Controls.Add(this.buttonXfminus, 5, 11); - this.tableLayoutPanelMain.Controls.Add(this.label5, 5, 12); - this.tableLayoutPanelMain.Controls.Add(this.buttonXcplus, 5, 13); - this.tableLayoutPanelMain.Controls.Add(this.textXc, 5, 14); - this.tableLayoutPanelMain.Controls.Add(this.buttonXcminus, 5, 15); - this.tableLayoutPanelMain.Controls.Add(this.buttonYfplus, 7, 9); - this.tableLayoutPanelMain.Controls.Add(this.textYf, 7, 10); - this.tableLayoutPanelMain.Controls.Add(this.buttonYfminus, 7, 11); - this.tableLayoutPanelMain.Controls.Add(this.buttonYcplus, 7, 13); - this.tableLayoutPanelMain.Controls.Add(this.textYc, 7, 14); - this.tableLayoutPanelMain.Controls.Add(this.buttonYcminus, 7, 15); - this.tableLayoutPanelMain.Controls.Add(this.buttonZfplus, 9, 9); - this.tableLayoutPanelMain.Controls.Add(this.textZf, 9, 10); - this.tableLayoutPanelMain.Controls.Add(this.buttonZfminus, 9, 11); - this.tableLayoutPanelMain.Controls.Add(this.buttonZcplus, 9, 13); - this.tableLayoutPanelMain.Controls.Add(this.textZc, 9, 14); - this.tableLayoutPanelMain.Controls.Add(this.buttonZcminus, 9, 15); - this.tableLayoutPanelMain.Controls.Add(this.comboParent, 0, 18); - this.tableLayoutPanelMain.Controls.Add(this.label6, 0, 17); - this.tableLayoutPanelMain.Controls.Add(this.buttonTemplate, 0, 19); - this.tableLayoutPanelMain.Controls.Add(this.groupBox1, 5, 16); - this.tableLayoutPanelMain.Controls.Add(this.labelTheme, 0, 15); - this.tableLayoutPanelMain.Controls.Add(this.listViewBGs, 0, 16); - this.tableLayoutPanelMain.Controls.Add(this.button2, 1, 18); - this.tableLayoutPanelMain.Controls.Add(this.button1, 3, 18); - this.tableLayoutPanelMain.Controls.Add(this.labelView, 2, 18); - this.tableLayoutPanelMain.Controls.Add(this.checkGuide, 1, 19); - this.tableLayoutPanelMain.Controls.Add(this.checkTextureGenerate, 2, 19); - this.tableLayoutPanelMain.Controls.Add(this.checkBoxArmor, 3, 19); - this.tableLayoutPanelMain.Controls.Add(this.buttonDone, 8, 19); - this.tableLayoutPanelMain.Name = "tableLayoutPanelMain"; + this.texturePreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + resources.ApplyResources(this.texturePreview, "texturePreview"); + this.texturePreview.Name = "texturePreview"; + this.texturePreview.TabStop = false; + // + // labelTextureMappingPreview + // + resources.ApplyResources(this.labelTextureMappingPreview, "labelTextureMappingPreview"); + this.labelTextureMappingPreview.ForeColor = System.Drawing.Color.White; + this.labelTextureMappingPreview.Name = "labelTextureMappingPreview"; + // + // buttonImportModel + // + resources.ApplyResources(this.buttonImportModel, "buttonImportModel"); + this.buttonImportModel.ForeColor = System.Drawing.Color.White; + this.buttonImportModel.Name = "buttonImportModel"; + this.buttonImportModel.UseVisualStyleBackColor = true; + this.buttonImportModel.Click += new System.EventHandler(this.buttonImportModel_Click); + // + // displayBox + // + this.displayBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); + this.displayBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + resources.ApplyResources(this.displayBox, "displayBox"); + this.displayBox.Name = "displayBox"; + this.displayBox.TabStop = false; + // + // buttonExportModel + // + resources.ApplyResources(this.buttonExportModel, "buttonExportModel"); + this.buttonExportModel.ForeColor = System.Drawing.Color.White; + this.buttonExportModel.Name = "buttonExportModel"; + this.buttonExportModel.UseVisualStyleBackColor = true; + this.buttonExportModel.Click += new System.EventHandler(this.buttonExportModel_Click); // // OpenJSONButton // @@ -774,136 +359,318 @@ this.OpenJSONButton.UseVisualStyleBackColor = true; this.OpenJSONButton.Click += new System.EventHandler(this.OpenJSONButton_Click); // - // displayBox + // buttonTemplate // - this.displayBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.tableLayoutPanelMain.SetColumnSpan(this.displayBox, 3); - resources.ApplyResources(this.displayBox, "displayBox"); - this.displayBox.Image = global::PckStudio.Properties.Resources.bg2; - this.displayBox.Name = "displayBox"; - this.tableLayoutPanelMain.SetRowSpan(this.displayBox, 17); - this.displayBox.TabStop = false; + resources.ApplyResources(this.buttonTemplate, "buttonTemplate"); + this.buttonTemplate.Name = "buttonTemplate"; + this.buttonTemplate.Theme = MetroFramework.MetroThemeStyle.Dark; + this.buttonTemplate.UseSelectable = true; + this.buttonTemplate.Click += new System.EventHandler(this.buttonTemplate_Click); // - // texturePreview + // checkTextureGenerate // - this.texturePreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.tableLayoutPanelMain.SetColumnSpan(this.texturePreview, 6); - resources.ApplyResources(this.texturePreview, "texturePreview"); - this.texturePreview.Name = "texturePreview"; - this.tableLayoutPanelMain.SetRowSpan(this.texturePreview, 5); - this.texturePreview.TabStop = false; + resources.ApplyResources(this.checkTextureGenerate, "checkTextureGenerate"); + this.checkTextureGenerate.Checked = true; + this.checkTextureGenerate.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkTextureGenerate.Name = "checkTextureGenerate"; + this.checkTextureGenerate.Theme = MetroFramework.MetroThemeStyle.Dark; + this.checkTextureGenerate.UseSelectable = true; + // + // checkGuide + // + resources.ApplyResources(this.checkGuide, "checkGuide"); + this.checkGuide.Name = "checkGuide"; + this.checkGuide.Theme = MetroFramework.MetroThemeStyle.Dark; + this.checkGuide.UseSelectable = true; + this.checkGuide.CheckedChanged += new System.EventHandler(this.render); + // + // checkBoxArmor + // + resources.ApplyResources(this.checkBoxArmor, "checkBoxArmor"); + this.checkBoxArmor.Name = "checkBoxArmor"; + this.checkBoxArmor.Theme = MetroFramework.MetroThemeStyle.Dark; + this.checkBoxArmor.UseSelectable = true; + this.checkBoxArmor.CheckedChanged += new System.EventHandler(this.render); + // + // SizeXUpDown + // + this.SizeXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.SizeXUpDown.DecimalPlaces = 1; + this.SizeXUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.SizeXUpDown, "SizeXUpDown"); + this.SizeXUpDown.Name = "SizeXUpDown"; + this.SizeXUpDown.ValueChanged += new System.EventHandler(this.SizeXUpDown_ValueChanged); + // + // SizeYUpDown + // + this.SizeYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.SizeYUpDown.DecimalPlaces = 1; + this.SizeYUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.SizeYUpDown, "SizeYUpDown"); + this.SizeYUpDown.Name = "SizeYUpDown"; + this.SizeYUpDown.ValueChanged += new System.EventHandler(this.SizeYUpDown_ValueChanged); + // + // SizeZUpDown + // + this.SizeZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.SizeZUpDown.DecimalPlaces = 1; + this.SizeZUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.SizeZUpDown, "SizeZUpDown"); + this.SizeZUpDown.Name = "SizeZUpDown"; + this.SizeZUpDown.ValueChanged += new System.EventHandler(this.SizeZUpDown_ValueChanged); + // + // TextureXUpDown + // + this.TextureXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.TextureXUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.TextureXUpDown, "TextureXUpDown"); + this.TextureXUpDown.Maximum = new decimal(new int[] { + 64, + 0, + 0, + 0}); + this.TextureXUpDown.Name = "TextureXUpDown"; + this.TextureXUpDown.ValueChanged += new System.EventHandler(this.TextureXUpDown_ValueChanged); + // + // TextureYUpDown + // + this.TextureYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.TextureYUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.TextureYUpDown, "TextureYUpDown"); + this.TextureYUpDown.Maximum = new decimal(new int[] { + 64, + 0, + 0, + 0}); + this.TextureYUpDown.Name = "TextureYUpDown"; + this.TextureYUpDown.ValueChanged += new System.EventHandler(this.TextureYUpDown_ValueChanged); + // + // PosZUpDown + // + this.PosZUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.PosZUpDown.DecimalPlaces = 1; + this.PosZUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.PosZUpDown, "PosZUpDown"); + this.PosZUpDown.Minimum = new decimal(new int[] { + 100, + 0, + 0, + -2147483648}); + this.PosZUpDown.Name = "PosZUpDown"; + this.PosZUpDown.ValueChanged += new System.EventHandler(this.PosZUpDown_ValueChanged); + // + // PosYUpDown + // + this.PosYUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.PosYUpDown.DecimalPlaces = 1; + this.PosYUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.PosYUpDown, "PosYUpDown"); + this.PosYUpDown.Minimum = new decimal(new int[] { + 100, + 0, + 0, + -2147483648}); + this.PosYUpDown.Name = "PosYUpDown"; + this.PosYUpDown.ValueChanged += new System.EventHandler(this.PosYUpDown_ValueChanged); + // + // PosXUpDown + // + this.PosXUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.PosXUpDown.DecimalPlaces = 1; + this.PosXUpDown.ForeColor = System.Drawing.SystemColors.Menu; + resources.ApplyResources(this.PosXUpDown, "PosXUpDown"); + this.PosXUpDown.Minimum = new decimal(new int[] { + 100, + 0, + 0, + -2147483648}); + this.PosXUpDown.Name = "PosXUpDown"; + this.PosXUpDown.ValueChanged += new System.EventHandler(this.PosXUpDown_ValueChanged); + // + // Part + // + resources.ApplyResources(this.Part, "Part"); + // + // X + // + resources.ApplyResources(this.X, "X"); + // + // Y + // + resources.ApplyResources(this.Y, "Y"); + // + // Z + // + resources.ApplyResources(this.Z, "Z"); + // + // Width + // + resources.ApplyResources(this.Width, "Width"); + // + // Height + // + resources.ApplyResources(this.Height, "Height"); + // + // Length + // + resources.ApplyResources(this.Length, "Length"); + // + // U + // + resources.ApplyResources(this.U, "U"); + // + // V + // + resources.ApplyResources(this.V, "V"); + // + // listViewBoxes + // + this.listViewBoxes.Activation = System.Windows.Forms.ItemActivation.OneClick; + this.listViewBoxes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Part, + this.X, + this.Y, + this.Z, + this.Width, + this.Height, + this.Length, + this.U, + this.V}); + this.listViewBoxes.ContextMenuStrip = this.contextMenuStrip1; + this.listViewBoxes.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.listViewBoxes.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewBoxes.HideSelection = false; + this.listViewBoxes.LabelEdit = true; + resources.ApplyResources(this.listViewBoxes, "listViewBoxes"); + this.listViewBoxes.MultiSelect = false; + this.listViewBoxes.Name = "listViewBoxes"; + this.listViewBoxes.UseCompatibleStateImageBehavior = false; + this.listViewBoxes.View = System.Windows.Forms.View.Details; + this.listViewBoxes.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); + this.listViewBoxes.Click += new System.EventHandler(this.listView1_Click); + this.listViewBoxes.DoubleClick += new System.EventHandler(this.listView1_DoubleClick); + this.listViewBoxes.KeyDown += new System.Windows.Forms.KeyEventHandler(this.delStuffUsingDelKey); // // generateModel // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tableLayoutPanelMain); + this.Controls.Add(this.PosZUpDown); + this.Controls.Add(this.PosYUpDown); + this.Controls.Add(this.PosXUpDown); + this.Controls.Add(this.TextureYUpDown); + this.Controls.Add(this.TextureXUpDown); + this.Controls.Add(this.SizeZUpDown); + this.Controls.Add(this.SizeYUpDown); + this.Controls.Add(this.SizeXUpDown); + this.Controls.Add(this.checkBoxArmor); + this.Controls.Add(this.checkGuide); + this.Controls.Add(this.checkTextureGenerate); + this.Controls.Add(this.buttonTemplate); + this.Controls.Add(this.displayBox); + this.Controls.Add(this.listViewBoxes); + this.Controls.Add(this.OpenJSONButton); + this.Controls.Add(this.buttonExportModel); + this.Controls.Add(this.buttonImportModel); + this.Controls.Add(this.buttonEXPORT); + this.Controls.Add(this.labelTextureMappingPreview); + this.Controls.Add(this.texturePreview); + this.Controls.Add(this.comboParent); + this.Controls.Add(this.label6); + this.Controls.Add(this.buttonIMPORT); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.label7); + this.Controls.Add(this.rotateLeftBtn); + this.Controls.Add(this.rotateRightBtn); + this.Controls.Add(this.labelView); + this.Controls.Add(this.buttonDone); + this.Controls.Add(this.label3); + this.Controls.Add(this.label5); this.MaximizeBox = false; this.Name = "generateModel"; this.Style = MetroFramework.MetroColorStyle.Silver; this.Theme = MetroFramework.MetroThemeStyle.Dark; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.generateModel_FormClosing); this.Load += new System.EventHandler(this.generateModel_Load); - this.ResizeBegin += new System.EventHandler(this.generateModel_ResizeBegin); - this.ResizeEnd += new System.EventHandler(this.generateModel_ResizeEnd); this.SizeChanged += new System.EventHandler(this.generateModel_SizeChanged); + this.contextMenuStrip1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.tabBody.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.myTablePanel2.ResumeLayout(false); this.myTablePanel2.PerformLayout(); - this.tabArmor.ResumeLayout(false); - this.myTablePanel1.ResumeLayout(false); - this.myTablePanel1.PerformLayout(); - this.contextMenuStrip1.ResumeLayout(false); - this.tableLayoutPanelMain.ResumeLayout(false); - this.tableLayoutPanelMain.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.displayBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.texturePreview)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.displayBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SizeXUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SizeYUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SizeZUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.TextureXUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.TextureYUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - - private System.Windows.Forms.Button buttonImportModel; - private System.Windows.Forms.Button buttonExportModel; - private System.Windows.Forms.PictureBox displayBox; - private System.Windows.Forms.CheckBox checkTextureGenerate; - private System.Windows.Forms.CheckBox checkGuide; - private System.Windows.Forms.Label labelView; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox textTextureY; - private System.Windows.Forms.TextBox textTextureX; - private System.Windows.Forms.Button buttonIMPORT; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Button buttonZcplus; - private System.Windows.Forms.Button buttonXcminus; - private System.Windows.Forms.Button buttonYcminus; - private System.Windows.Forms.Button buttonZcminus; - private System.Windows.Forms.Button buttonYcplus; - private System.Windows.Forms.Button buttonXcplus; - private System.Windows.Forms.Button buttonZfplus; - private System.Windows.Forms.Button buttonXfminus; - private System.Windows.Forms.Button buttonYfminus; - private System.Windows.Forms.Button buttonZfminus; - private System.Windows.Forms.Button buttonYfplus; - private System.Windows.Forms.Button buttonXfplus; - private System.Windows.Forms.Button buttonEXPORT; - private System.Windows.Forms.Label labelTextureMappingPreview; - private System.Windows.Forms.PictureBox texturePreview; - private System.Windows.Forms.Button buttonDone; - private System.Windows.Forms.TextBox textYc; - private System.Windows.Forms.TextBox textZc; - private System.Windows.Forms.TextBox textXf; - private System.Windows.Forms.TextBox textYf; - private System.Windows.Forms.TextBox textZf; - private System.Windows.Forms.TextBox textXc; - private System.Windows.Forms.Button buttonTemplate; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TextBox offsetBody; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.TextBox offsetLegs; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.TextBox offsetArms; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.TextBox offsetHead; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.ComboBox comboParent; - private System.Windows.Forms.Label labelModeParts; - private System.Windows.Forms.ListView listViewBoxes; - private System.Windows.Forms.Label label3; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem cloneToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem changeColorToolStripMenuItem; + private System.Windows.Forms.Button buttonDone; + private System.Windows.Forms.Button OpenJSONButton; + private System.Windows.Forms.Button buttonExportModel; + private System.Windows.Forms.PictureBox displayBox; + private System.Windows.Forms.Button buttonImportModel; + private System.Windows.Forms.Label labelTextureMappingPreview; + private System.Windows.Forms.PictureBox texturePreview; + private System.Windows.Forms.Button buttonIMPORT; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Button buttonEXPORT; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ComboBox comboParent; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TabControl tabBody; private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.TabPage tabArmor; - private System.Windows.Forms.CheckBox checkBoxArmor; - private System.Windows.Forms.ToolStripMenuItem changeColorToolStripMenuItem; - private System.Windows.Forms.TextBox offsetPants; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label15; - private System.Windows.Forms.TextBox offsetHelmet; - private System.Windows.Forms.Label label16; - private System.Windows.Forms.TextBox offsetBoots; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox offsetTool; - private System.Windows.Forms.Label labelTheme; - private System.Windows.Forms.ListView listViewBGs; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelMain; private Forms.MyTablePanel myTablePanel2; - private Forms.MyTablePanel myTablePanel1; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox offsetShoulder; - private System.Windows.Forms.TextBox offsetWaist; - private System.Windows.Forms.TextBox Chest; - private System.Windows.Forms.Button OpenJSONButton; + private System.Windows.Forms.TextBox offsetArms; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.TextBox offsetBody; + private System.Windows.Forms.TextBox offsetLegs; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox offsetHead; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TabPage tabArmor; + private System.Windows.Forms.Button rotateLeftBtn; + private System.Windows.Forms.Button rotateRightBtn; + private System.Windows.Forms.Label labelView; + private MetroFramework.Controls.MetroButton buttonTemplate; + private MetroFramework.Controls.MetroCheckBox checkTextureGenerate; + private MetroFramework.Controls.MetroCheckBox checkGuide; + private MetroFramework.Controls.MetroCheckBox checkBoxArmor; + private System.Windows.Forms.NumericUpDown SizeXUpDown; + private System.Windows.Forms.NumericUpDown SizeYUpDown; + private System.Windows.Forms.NumericUpDown SizeZUpDown; + private System.Windows.Forms.NumericUpDown TextureXUpDown; + private System.Windows.Forms.NumericUpDown TextureYUpDown; + private System.Windows.Forms.NumericUpDown PosZUpDown; + private System.Windows.Forms.NumericUpDown PosYUpDown; + private System.Windows.Forms.NumericUpDown PosXUpDown; + private System.Windows.Forms.ColumnHeader Part; + private System.Windows.Forms.ColumnHeader X; + private System.Windows.Forms.ColumnHeader Y; + private System.Windows.Forms.ColumnHeader Z; + private System.Windows.Forms.ColumnHeader Width; + private System.Windows.Forms.ColumnHeader Height; + private System.Windows.Forms.ColumnHeader Length; + private System.Windows.Forms.ColumnHeader U; + private System.Windows.Forms.ColumnHeader V; + private System.Windows.Forms.ListView listViewBoxes; } } \ No newline at end of file diff --git a/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.cs b/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.cs index b65275f0..f1f9924d 100644 --- a/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.cs +++ b/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.cs @@ -9,195 +9,269 @@ using System.Linq; using System.Windows.Forms; using System.Collections; using System.IO; -using Brush = System.Drawing.Brush; -using Color = System.Drawing.Color; using Newtonsoft.Json; - +using MetroFramework.Forms; +using PckStudio.Classes.FileTypes; +using System.Text.RegularExpressions; namespace PckStudio { - public partial class generateModel : MetroFramework.Forms.MetroForm + public partial class generateModel : MetroForm { PictureBox skinPreview; - Bitmap bg; - string direction; + eViewDirection direction = eViewDirection.front; - List> boxes; - - ListView storeData = new ListView(); - - bool autoTexture = true; - - Color backgroundColor = Color.Black; - - ListViewItem selected; - - //Checks if an item is selected - private void checkSelect() + enum eViewDirection { - //Deciphers wether to enable/disable things based on wether an item is selected or not - if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0] != null) + front, + back, + left, + right + } + + [Flags] + enum eANIMFlags + { + DisableArmSwinging = 1 << 0, + ZombieArms = 1 << 1, + LockFootAnimation = 1 << 2, + unk_BIT3 = 1 << 3, + unk_BIT4 = 1 << 4, + BothLegsSwingParallel = 1 << 5, + unk_BIT6 = 1 << 6, + MainArmUp = 1 << 7, + DisableArmor = 1 << 8, + unk_BIT9 = 1 << 9, + DisableHead = 1 << 10, + DisableLeftArm = 1 << 11, + DisableRightArm = 1 << 12, + DiableBody = 1 << 13, + DiableRightLeg = 1 << 14, + DiableLeftLeg = 1 << 15, + R2D2Sneak = 1 << 16, + DisableHeadOverlay = 1 << 17, + Is64x64 = 1 << 18, + HasSlimArms = 1 << 19, + DisableLeftArmOverlay = 1 << 20, + DisableRightArmOverlay = 1 << 21, + DisableLeftLegOverlay = 1 << 22, + DisableRightLegOverlay = 1 << 23, + DisableBodyOverlay = 1 << 24, + RenderUpSideDown = 1 << 31, + } + eANIMFlags ANIM = 0; + + void SetANIMFlag(eANIMFlags flag, bool state) + { + if (!state) { - textXc.Enabled = true; - textYc.Enabled = true; - textZc.Enabled = true; - textXf.Enabled = true; - textYf.Enabled = true; - textZf.Enabled = true; - textTextureX.Enabled = true; - textTextureY.Enabled = true; - buttonXcminus.Enabled = true; - buttonYcminus.Enabled = true; - buttonZcminus.Enabled = true; - buttonXcplus.Enabled = true; - buttonYcplus.Enabled = true; - buttonZcplus.Enabled = true; - buttonXfminus.Enabled = true; - buttonYfminus.Enabled = true; - buttonZfminus.Enabled = true; - buttonXfplus.Enabled = true; - buttonYfplus.Enabled = true; - buttonZfplus.Enabled = true; - comboParent.Enabled = true; + ANIM &= ~flag; return; } - textXc.Enabled = false; - textYc.Enabled = false; - textZc.Enabled = false; - textXf.Enabled = false; - textYf.Enabled = false; - textZf.Enabled = false; - textTextureX.Enabled = false; - textTextureY.Enabled = false; - buttonXcminus.Enabled = false; - buttonYcminus.Enabled = false; - buttonZcminus.Enabled = false; - buttonXcplus.Enabled = false; - buttonYcplus.Enabled = false; - buttonZcplus.Enabled = false; - buttonXfminus.Enabled = false; - buttonYfminus.Enabled = false; - buttonZfminus.Enabled = false; - buttonXfplus.Enabled = false; - buttonYfplus.Enabled = false; - buttonZfplus.Enabled = false; - comboParent.Enabled = false; + ANIM |= flag; + } + + ValueTuple ToProperty() + { + return new ValueTuple("ANIM", "0x"+ANIM.ToString("x8")); } - //Initialization - public generateModel(List> boxesIn, PictureBox preview) + PCKProperties boxes; + + Color backgroundColor = Color.FromArgb(0xff, 0x50, 0x50, 0x50); + + private static readonly string[] ValidModelBoxTypes = new string[] + { + // Base 64x32 Parts + "HEAD", + "BODY", + "ARM0", + "ARM1", + "LEG0", + "LEG1", + + // 64x64 Overlay Parts + "HEADWEAR", + "JACKET", + "SHOULDER0", + "SHOULDER1", + "SLEEVE0", + "SLEEVE1", + "PANTS0", + "PANTS1", + }; + + private static readonly string[] ValidModelOffsetTypes = new string[] + { + // Body Offsets + "HEAD", + "BODY", + "ARM0", + "ARM1", + "LEG0", + "LEG1", + + // Armor Offsets + "HELMET", + "CHEST", + "BOOT0", + "BOOT1", + "WAIST", + "PANTS0", + "PANTS1", + + "TOOL0", + "TOOL1", + }; + + List modelParts = new List(); + List modelOffsets = new List(); + + class ModelPart + { + public string Type; + public float X, Y, Z; + public float Width; + public float Height; + public float Length; + public int U, V; + + public ModelPart(string @type, float x, float y, float z, float width, float height, float length, int u, int v) + { + Type = type; + X = x; + Y = y; + Z = z; + Width = width; + Height = height; + Length = length; + U = u; + V = v; + } + + public ValueTuple ToProperty() + { + string value = $"{Type} {X} {Y} {Z} {Width} {Height} {Length} {U} {V}"; + return new ValueTuple("BOX", value); + } + + } + + class ModelOffset + { + public string Name; + public float YOffset; + + public ModelOffset(string name, float yOffset) + { + Name = name; + YOffset = yOffset; + } + public ValueTuple ToProperty() + { + string value = $"{Name} Y {YOffset}"; + return new ValueTuple("OFFSET", value); + } + } + + + public generateModel(PCKProperties skinProperties, PictureBox preview) { InitializeComponent(); - boxes = boxesIn; + boxes = skinProperties; skinPreview = preview; - direction = "front"; - bg = new Bitmap(this.displayBox.Image); buttonIMPORT.Enabled = false; buttonEXPORT.Enabled = false; - textXc.Enabled = false; - textYc.Enabled = false; - textZc.Enabled = false; - textXf.Enabled = false; - textYf.Enabled = false; - textZf.Enabled = false; - textTextureX.Enabled = false; - textTextureY.Enabled = false; - buttonXcminus.Enabled = false; - buttonYcminus.Enabled = false; - buttonZcminus.Enabled = false; - buttonXcplus.Enabled = false; - buttonYcplus.Enabled = false; - buttonZcplus.Enabled = false; - buttonXfminus.Enabled = false; - buttonYfminus.Enabled = false; - buttonZfminus.Enabled = false; - buttonXfplus.Enabled = false; - buttonYfplus.Enabled = false; - buttonZfplus.Enabled = false; - comboParent.Enabled = false; - + if (texturePreview.Image == null) + texturePreview.Image = new Bitmap(64, 64); loadData(); } + private static readonly Regex sWhitespace = new Regex(@"\s+"); + public static string ReplaceWhitespace(string input, string replacement) + { + return sWhitespace.Replace(input, replacement); + } //loads data from mode list private void loadData() { - foreach (var box in boxes) + foreach (var property in boxes) { - if (box.Item1 == "BOX") + switch (property.Item1) { - int space = 0; - string modelClass = ""; - string x = ""; - string y = ""; - string z = ""; - string xF = ""; - string yF = ""; - string zF = ""; - string xO = ""; - string yO = ""; + case "BOX": + { + string[] Format = ReplaceWhitespace(property.Item2, ",").Split(','); + if (Format.Length < 9) + { + Console.WriteLine($"'{property.Item1}' property has too few arguments: {property.Item2}"); + continue; + } + string name = Format[0]; + if (ValidModelBoxTypes.Contains(name)) + { + try + { + float x = float.Parse(Format[1]); + float y = float.Parse(Format[2]); + float z = float.Parse(Format[3]); + float sizeX = float.Parse(Format[4]); + float sizeY = float.Parse(Format[5]); + float sizeZ = float.Parse(Format[6]); + int u = int.Parse(Format[7]); + int v = int.Parse(Format[8]); + modelParts.Add(new ModelPart(name, x, y, z, sizeX, sizeY, sizeZ, u, v)); + } + catch (FormatException ex) + { + Console.WriteLine(ex.Message); + MessageBox.Show("A Format Exception was thrown\nFailed to parse BOX value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (OverflowException ex) + { + Console.WriteLine(ex.Message); + MessageBox.Show("An Overflow Exception was thrown\nFailed to parse BOX value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + if (Format.Length >= 11) + { + string unk1 = Format[9]; + string unk2 = Format[10]; + Console.WriteLine($"{unk1} | {unk2}"); + } + comboParent.Enabled = true; + break; + } - foreach (char letter in box.Item2) - { - if (letter.ToString() == " ") + case "OFFSET": { - space += 1; + string[] offset = ReplaceWhitespace(property.Item2, ",").Split(','); + if (offset.Length < 3) continue; + string name = offset[0]; + string dimension = offset[1]; // "Y" + if (dimension != "Y") continue; + float value = float.Parse(offset[2]); + if (ValidModelOffsetTypes.Contains(name)) + modelOffsets.Add(new ModelOffset(name, value)); + break; } - else if (space == 0 && letter.ToString() != " ") + case "ANIM": { - modelClass += letter; + try + { + ANIM = (eANIMFlags)int.Parse(property.Item2, System.Globalization.NumberStyles.HexNumber); + } + catch(Exception ex) + { + Console.WriteLine(ex.Message); + } + break; } - else if (space == 1 && letter.ToString() != " ") - { - x += letter.ToString(); - } - else if (space == 2 && letter.ToString() != " ") - { - y += letter.ToString(); - } - else if (space == 3 && letter.ToString() != " ") - { - z += letter.ToString(); - } - else if (space == 4 && letter.ToString() != " ") - { - xF += letter.ToString(); - } - else if (space == 5 && letter.ToString() != " ") - { - yF += letter.ToString(); - } - else if (space == 6 && letter.ToString() != " ") - { - zF += letter.ToString(); - } - else if (space == 7 && letter.ToString() != " ") - { - xO += letter.ToString(); - } - else if (space == 8 && letter.ToString() != " ") - { - yO += letter.ToString(); - } - } - - ListViewItem part = new ListViewItem(); - part.Text = "BOX"; - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, x)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, y)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, z)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, xF)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, yF)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, zF)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, xO)); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, yO)); - part.Tag = modelClass; - listViewBoxes.Items.Add(part); - comboParent.Enabled = true; } } + updateListView(); render(); } @@ -207,598 +281,471 @@ namespace PckStudio listViewBoxes.SelectedItems[0].BeginEdit(); } - - //Graphic Rendering - private void render() + // Graphic Rendering + // Builds an image based on the view + private void render(object sender = null, EventArgs e = null) { - //Disables template option if model parts exist - buttonTemplate.Enabled = listViewBoxes.Items.Count == 0; - - setZ(); //Organizes Z layers - - labelView.Text = "View: " + this.direction; //Updates Current Direction label - - try + //buttonTemplate.Enabled = listViewBoxes.Items.Count == 0; + //setZ(); //Organizes Z layers + Bitmap bitmapModelPreview = new Bitmap(displayBox.Width, displayBox.Height); //Creates Model Display layer + using (Graphics graphics = Graphics.FromImage(bitmapModelPreview)) { - Bitmap bitmapModelPreview = new Bitmap(this.displayBox.Width, this.displayBox.Height); //Creates Model Display layer - using (Graphics graphics = Graphics.FromImage((Image)bitmapModelPreview)) + graphics.Clear(backgroundColor); + graphics.InterpolationMode = InterpolationMode.NearestNeighbor; + // makes sure it reders/draws the full pixel in top left corner + graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; + int headbodyY = (displayBox.Height / 2) + 25; // 25 + int armY = (displayBox.Height / 2) + 35; // -60; + int legY = (displayBox.Height / 2) + 85; // -80; + int groundLevel = (displayBox.Height / 2) + 145; + graphics.DrawLine(Pens.White, 0, groundLevel, displayBox.Width, groundLevel); + // Chooses Render settings based on current direction + foreach (ListViewItem listViewItem in listViewBoxes.Items) { - graphics.Clear(backgroundColor); - int headbodyY = (displayBox.Height / 2) + 25;//25 - int armY = (displayBox.Height / 2) + 35;// - 60; - int legY = (displayBox.Height / 2) + 85;// - 80; - int groundLevel = (displayBox.Height / 2) + 145; - graphics.DrawLine(Pens.White, 0, groundLevel, displayBox.Width, groundLevel); - - //Chooses Render settings based on current direction - if (this.direction == "front") + if (!(listViewItem.Tag is ModelPart)) continue; + ModelPart part = listViewItem.Tag as ModelPart; + int x = displayBox.Width / 2; + int y = 0; + switch (direction) { - //Generates Guidelines if enabled - if (this.checkGuide.Checked) - { - try - { - graphics.DrawLine(Pens.Red, displayBox.Width / 2, 0, displayBox.Width / 2, displayBox.Height); - graphics.DrawLine(Pens.Blue, (displayBox.Width / 2) + 30, 0, (displayBox.Width / 2) + 30, displayBox.Height); - graphics.DrawLine(Pens.Blue, (displayBox.Width / 2) - 30, 0, (displayBox.Width / 2) - 30, displayBox.Height); - graphics.DrawLine(Pens.Purple, (displayBox.Width / 2) - 10, 0, (displayBox.Width / 2) - 10, displayBox.Height); - graphics.DrawLine(Pens.Purple, (displayBox.Width / 2) + 10, 0, (displayBox.Width / 2) + 10, displayBox.Height); - graphics.DrawLine(Pens.Red, 0, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5); - graphics.DrawLine(Pens.Green, 0, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5); - graphics.DrawLine(Pens.Blue, 0, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5); - graphics.DrawLine(Pens.Purple, 0, legY + (float)double.Parse(this.offsetLegs.Text) * 5, displayBox.Width, legY + (float)double.Parse(this.offsetLegs.Text) * 5); - } - catch (Exception) - { - - } - } - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) //Individually draws each model part/item - { - int x = 0; - int y = 0; - try + case eViewDirection.front: { //Sets X & Y based on model part class - if (listViewItem.Tag.ToString() == "HEAD") + // listViewItem.Text -> part.Type + // listViewItem.SubItems[1] -> part.X + // listViewItem.SubItems[2] -> part.Y + // listViewItem.SubItems[3] -> part.Z + // listViewItem.SubItems[4] -> part.Width + // listViewItem.SubItems[5] -> part.Height + // listViewItem.SubItems[6] -> part.Length + // listViewItem.SubItems[7] -> part.U + // listViewItem.SubItems[8] -> part.V + switch (part.Type) { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetHead.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "BODY") - { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetBody.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM0") - { - x = (displayBox.Width / 2) - 25; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM1") - { - x = (displayBox.Width / 2) + 25; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG0") - { - x = (displayBox.Width / 2) - 10; - y = legY + int.Parse(this.offsetLegs.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG1") - { - x = (displayBox.Width / 2) + 10; - y = legY + int.Parse(this.offsetLegs.Text) * 5; + case "HEAD": + y = headbodyY + int.Parse(offsetHead.Text) * 5; + break; + case "BODY": + y = headbodyY + int.Parse(offsetBody.Text) * 5; + break; + + case "ARM0": + x -= 25; + y = armY + int.Parse(offsetArms.Text) * 5; + break; + + case "ARM1": + x += 25; + y = armY + int.Parse(offsetArms.Text) * 5; + break; + + case "LEG0": + x -= 10; + y = legY + int.Parse(offsetLegs.Text) * 5; + break; + + case "LEG1": + x += 10; + y = legY + int.Parse(offsetLegs.Text) * 5; + break; } + //Maps imported Texture if auto texture is disabled - if (autoTexture != true) + if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - (float)(x + (float)double.Parse(listViewItem.SubItems[1].Text) * 5), - (float)(y + (float)double.Parse(listViewItem.SubItems[2].Text) * 5), - (float)((float)double.Parse(listViewItem.SubItems[4].Text) * 5), - (float)((float)double.Parse(listViewItem.SubItems[5].Text) * 5)); + x + part.X * 5, + y + part.Y * 5, + part.Width * 5, + part.Height * 5); RectangleF srcRect = new RectangleF( - (float)((float)double.Parse(listViewItem.SubItems[7].Text) + - (float)double.Parse(listViewItem.SubItems[6].Text)), - (float)((float)double.Parse(listViewItem.SubItems[8].Text) + - (float)double.Parse(listViewItem.SubItems[6].Text)), - (float)(float)double.Parse(listViewItem.SubItems[4].Text), - (float)(float)double.Parse(listViewItem.SubItems[5].Text)); - graphics.InterpolationMode = InterpolationMode.NearestNeighbor; + part.U + part.Length, + part.V + part.Length, + part.Width, + part.Height); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { - //Draws Part - graphics.FillRectangle((Brush)new SolidBrush(listViewItem.ForeColor), x + (float)double.Parse(listViewItem.SubItems[1].Text) * 5, y + (float)double.Parse(listViewItem.SubItems[2].Text) * 5, (float)double.Parse(listViewItem.SubItems[4].Text) * 5, (float)double.Parse(listViewItem.SubItems[5].Text) * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.X * 5, y + part.Y * 5, part.Width * 5, part.Height * 5); } - //Draws Armor Offsets - if (checkBoxArmor.Checked == true) - { - SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(80, 50, 50, 75)); - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, headbodyY - 40 + (float)double.Parse(this.offsetHelmet.Text) * 5, 40, 40);//Helmet - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 35, armY + 45 + (float)double.Parse(this.offsetTool.Text) * 5, 10, 10);//Tool0 - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) + 25, armY + 45 + (float)double.Parse(this.offsetTool.Text) * 5, 10, 10);//Tool1 - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, legY + (float)double.Parse(this.offsetPants.Text) * 5, 20, 40);//Pants0 - graphics.FillRectangle(semiTransBrush, displayBox.Width / 2, legY + (float)double.Parse(this.offsetPants.Text) * 5, 20, 40);//Pants1 - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, legY + 40 + (float)double.Parse(this.offsetBoots.Text) * 5, 20, 20);//Boot0 - graphics.FillRectangle(semiTransBrush, displayBox.Width / 2, legY + 40 + (float)double.Parse(this.offsetBoots.Text) * 5, 20, 20);//Boot1 - } + break; + } - //Highlights selected item shape in preview window - if (listViewItem.Index == selected.Index) - { - graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[1].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[4].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); - graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[1].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[4].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); - } - } - catch (Exception ex) - { - } - } - } - else if (this.direction == "left") - { - //Generates Guidelines if enabled - if (this.checkGuide.Checked) - { - try - { - graphics.DrawLine(Pens.Red, displayBox.Width / 2, 0, displayBox.Width / 2, displayBox.Height); - graphics.DrawLine(Pens.Red, 0, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5); - graphics.DrawLine(Pens.Green, 0, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5); - graphics.DrawLine(Pens.Blue, 0, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5); - graphics.DrawLine(Pens.Purple, 0, legY + (float)double.Parse(this.offsetLegs.Text) * 5, displayBox.Width, legY + (float)double.Parse(this.offsetLegs.Text) * 5); - } - catch (Exception) - { - - } - } - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - { - int x = 0; - int y = 0; - try + case eViewDirection.left: { //Sets X & Y based on model part class - if (listViewItem.Tag.ToString() == "HEAD") + switch (part.Type) { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetHead.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "BODY") - { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetBody.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM0") - { - x = displayBox.Width / 2; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM1") - { - x = displayBox.Width / 2; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG0") - { - x = displayBox.Width / 2; - y = legY + int.Parse(this.offsetLegs.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG1") - { - x = displayBox.Width / 2; - y = legY + int.Parse(this.offsetLegs.Text) * 5; - } - //Maps imported Texture if auto texture is disabled - if (autoTexture != true) - { - RectangleF destRect = new RectangleF( - (float)(x + double.Parse(listViewItem.SubItems[3].Text) * 5), - (float)(y + double.Parse(listViewItem.SubItems[2].Text) * 5), - (float)(double.Parse(listViewItem.SubItems[6].Text) * 5), - (float)(double.Parse(listViewItem.SubItems[5].Text) * 5)); - RectangleF srcRect = new RectangleF((float)double.Parse(listViewItem.SubItems[7].Text) + (float)double.Parse(listViewItem.SubItems[6].Text) + (float)double.Parse(listViewItem.SubItems[4].Text), - (float)(double.Parse(listViewItem.SubItems[8].Text) + double.Parse(listViewItem.SubItems[6].Text)), - (float)double.Parse(listViewItem.SubItems[6].Text), - (float)double.Parse(listViewItem.SubItems[5].Text)); - graphics.InterpolationMode = InterpolationMode.NearestNeighbor; - graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); - } - else - { - //Draws Part - graphics.FillRectangle((Brush)new SolidBrush(listViewItem.ForeColor), x + (float)double.Parse(listViewItem.SubItems[3].Text) * 5, y + (float)double.Parse(listViewItem.SubItems[2].Text) * 5, (float)double.Parse(listViewItem.SubItems[6].Text) * 5, (float)double.Parse(listViewItem.SubItems[5].Text) * 5); - } + case "HEAD": + y = headbodyY + int.Parse(offsetHead.Text) * 5; + break; - //Draws Armor Offsets - if (checkBoxArmor.Checked == true) - { - SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(80, 50, 50, 75)); - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, headbodyY - 40 + (float)double.Parse(this.offsetHelmet.Text) * 5, 40, 40);//Helmet - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 5, armY + 45 + (float)double.Parse(this.offsetTool.Text) * 5, 10, 10);//Tools - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 10, legY + (float)double.Parse(this.offsetPants.Text) * 5, 20, 40);//Pants - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 10, legY + 40 + (float)double.Parse(this.offsetBoots.Text) * 5, 20, 20);//Boots - } + case "BODY": + y = headbodyY + int.Parse(offsetBody.Text) * 5; + break; - //Highlights selected item shape in preview window - if (listViewItem.Index == this.selected.Index) - { - graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[6].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); - graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[6].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); - } - } - catch (Exception ex) - { - } - } - bitmapModelPreview.RotateFlip(RotateFlipType.RotateNoneFlipX); - } - else if (this.direction == "back") - { - //Generates Guidelines if enabled - if (this.checkGuide.Checked) - { - try - { - graphics.DrawLine(Pens.Red, displayBox.Width / 2, 0, displayBox.Width / 2, displayBox.Height); - graphics.DrawLine(Pens.Blue, (displayBox.Width / 2) + 30, 0, (displayBox.Width / 2) + 30, displayBox.Height); - graphics.DrawLine(Pens.Blue, (displayBox.Width / 2) - 30, 0, (displayBox.Width / 2) - 30, displayBox.Height); - graphics.DrawLine(Pens.Purple, (displayBox.Width / 2) - 10, 0, (displayBox.Width / 2) - 10, displayBox.Height); - graphics.DrawLine(Pens.Purple, (displayBox.Width / 2) + 10, 0, (displayBox.Width / 2) + 10, displayBox.Height); - graphics.DrawLine(Pens.Red, 0, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5); - graphics.DrawLine(Pens.Green, 0, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5); - graphics.DrawLine(Pens.Blue, 0, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5); - graphics.DrawLine(Pens.Purple, 0, legY + (float)double.Parse(this.offsetLegs.Text) * 5, displayBox.Width, legY + (float)double.Parse(this.offsetLegs.Text) * 5); - } - catch (Exception) - { + case "ARM0": + y = armY + int.Parse(offsetArms.Text) * 5; + break; - } - } - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - { - int x = 0; - int y = 0; - try - { - //Sets X & Y based on model part class - if (listViewItem.Tag.ToString() == "HEAD") - { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetHead.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "BODY") - { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetBody.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM0") - { - x = (displayBox.Width / 2) - 25; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM1") - { - x = (displayBox.Width / 2) + 25; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG0") - { - x = (displayBox.Width / 2) - 10; - y = legY + int.Parse(this.offsetLegs.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG1") - { - x = (displayBox.Width / 2) + 10; - y = legY + int.Parse(this.offsetLegs.Text) * 5; + case "ARM1": + y = armY + int.Parse(offsetArms.Text) * 5; + break; + + case "LEG0": + y = legY + int.Parse(offsetLegs.Text) * 5; + break; + + case "LEG1": + y = legY + int.Parse(offsetLegs.Text) * 5; + break; } //Maps imported Texture if auto texture is disabled - if (autoTexture != true) + if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - (float)(x + (float)double.Parse(listViewItem.SubItems[1].Text) * 5), - (float)(y + (float)double.Parse(listViewItem.SubItems[2].Text) * 5), - (float)((float)double.Parse(listViewItem.SubItems[4].Text) * 5), - (float)((float)double.Parse(listViewItem.SubItems[5].Text) * 5)); + x + part.Z * 5, + y + part.Y * 5, + part.Length * 5, + part.Height * 5); RectangleF srcRect = new RectangleF( - (float)((float)double.Parse(listViewItem.SubItems[7].Text) + - (float)double.Parse(listViewItem.SubItems[6].Text) + - (float)double.Parse(listViewItem.SubItems[4].Text) + - (float)double.Parse(listViewItem.SubItems[6].Text)), - (float)((float)double.Parse(listViewItem.SubItems[8].Text) + - (float)double.Parse(listViewItem.SubItems[6].Text)), - (float)(float)double.Parse(listViewItem.SubItems[4].Text), - (float)(float)double.Parse(listViewItem.SubItems[5].Text)); - graphics.InterpolationMode = InterpolationMode.NearestNeighbor; + part.U + part.Length + part.Width, + part.V + part.Length, + part.Length, + part.Height); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { //Draws Part - graphics.FillRectangle((Brush)new SolidBrush(listViewItem.ForeColor), x + (float)double.Parse(listViewItem.SubItems[1].Text) * 5, y + (float)double.Parse(listViewItem.SubItems[2].Text) * 5, (float)double.Parse(listViewItem.SubItems[4].Text) * 5, (float)double.Parse(listViewItem.SubItems[5].Text) * 5); - } - - //Draws Armor Offsets - if (checkBoxArmor.Checked == true) - { - SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(80, 50, 50, 75)); - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, headbodyY - 40 + (float)double.Parse(this.offsetHelmet.Text) * 5, 40, 40);//Helmet - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 35, armY + 45 + (float)double.Parse(this.offsetTool.Text) * 5, 10, 10);//Tool0 - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) + 25, armY + 45 + (float)double.Parse(this.offsetTool.Text) * 5, 10, 10);//Tool1 - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, legY + (float)double.Parse(this.offsetPants.Text) * 5, 20, 40);//Pants0 - graphics.FillRectangle(semiTransBrush, displayBox.Width / 2, legY + (float)double.Parse(this.offsetPants.Text) * 5, 20, 40);//Pants1 - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, legY + 40 + (float)double.Parse(this.offsetBoots.Text) * 5, 20, 20);//Boot0 - graphics.FillRectangle(semiTransBrush, displayBox.Width / 2, legY + 40 + (float)double.Parse(this.offsetBoots.Text) * 5, 20, 20);//Boot1 - } - - //Highlights selected item shape in preview window - if (listViewItem.Index == this.selected.Index) - { - graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[1].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[4].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); - graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[1].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[4].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Z * 5, y + part.Y * 5, part.Length * 5, part.Height * 5); } + bitmapModelPreview.RotateFlip(RotateFlipType.RotateNoneFlipX); + break; } - catch (Exception ex) - { - } - } - bitmapModelPreview.RotateFlip(RotateFlipType.RotateNoneFlipX); - } - else if (this.direction == "right") - { - //Generates Guidelines if enabled - if (this.checkGuide.Checked) - { - try - { - graphics.DrawLine(Pens.Red, displayBox.Width / 2, 0, displayBox.Width / 2, displayBox.Height); - graphics.DrawLine(Pens.Red, 0, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetHead.Text) * 5); - graphics.DrawLine(Pens.Green, 0, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetBody.Text) * 5); - graphics.DrawLine(Pens.Blue, 0, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5, displayBox.Width, headbodyY + (float)double.Parse(this.offsetArms.Text) * 5); - graphics.DrawLine(Pens.Purple, 0, legY + (float)double.Parse(this.offsetLegs.Text) * 5, displayBox.Width, legY + (float)double.Parse(this.offsetLegs.Text) * 5); - } - catch (Exception) - { - - } - } - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - { - int x = 0; - int y = 0; - try + case eViewDirection.back: { //Sets X & Y based on model part class - if (listViewItem.Tag.ToString() == "HEAD") + switch (part.Type) { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetHead.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "BODY") - { - x = displayBox.Width / 2; - y = headbodyY + int.Parse(this.offsetBody.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM0") - { - x = displayBox.Width / 2; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM1") - { - x = displayBox.Width / 2; - y = armY + int.Parse(this.offsetArms.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG0") - { - x = displayBox.Width / 2; - y = legY + int.Parse(this.offsetLegs.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG1") - { - x = displayBox.Width / 2; - y = legY + int.Parse(this.offsetLegs.Text) * 5; + case "HEAD": + y = headbodyY + int.Parse(offsetHead.Text) * 5; + break; + case "BODY": + y = headbodyY + int.Parse(offsetBody.Text) * 5; + break; + case "ARM0": + x -= 25; + y = armY + int.Parse(offsetArms.Text) * 5; + break; + case "ARM1": + x += 25; + y = armY + int.Parse(offsetArms.Text) * 5; + break; + case "LEG0": + x -= 10; + y = legY + int.Parse(offsetLegs.Text) * 5; + break; + case "LEG1": + x += 10; + y = legY + int.Parse(offsetLegs.Text) * 5; + break; } + //Maps imported Texture if auto texture is disabled - if (autoTexture != true) + if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - (float)(x + double.Parse(listViewItem.SubItems[3].Text) * 5), - (float)(y + double.Parse(listViewItem.SubItems[2].Text) * 5), - (float)(double.Parse(listViewItem.SubItems[6].Text) * 5), - (float)(double.Parse(listViewItem.SubItems[5].Text) * 5)); + x + part.X * 5, + y + part.Y * 5, + part.Width * 5, + part.Height * 5); RectangleF srcRect = new RectangleF( - (float)(double.Parse(listViewItem.SubItems[7].Text) + - double.Parse(listViewItem.SubItems[6].Text) + - double.Parse(listViewItem.SubItems[4].Text)), - (float)(double.Parse(listViewItem.SubItems[8].Text) + - double.Parse(listViewItem.SubItems[6].Text)), - (float)double.Parse(listViewItem.SubItems[6].Text), - (float)double.Parse(listViewItem.SubItems[5].Text)); - graphics.InterpolationMode = InterpolationMode.NearestNeighbor; + part.U + part.Length * 2 + part.Width, + part.V + part.Length, + part.Width, + part.Height); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { //Draws Part - graphics.FillRectangle((Brush)new SolidBrush(listViewItem.ForeColor), x + (float)double.Parse(listViewItem.SubItems[3].Text) * 5, y + (float)double.Parse(listViewItem.SubItems[2].Text) * 5, (float)double.Parse(listViewItem.SubItems[6].Text) * 5, (float)double.Parse(listViewItem.SubItems[5].Text) * 5); - } - - //Draws Armor Offsets - if (checkBoxArmor.Checked == true) - { - SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(80, 50, 50, 75)); - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 20, headbodyY - 40 + (float)double.Parse(this.offsetHelmet.Text) * 5, 40, 40);//Helmet - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 5, armY + 45 + (float)double.Parse(this.offsetTool.Text) * 5, 10, 10);//Tools - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 10, legY + (float)double.Parse(this.offsetPants.Text) * 5, 20, 40);//Pants - graphics.FillRectangle(semiTransBrush, (displayBox.Width / 2) - 10, legY + 40 + (float)double.Parse(this.offsetBoots.Text) * 5, 20, 20);//Boots - } - - //Highlights selected item shape in preview window - if (listViewItem.Index == this.selected.Index) - { - graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[6].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); - graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[6].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.X * 5, y + part.Y * 5, part.Width * 5, part.Height * 5); } + bitmapModelPreview.RotateFlip(RotateFlipType.RotateNoneFlipX); + break; } - catch (Exception ex) + + case eViewDirection.right: + //Sets X & Y based on model part class + switch (part.Type) { + case "HEAD": + y = headbodyY + int.Parse(offsetHead.Text) * 5; + break; + case "BODY": + y = headbodyY + int.Parse(offsetBody.Text) * 5; + break; + + case "ARM0": + y = armY + int.Parse(offsetArms.Text) * 5; + break; + case "ARM1": + y = armY + int.Parse(offsetArms.Text) * 5; + break; + + case "LEG0": + y = legY + int.Parse(offsetLegs.Text) * 5; + break; + + case "LEG1": + y = legY + int.Parse(offsetLegs.Text) * 5; + break; } - } - } - graphics.Dispose(); - } - displayBox.Image = (Image)bitmapModelPreview;//Sets created preview graphics to display box - } - catch (Exception) - { - return; - } - //Auto Generates Texture if enabled - if (autoTexture == true) - { - Bitmap bitmapAutoTexture = new Bitmap(texturePreview.Width, texturePreview.Height); - using (Graphics graphics = Graphics.FromImage((Image)bitmapAutoTexture)) - { - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - { - try - { - double.Parse(listViewItem.SubItems[1].Text); - double.Parse(listViewItem.SubItems[2].Text); - double.Parse(listViewItem.SubItems[3].Text); - double width = (float)double.Parse(listViewItem.SubItems[4].Text) * 2; - double height = (float)double.Parse(listViewItem.SubItems[5].Text) * 2; - double num = (float)double.Parse(listViewItem.SubItems[6].Text) * 2; - double x = (float)double.Parse(listViewItem.SubItems[7].Text) * 2; - double y = (float)double.Parse(listViewItem.SubItems[8].Text) * 2; - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x + num), (float)y, (float)(width), (float)(num)); - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x + num + width), (float)y, (float)width, (float)num); - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x), (float)(y) + (float)(num), (float)(num), (float)(height)); - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x) + (float)(num), (float)(y) + (float)(num), (float)(width), (float)(height)); - if (listViewItem.Tag.ToString() != "HEAD") + //Maps imported Texture if auto texture is disabled + if (!checkTextureGenerate.Checked) { - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x) + (float)(num) + (float)(width), (float)(y) + (float)(num), (float)(width), (float)(height)); - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x) + (float)(num) + (float)(width) + (float)(width), (float)(y) + (float)(num), (float)(num), (float)(height)); + RectangleF destRect = new RectangleF( + x + part.Z * 5, + y + part.Y * 5, + part.Length * 5, + part.Height * 5); + RectangleF srcRect = new RectangleF( + part.U + part.Length + part.Width, + part.V + part.Length, + part.Length, + part.Height); + graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x) + (float)(num) + (float)(width) + (float)(width), (float)(y) + (float)(num), (float)(num), (float)(height)); - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), (float)(x) + (float)(num) + (float)(width), (float)(y) + (float)(num), (float)(width), (float)(height)); + //Draws Part + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Z * 5, y + part.Y * 5, part.Length * 5, part.Height * 5); } - } - catch - { - } + break; } - graphics.Dispose(); - } - texturePreview.Image = (Image)bitmapAutoTexture; - } - checkSelect(); //checks to see if an item is selected - //Checks to make sure each item has been properly set up - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - { - try - { - buttonDone.Enabled = !(listViewItem.Tag == null); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); } + + if (checkBoxArmor.Checked) + DrawArmorOffsets(graphics); + // draw last to be on top + if (checkGuide.Checked) + DrawGuideLines(graphics); } + displayBox.Image = bitmapModelPreview; // Sets created preview graphics to display box } + private void MapTexture() + { + if (checkTextureGenerate.Checked) + { + Bitmap bitmapAutoTexture = new Bitmap(texturePreview.Width, texturePreview.Height); + using (Graphics graphics = Graphics.FromImage(bitmapAutoTexture)) + { + foreach (var part in modelParts) + { + float width = part.Width * 2; + float height = part.Height * 2; + float length = part.Length * 2; + int u = part.U * 2; + int v = part.V * 2; + Random r = new Random(); + Brush brush = new SolidBrush(Color.FromArgb(r.Next(int.MinValue, int.MaxValue))); + graphics.FillRectangle(brush, u + length, v, width, length); + graphics.FillRectangle(brush, u + length + width, v, width, length); + graphics.FillRectangle(brush, u, length + v, length, height); + graphics.FillRectangle(brush, u + length, v + length, width, height); + graphics.FillRectangle(brush, u + length + width, v + length, width, height); + graphics.FillRectangle(brush, u + length + width * 2, v + length, length, height); + } + } + texturePreview.Image = bitmapAutoTexture; + } + } //Checks and sets Z layering private void setZ() { - try + foreach (ListViewItem listViewItem in listViewBoxes.Items) + listViewItem.SubItems.Add("unchecked"); + + if (direction == eViewDirection.front) { - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - listViewItem.SubItems.Add("unchecked"); - - if (listViewBoxes.SelectedItems.Count != 0) + int checkedItems = 0; + do { - selected = listViewBoxes.SelectedItems[0]; - } - else - { - selected = null; - } - - if (this.direction == "front") - { - int checkedItems = 0; - do + foreach (ListViewItem listViewItemCurrent in listViewBoxes.Items) { - foreach (ListViewItem listViewItemCurrent in this.listViewBoxes.Items) + if (listViewItemCurrent.SubItems[9].Text == "unchecked") { - if (listViewItemCurrent.SubItems[9].Text == "unchecked") + int x = 0; + if (listViewItemCurrent.Tag.ToString() == "HEAD") + x = displayBox.Width / 2; + else if (listViewItemCurrent.Tag.ToString() == "BODY") + x = displayBox.Width / 2; + else if (listViewItemCurrent.Tag.ToString() == "ARM0") + x = 178; + else if (listViewItemCurrent.Tag.ToString() == "ARM1") + x = 228; + else if (listViewItemCurrent.Tag.ToString() == "LEG0") + x = 193; + else if (listViewItemCurrent.Tag.ToString() == "LEG1") + x = 213; + bool flag = false; + int index = listViewItemCurrent.Index; + foreach (ListViewItem listViewItemComparing in listViewBoxes.Items) { - int x = 0; - if (listViewItemCurrent.Tag.ToString() == "HEAD") - x = displayBox.Width / 2; - else if (listViewItemCurrent.Tag.ToString() == "BODY") - x = displayBox.Width / 2; - else if (listViewItemCurrent.Tag.ToString() == "ARM0") - x = 178; - else if (listViewItemCurrent.Tag.ToString() == "ARM1") - x = 228; - else if (listViewItemCurrent.Tag.ToString() == "LEG0") - x = 193; - else if (listViewItemCurrent.Tag.ToString() == "LEG1") - x = 213; - bool flag = false; - int index = listViewItemCurrent.Index; - foreach (ListViewItem listViewItemComparing in this.listViewBoxes.Items) + if (listViewItemComparing.SubItems[9].Text == "unchecked" && (int)double.Parse(listViewItemCurrent.SubItems[3].Text) + (int)double.Parse(listViewItemCurrent.SubItems[6].Text) < (int)double.Parse(listViewItemComparing.SubItems[3].Text) + (int)double.Parse(listViewItemComparing.SubItems[6].Text)) { - if (listViewItemComparing.SubItems[9].Text == "unchecked" && (int)double.Parse(listViewItemCurrent.SubItems[3].Text) + (int)double.Parse(listViewItemCurrent.SubItems[6].Text) < (int)double.Parse(listViewItemComparing.SubItems[3].Text) + (int)double.Parse(listViewItemComparing.SubItems[6].Text)) + if (listViewItemComparing.Index < listViewBoxes.Items.Count + 1) { - if (listViewItemComparing.Index < this.listViewBoxes.Items.Count + 1) - { - index = listViewItemComparing.Index + 1; - flag = true; - } + index = listViewItemComparing.Index + 1; + flag = true; } } - listViewItemCurrent.SubItems[9].Text = "checked"; - checkedItems += 1; - if (flag == true) - { - ListViewItem listViewItem2 = (ListViewItem)listViewItemCurrent.Clone(); - this.listViewBoxes.Items.Insert(index, listViewItem2); - if (listViewBoxes.SelectedItems.Count != 0) - { - if (selected.Index == listViewItemCurrent.Index) - { - selected = listViewItem2; - } - } - listViewItemCurrent.Remove(); - } } - else + listViewItemCurrent.SubItems[9].Text = "checked"; + checkedItems += 1; + if (flag == true) { - checkedItems += 1; + ListViewItem listViewItem2 = (ListViewItem)listViewItemCurrent.Clone(); + listViewBoxes.Items.Insert(index, listViewItem2); + listViewItemCurrent.Remove(); } } - } while (checkedItems < listViewBoxes.Items.Count); - } - else if (this.direction == "left") + else + { + checkedItems += 1; + } + } + } while (checkedItems < listViewBoxes.Items.Count); + } + else if (direction == eViewDirection.left) + { + int checkedItems = 0; + do + { + foreach (ListViewItem listViewItem1 in listViewBoxes.Items) + { + if (listViewItem1.SubItems[listViewItem1.SubItems.Count - 1].Text == "unchecked") + { + int x = 0; + if (listViewItem1.Tag.ToString() == "HEAD") + x = displayBox.Width / 2; + else if (listViewItem1.Tag.ToString() == "BODY") + x = displayBox.Width / 2; + else if (listViewItem1.Tag.ToString() == "ARM0") + x = 178; + else if (listViewItem1.Tag.ToString() == "ARM1") + x = 228; + else if (listViewItem1.Tag.ToString() == "LEG0") + x = 193; + else if (listViewItem1.Tag.ToString() == "LEG1") + x = 213; + bool flag = false; + int index = listViewItem1.Index; + foreach (ListViewItem listViewItem2 in listViewBoxes.Items) + { + if (listViewItem2.SubItems[9].Text == "unchecked") + { + int y = 0; + if (listViewItem2.Tag.ToString() == "HEAD") + y = displayBox.Width / 2; + else if (listViewItem2.Tag.ToString() == "BODY") + y = displayBox.Width / 2; + else if (listViewItem2.Tag.ToString() == "ARM0") + y = 178; + else if (listViewItem2.Tag.ToString() == "ARM1") + y = 228; + else if (listViewItem2.Tag.ToString() == "LEG0") + y = 193; + else if (listViewItem2.Tag.ToString() == "LEG1") + y = 213; + if ((int)double.Parse(listViewItem1.SubItems[1].Text) + (int)double.Parse(listViewItem1.SubItems[4].Text) + x < (int)double.Parse(listViewItem2.SubItems[1].Text) + (int)double.Parse(listViewItem2.SubItems[4].Text) + y && listViewItem2.Index + 1 < this.listViewBoxes.Items.Count + 1) + { + index = listViewItem2.Index + 1; + flag = true; + } + } + } + listViewItem1.SubItems[9].Text = "checked"; + checkedItems += 1; + if (flag == true) + { + ListViewItem listViewItem2 = (ListViewItem)listViewItem1.Clone(); + listViewBoxes.Items.Insert(index, listViewItem2); + if (listViewBoxes.SelectedItems.Count != 0) + { + //if (selected.Index == listViewItem1.Index) + //{ + // selected = listViewItem2; + //} + } + listViewItem1.Remove(); + } + } + else + { + checkedItems += 1; + } + } + } while (checkedItems < listViewBoxes.Items.Count); + } + else if (direction == eViewDirection.back) + { + int checkedItems = 0; + do + { + foreach (ListViewItem listViewItemCurrent in this.listViewBoxes.Items) + { + if (listViewItemCurrent.SubItems[listViewItemCurrent.SubItems.Count - 1].Text == "unchecked") + { + bool flag = false; + int index = listViewItemCurrent.Index; + foreach (ListViewItem listViewItemComparing in this.listViewBoxes.Items) + { + if (listViewItemComparing.SubItems[9].Text == "unchecked" && (int)double.Parse(listViewItemCurrent.SubItems[3].Text) + (int)double.Parse(listViewItemCurrent.SubItems[6].Text) > (int)double.Parse(listViewItemComparing.SubItems[3].Text) + (int)double.Parse(listViewItemComparing.SubItems[6].Text)) + { + if (listViewItemComparing.Index < this.listViewBoxes.Items.Count + 1) + { + index = listViewItemComparing.Index + 1; + flag = true; + } + } + } + listViewItemCurrent.SubItems[9].Text = "checked"; + checkedItems += 1; + if (flag == true) + { + ListViewItem listViewItem2 = (ListViewItem)listViewItemCurrent.Clone(); + listViewBoxes.Items.Insert(index, listViewItem2); + if (listViewBoxes.SelectedItems.Count != 0) + { + //if (selected.Index == listViewItemCurrent.Index) + //{ + // selected = listViewItem2; + //} + } + listViewItemCurrent.Remove(); + } + } + else + { + checkedItems += 1; + } + } + } while (checkedItems < listViewBoxes.Items.Count); + } + else if (direction == eViewDirection.right) { int checkedItems = 0; do { - foreach (ListViewItem listViewItem1 in this.listViewBoxes.Items) + foreach (ListViewItem listViewItem1 in listViewBoxes.Items) { if (listViewItem1.SubItems[listViewItem1.SubItems.Count - 1].Text == "unchecked") { @@ -817,123 +764,7 @@ namespace PckStudio x = 213; bool flag = false; int index = listViewItem1.Index; - foreach (ListViewItem listViewItem2 in this.listViewBoxes.Items) - { - if (listViewItem2.SubItems[9].Text == "unchecked") - { - int y = 0; - if (listViewItem2.Tag.ToString() == "HEAD") - y = displayBox.Width / 2; - else if (listViewItem2.Tag.ToString() == "BODY") - y = displayBox.Width / 2; - else if (listViewItem2.Tag.ToString() == "ARM0") - y = 178; - else if (listViewItem2.Tag.ToString() == "ARM1") - y = 228; - else if (listViewItem2.Tag.ToString() == "LEG0") - y = 193; - else if (listViewItem2.Tag.ToString() == "LEG1") - y = 213; - if ((int)double.Parse(listViewItem1.SubItems[1].Text) + (int)double.Parse(listViewItem1.SubItems[4].Text) + x < (int)double.Parse(listViewItem2.SubItems[1].Text) + (int)double.Parse(listViewItem2.SubItems[4].Text) + y && listViewItem2.Index + 1 < this.listViewBoxes.Items.Count + 1) - { - index = listViewItem2.Index + 1; - flag = true; - } - } - } - listViewItem1.SubItems[9].Text = "checked"; - checkedItems += 1; - if (flag == true) - { - ListViewItem listViewItem2 = (ListViewItem)listViewItem1.Clone(); - this.listViewBoxes.Items.Insert(index, listViewItem2); - if (listViewBoxes.SelectedItems.Count != 0) - { - if (selected.Index == listViewItem1.Index) - { - selected = listViewItem2; - } - } - listViewItem1.Remove(); - } - } - else - { - checkedItems += 1; - } - } - } while (checkedItems < listViewBoxes.Items.Count); - } - else if (this.direction == "back") - { - int checkedItems = 0; - do - { - foreach (ListViewItem listViewItemCurrent in this.listViewBoxes.Items) - { - if (listViewItemCurrent.SubItems[listViewItemCurrent.SubItems.Count - 1].Text == "unchecked") - { - bool flag = false; - int index = listViewItemCurrent.Index; - foreach (ListViewItem listViewItemComparing in this.listViewBoxes.Items) - { - if (listViewItemComparing.SubItems[9].Text == "unchecked" && (int)double.Parse(listViewItemCurrent.SubItems[3].Text) + (int)double.Parse(listViewItemCurrent.SubItems[6].Text) > (int)double.Parse(listViewItemComparing.SubItems[3].Text) + (int)double.Parse(listViewItemComparing.SubItems[6].Text)) - { - if (listViewItemComparing.Index < this.listViewBoxes.Items.Count + 1) - { - index = listViewItemComparing.Index + 1; - flag = true; - } - } - } - listViewItemCurrent.SubItems[9].Text = "checked"; - checkedItems += 1; - if (flag == true) - { - ListViewItem listViewItem2 = (ListViewItem)listViewItemCurrent.Clone(); - this.listViewBoxes.Items.Insert(index, listViewItem2); - if (listViewBoxes.SelectedItems.Count != 0) - { - if (selected.Index == listViewItemCurrent.Index) - { - selected = listViewItem2; - } - } - listViewItemCurrent.Remove(); - } - } - else - { - checkedItems += 1; - } - } - } while (checkedItems < listViewBoxes.Items.Count); - } - else if (this.direction == "right") - { - int checkedItems = 0; - do - { - foreach (ListViewItem listViewItem1 in this.listViewBoxes.Items) - { - if (listViewItem1.SubItems[listViewItem1.SubItems.Count - 1].Text == "unchecked") - { - int x = 0; - if (listViewItem1.Tag.ToString() == "HEAD") - x = displayBox.Width / 2; - else if (listViewItem1.Tag.ToString() == "BODY") - x = displayBox.Width / 2; - else if (listViewItem1.Tag.ToString() == "ARM0") - x = 178; - else if (listViewItem1.Tag.ToString() == "ARM1") - x = 228; - else if (listViewItem1.Tag.ToString() == "LEG0") - x = 193; - else if (listViewItem1.Tag.ToString() == "LEG1") - x = 213; - bool flag = false; - int index = listViewItem1.Index; - foreach (ListViewItem listViewItem2 in this.listViewBoxes.Items) + foreach (ListViewItem listViewItem2 in listViewBoxes.Items) { if (listViewItem2.SubItems[9].Text == "unchecked") { @@ -962,13 +793,13 @@ namespace PckStudio if (flag == true) { ListViewItem listViewItem2 = (ListViewItem)listViewItem1.Clone(); - this.listViewBoxes.Items.Insert(index, listViewItem2); + listViewBoxes.Items.Insert(index, listViewItem2); if (listViewBoxes.SelectedItems.Count != 0) { - if (selected.Index == listViewItem1.Index) - { - selected = listViewItem2; - } + //if (selected.Index == listViewItem1.Index) + //{ + // selected = listViewItem2; + //} } listViewItem1.Remove(); } @@ -979,51 +810,76 @@ namespace PckStudio } } } while (checkedItems < listViewBoxes.Items.Count); - } - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - listViewItem.SubItems[9].Text = "unchecked"; - } - catch (Exception ex) - { + } + } + private void DrawGuideLines(Graphics g) + { + int centerHeightPoint = displayBox.Height / 2; + int centerWidthPoint = displayBox.Width / 2; + int headbodyY = centerHeightPoint + 25; //25 + int legY = centerHeightPoint + 85; // - 80; + bool isSide = direction == eViewDirection.left || direction == eViewDirection.right; + if (!isSide) + { + g.DrawLine(Pens.Red, 0, headbodyY + float.Parse(offsetHead.Text) * 5, displayBox.Width, headbodyY + float.Parse(offsetHead.Text) * 5); + g.DrawLine(Pens.Green, 0, headbodyY + float.Parse(offsetBody.Text) * 5, displayBox.Width, headbodyY + float.Parse(offsetBody.Text) * 5); + g.DrawLine(Pens.Blue, 0, headbodyY + float.Parse(offsetArms.Text) * 5, displayBox.Width, headbodyY + float.Parse(offsetArms.Text) * 5); + g.DrawLine(Pens.Purple, 0, legY + float.Parse(offsetLegs.Text) * 5, displayBox.Width, legY + float.Parse(offsetLegs.Text) * 5); } + g.DrawLine(Pens.Red, centerWidthPoint, 0, centerWidthPoint, displayBox.Height); + g.DrawLine(Pens.Blue, centerWidthPoint + 30, 0, centerWidthPoint + 30, displayBox.Height); + g.DrawLine(Pens.Blue, centerWidthPoint - 30, 0, centerWidthPoint - 30, displayBox.Height); + g.DrawLine(Pens.Purple, centerWidthPoint - 10, 0, centerWidthPoint - 10, displayBox.Height); + g.DrawLine(Pens.Purple, centerWidthPoint + 10, 0, centerWidthPoint + 10, displayBox.Height); + } + + private void DrawArmorOffsets(Graphics g) + { + int centerPointHeight = displayBox.Height / 2; + int centerPointWidth = displayBox.Width / 2; + int headbodyY = centerPointHeight + 25; //25 + int armY = centerPointHeight + 35; // - 60; + int legY = centerPointHeight + 85; // - 80; + SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(80, 50, 50, 75)); + g.FillRectangle(semiTransBrush, centerPointWidth, (float)(headbodyY - 40 /*+ offsetHelmet.Value * 5*/), 40, 40); // Helmet + bool isSide = direction == eViewDirection.left || direction == eViewDirection.right; + if (isSide) + { + g.FillRectangle(semiTransBrush, centerPointWidth - 10, headbodyY, 20, 60); // Chest + g.FillRectangle(semiTransBrush, centerPointWidth - 10, (float)(legY + 40 /*+ offsetBoots.Value * 5*/), 20, 20); // Boots + g.FillRectangle(semiTransBrush, centerPointWidth - 10, (float)(legY /*+ offsetPants.Value * 5*/), 20, 40); // Pants + g.FillRectangle(semiTransBrush, centerPointWidth - 5, (float)(armY + 45 /*+ offsetTool.Value * 5*/), 10, 10); // Tools + } + else + { + g.FillRectangle(semiTransBrush, centerPointWidth - 20, headbodyY, 40, 60); // Chest + g.FillRectangle(semiTransBrush, centerPointWidth - 35, (float)(armY + 45 /*+ offsetTool.Value * 5*/), 10, 10); // Tool0 + g.FillRectangle(semiTransBrush, centerPointWidth + 25, (float)(armY + 45 /*+ offsetTool.Value * 5*/), 10, 10); // Tool1 + g.FillRectangle(semiTransBrush, centerPointWidth - 20, (float)(legY /*+ offsetPants.Value * 5*/), 20, 40); // Pants0 + g.FillRectangle(semiTransBrush, centerPointWidth, (float)(legY /*+ offsetPants.Value * 5*/), 20, 40); // Pants1 + g.FillRectangle(semiTransBrush, centerPointWidth - 20, (float)(legY + 40 /*+ offsetBoots.Value * 5*/), 20, 20); // Boot0 + g.FillRectangle(semiTransBrush, centerPointWidth, (float)(legY + 40 /*+ offsetBoots.Value * 5*/), 20, 20); // Boot1 + } + } //Loads Columns private void generateModel_Load(object sender, EventArgs e) { - this.render(); - this.listViewBoxes.Columns.Add("Part", 50); - this.listViewBoxes.Columns.Add("Xc", 25); - this.listViewBoxes.Columns.Add("Yc", 25); - this.listViewBoxes.Columns.Add("Zc", 25); - this.listViewBoxes.Columns.Add("Xf", 25); - this.listViewBoxes.Columns.Add("Yf", 25); - this.listViewBoxes.Columns.Add("Zf", 25); - this.listViewBoxes.Columns.Add("Xo", 25); - this.listViewBoxes.Columns.Add("Yo", 25); - if (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height < 780 || System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width < 1080) - { - this.Size = new Size(753, 707); + if (Screen.PrimaryScreen.Bounds.Height >= 780 && Screen.PrimaryScreen.Bounds.Width >= 1080){ + return; } + render(); } //Creates Item private void createToolStripMenuItem_Click(object sender, EventArgs e) { - ListViewItem part = new ListViewItem(); - part.Text = "New Part"; - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - part.SubItems.Add(new ListViewItem.ListViewSubItem(part, "0")); - listViewBoxes.Items.Add(part); + modelParts.Add(new ModelPart("New Part", 0, 0, 0, 0, 0, 0, 0, 0)); + updateListView(); render(); } @@ -1031,86 +887,23 @@ namespace PckStudio //Manages the selection of a item private void listView1_SelectedIndexChanged(object sender, EventArgs e) { - if (listViewBoxes.SelectedItems.Count != 0) - { - selected = listViewBoxes.SelectedItems[0]; - try - { - try - { - this.comboParent.Text = this.selected.Tag.ToString(); - } - catch (Exception ex) - { - this.comboParent.Text = ""; - } - this.textXc.Text = this.selected.SubItems[1].Text; - this.textYc.Text = this.selected.SubItems[2].Text; - this.textZc.Text = this.selected.SubItems[3].Text; - this.textXf.Text = this.selected.SubItems[4].Text; - this.textYf.Text = this.selected.SubItems[5].Text; - this.textZf.Text = this.selected.SubItems[6].Text; - this.textTextureX.Text = this.selected.SubItems[7].Text; - this.textTextureY.Text = this.selected.SubItems[8].Text; - } - catch (Exception ex) - { - } - if (this.comboParent.Text == "") - { - this.comboParent.Enabled = true; - this.buttonIMPORT.Enabled = false; - this.buttonEXPORT.Enabled = false; - this.textXc.Enabled = false; - this.textYc.Enabled = false; - this.textZc.Enabled = false; - this.textXf.Enabled = false; - this.textYf.Enabled = false; - this.textZf.Enabled = false; - this.textTextureX.Enabled = false; - this.textTextureY.Enabled = false; - this.buttonXcminus.Enabled = false; - this.buttonYcminus.Enabled = false; - this.buttonZcminus.Enabled = false; - this.buttonXcplus.Enabled = false; - this.buttonYcplus.Enabled = false; - this.buttonZcplus.Enabled = false; - this.buttonXfminus.Enabled = false; - this.buttonYfminus.Enabled = false; - this.buttonZfminus.Enabled = false; - this.buttonXfplus.Enabled = false; - this.buttonYfplus.Enabled = false; - this.buttonZfplus.Enabled = false; - } - else - { - this.buttonIMPORT.Enabled = true; - this.buttonEXPORT.Enabled = true; - this.textXc.Enabled = true; - this.textYc.Enabled = true; - this.textZc.Enabled = true; - this.textXf.Enabled = true; - this.textYf.Enabled = true; - this.textZf.Enabled = true; - this.textTextureX.Enabled = true; - this.textTextureY.Enabled = true; - this.buttonXcminus.Enabled = true; - this.buttonYcminus.Enabled = true; - this.buttonZcminus.Enabled = true; - this.buttonXcplus.Enabled = true; - this.buttonYcplus.Enabled = true; - this.buttonZcplus.Enabled = true; - this.buttonXfminus.Enabled = true; - this.buttonYfminus.Enabled = true; - this.buttonZfminus.Enabled = true; - this.buttonXfplus.Enabled = true; - this.buttonYfplus.Enabled = true; - this.buttonZfplus.Enabled = true; - } - this.render(); - } - else + changeColorToolStripMenuItem.Visible = false; + if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0].Tag is ModelPart) { + changeColorToolStripMenuItem.Visible = true; + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + //graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[6].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); + //graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[6].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); + comboParent.Text = part.Type; + PosXUpDown.Value = (decimal)part.X; + PosYUpDown.Value = (decimal)part.Y; + PosZUpDown.Value = (decimal)part.Z; + SizeXUpDown.Value = (decimal)part.Width; + SizeYUpDown.Value = (decimal)part.Height; + SizeZUpDown.Value = (decimal)part.Length; + TextureXUpDown.Value = part.U; + TextureYUpDown.Value = part.V; + render(); } } @@ -1118,40 +911,23 @@ namespace PckStudio //Changes Item Model Class private void comboParent_SelectedIndexChanged(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - this.selected.Tag = (object)this.comboParent.Text; - if (this.comboParent.Text != "") - { - this.buttonIMPORT.Enabled = true; - this.buttonEXPORT.Enabled = true; - this.textXc.Enabled = true; - this.textYc.Enabled = true; - this.textZc.Enabled = true; - this.textXf.Enabled = true; - this.textYf.Enabled = true; - this.textZf.Enabled = true; - this.textTextureX.Enabled = true; - this.textTextureY.Enabled = true; - this.buttonXcminus.Enabled = true; - this.buttonYcminus.Enabled = true; - this.buttonZcminus.Enabled = true; - this.buttonXcplus.Enabled = true; - this.buttonYcplus.Enabled = true; - this.buttonZcplus.Enabled = true; - this.buttonXfminus.Enabled = true; - this.buttonYfminus.Enabled = true; - this.buttonZfminus.Enabled = true; - this.buttonXfplus.Enabled = true; - this.buttonYfplus.Enabled = true; - this.buttonZfplus.Enabled = true; - } + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.Type = comboParent.Text; + buttonIMPORT.Enabled = true; + buttonEXPORT.Enabled = true; + SizeXUpDown.Enabled = true; + SizeYUpDown.Enabled = true; + SizeZUpDown.Enabled = true; + PosXUpDown.Enabled = true; + PosYUpDown.Enabled = true; + PosZUpDown.Enabled = true; + TextureXUpDown.Enabled = true; + TextureYUpDown.Enabled = true; } - catch (Exception ex) - { - - } - render(); + //render(); } private void textBoxFailCheck(TextBox textBox) @@ -1166,348 +942,133 @@ namespace PckStudio } } - //X-Size Change - private void textXf_TextChanged(object sender, EventArgs e) + private void SizeXUpDown_ValueChanged(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - this.selected.SubItems[4].Text = double.Parse(this.textXf.Text).ToString(); + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.Width = (float)SizeXUpDown.Value; } - catch (Exception ex) - { + updateListView(); + render(); + } + private void SizeYUpDown_ValueChanged(object sender, EventArgs e) + { + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) + { + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.Height = (float)SizeYUpDown.Value; } + updateListView(); + render(); + } + + private void SizeZUpDown_ValueChanged(object sender, EventArgs e) + { + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) + { + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.Length = (float)SizeZUpDown.Value; + } + updateListView(); + render(); + } + + private void PosXUpDown_ValueChanged(object sender, EventArgs e) + { + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) + { + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.X = (float)PosXUpDown.Value; + } + updateListView(); render(); } - //Y-Size Change - private void textYf_TextChanged(object sender, EventArgs e) + private void PosYUpDown_ValueChanged(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - this.selected.SubItems[5].Text = double.Parse(this.textYf.Text).ToString(); - } - catch (Exception ex) - { - + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.Y = (float)PosYUpDown.Value; } + updateListView(); render(); } - //Z-Size Change - private void textZf_TextChanged(object sender, EventArgs e) + private void PosZUpDown_ValueChanged(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - this.selected.SubItems[6].Text = double.Parse(this.textZf.Text).ToString(); - } - catch (Exception ex) - { - + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.Z = (float)PosZUpDown.Value; } + updateListView(); render(); } - - //X-Position Change - private void textXc_TextChanged(object sender, EventArgs e) + private void rotateRightBtn_Click(object sender, EventArgs e) { - try - { - this.selected.SubItems[1].Text = double.Parse(this.textXc.Text).ToString(); - } - catch (Exception ex) - { - - } + if (direction == eViewDirection.front) + direction = eViewDirection.left; + else if (direction == eViewDirection.left) + direction = eViewDirection.back; + else if (direction == eViewDirection.back) + direction = eViewDirection.right; + else if (direction == eViewDirection.right) + direction = eViewDirection.front; + labelView.Text = $"View: {direction}"; render(); } - - //Y-Position Change - private void textYc_TextChanged(object sender, EventArgs e) + private void rotateLeftBtn_Click(object sender, EventArgs e) { - try - { - this.selected.SubItems[2].Text = double.Parse(this.textYc.Text).ToString(); - } - catch (Exception ex) - { - - } - render(); - } - - - //Z-Position Change - private void textZc_TextChanged(object sender, EventArgs e) - { - try - { - this.selected.SubItems[3].Text = double.Parse(this.textZc.Text).ToString(); - } - catch (Exception ex) - { - - } - render(); - } - - - //Increases X-Size - private void buttonXfplus_Click(object sender, EventArgs e) - { - try - { - this.textXf.Text = ((int)double.Parse(this.textXf.Text) + 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Decreases X-Size - private void buttonXfminus_Click(object sender, EventArgs e) - { - try - { - this.textXf.Text = ((int)double.Parse(this.textXf.Text) - 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Increases Y-Size - private void buttonYfplus_Click(object sender, EventArgs e) - { - try - { - this.textYf.Text = ((int)double.Parse(this.textYf.Text) + 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Decreases Y-Size - private void buttonYfminus_Click(object sender, EventArgs e) - { - try - { - this.textYf.Text = ((int)double.Parse(this.textYf.Text) - 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Increases Z-Size - private void buttonZfplus_Click(object sender, EventArgs e) - { - try - { - this.textZf.Text = ((int)double.Parse(this.textZf.Text) + 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Decreases Z-Size - private void buttonZfminus_Click(object sender, EventArgs e) - { - try - { - this.textZf.Text = ((int)double.Parse(this.textZf.Text) - 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Increases X-Position - private void buttonXcplus_Click(object sender, EventArgs e) - { - try - { - this.textXc.Text = ((int)double.Parse(this.textXc.Text) + 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Decreases X-Position - private void buttonXcminus_Click(object sender, EventArgs e) - { - try - { - this.textXc.Text = ((int)double.Parse(this.textXc.Text) - 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Increases Y-Position - private void buttonYcplus_Click(object sender, EventArgs e) - { - try - { - this.textYc.Text = ((int)double.Parse(this.textYc.Text) + 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Decreases Y-Position - private void buttonYcminus_Click(object sender, EventArgs e) - { - try - { - this.textYc.Text = ((int)double.Parse(this.textYc.Text) - 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Increases Z-Position - private void buttonZcplus_Click(object sender, EventArgs e) - { - try - { - this.textZc.Text = ((int)double.Parse(this.textZc.Text) + 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Decreases Z-Position - private void buttonZcminus_Click(object sender, EventArgs e) - { - try - { - this.textZc.Text = ((int)double.Parse(this.textZc.Text) - 1).ToString(); - } - catch (Exception ex) - { - } - render(); - } - - - //Rotates View Right - private void button1_Click(object sender, EventArgs e) - { - if (this.direction == "front") - this.direction = "left"; - else if (this.direction == "left") - this.direction = "back"; - else if (this.direction == "back") - this.direction = "right"; - else if (this.direction == "right") - this.direction = "front"; - render(); - } - - - //Rotates View Left - private void button2_Click(object sender, EventArgs e) - { - if (this.direction == "front") - this.direction = "right"; - else if (this.direction == "right") - this.direction = "back"; - else if (this.direction == "back") - this.direction = "left"; - else if (this.direction == "left") - this.direction = "front"; + if (direction == eViewDirection.front) + direction = eViewDirection.right; + else if (direction == eViewDirection.right) + direction = eViewDirection.back; + else if (direction == eViewDirection.back) + direction = eViewDirection.left; + else if (direction == eViewDirection.left) + direction = eViewDirection.front; + labelView.Text = $"View: {direction}"; render(); } //Sets Texture X-Offset - private void textBox1_TextChanged(object sender, EventArgs e) + private void TextureXUpDown_ValueChanged(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - double.Parse(this.textTextureX.Text); - } - catch (Exception ex1) - { - try - { - this.textTextureX.Text = this.textTextureX.Text.Remove(this.textTextureX.Text.Count() - 1, 1); - } - catch (Exception ex2) - { - } - } - try - { - this.selected.SubItems[7].Text = double.Parse(this.textTextureX.Text).ToString(); - } - catch (Exception ex) - { - this.selected.SubItems[7].Text = 0.ToString(); + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.U = (int)TextureXUpDown.Value; } + updateListView(); render(); } //Sets texture Y-Offset - private void textTextureY_TextChanged(object sender, EventArgs e) + private void TextureYUpDown_ValueChanged(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - double.Parse(this.textTextureY.Text); - } - catch (Exception ex1) - { - try - { - this.textTextureY.Text = this.textTextureY.Text.Remove(this.textTextureY.Text.Count() - 1, 1); - } - catch (Exception ex2) - { - } - } - try - { - this.selected.SubItems[8].Text = double.Parse(this.textTextureY.Text).ToString(); - } - catch (Exception ex) - { - this.selected.SubItems[8].Text = 0.ToString(); + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + part.V = (int)TextureXUpDown.Value; } + updateListView(); render(); } @@ -1515,12 +1076,13 @@ namespace PckStudio //Export Current Skin Texture private void buttonEXPORT_Click(object sender, EventArgs e) { - Bitmap bitmap = new Bitmap(this.texturePreview.Image, 64, 64); + Bitmap bitmap = new Bitmap(texturePreview.Image, 64, 64); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "PNG Image Files | *.png"; if (saveFileDialog.ShowDialog() != DialogResult.OK) return; bitmap.Save(saveFileDialog.FileName, ImageFormat.Png); + saveFileDialog.Dispose(); } @@ -1535,12 +1097,12 @@ namespace PckStudio { checkTextureGenerate.Checked = false; Bitmap bitmap = new Bitmap(64, 64); - using (Graphics graphics = Graphics.FromImage((Image)bitmap)) + using (Graphics graphics = Graphics.FromImage(bitmap)) { graphics.DrawImage(Image.FromFile(openFileDialog.FileName), 0, 0, 64, 64); graphics.InterpolationMode = InterpolationMode.NearestNeighbor; } - this.texturePreview.Image = (Image)bitmap; + texturePreview.Image = bitmap; } render(); } @@ -1549,75 +1111,11 @@ namespace PckStudio //Creates Model Data and Finalizes private void buttonDone_Click(object sender, EventArgs e) { - boxes.Clear(); - - Bitmap bitmap1 = new Bitmap(this.displayBox.Width, this.displayBox.Height); - foreach (ListViewItem listViewItem in listViewBoxes.Items) + Bitmap bitmap1 = new Bitmap(displayBox.Width, displayBox.Height); + foreach (var part in modelParts) { - boxes.Add(new ValueTuple("BOX", - listViewItem.Tag.ToString() + " " + listViewItem.SubItems[1].Text + " " + listViewItem.SubItems[2].Text + " " + listViewItem.SubItems[3].Text + " " + listViewItem.SubItems[4].Text + " " + listViewItem.SubItems[5].Text + " " + listViewItem.SubItems[6].Text + " " + listViewItem.SubItems[7].Text + " " + listViewItem.SubItems[8].Text)); - - //mf.entries.Add(new object[2] { (object) "BOX", new ListViewItem() { Tag = ((object) (listViewItem.Tag.ToString() + " " + listViewItem.SubItems[1].Text + " " + listViewItem.SubItems[2].Text + " " + listViewItem.SubItems[3].Text + " " + listViewItem.SubItems[4].Text + " " + listViewItem.SubItems[5].Text + " " + listViewItem.SubItems[6].Text + " " + listViewItem.SubItems[7].Text + " " + listViewItem.SubItems[8].Text)) }.Tag }); - using (Graphics graphics = Graphics.FromImage((Image)bitmap1)) - { - int x = 0; - int y = 0; - try - { - if (listViewItem.Tag.ToString() == "HEAD") - { - x = 80; - y = 16 + (int)double.Parse(this.offsetHead.Text) * 5 + 40; - } - else if (listViewItem.Tag.ToString() == "BODY") - { - x = 80; - y = 56 + (int)double.Parse(this.offsetBody.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "ARM0") - { - x = 55; - y = 56 + (int)double.Parse(this.offsetArms.Text) * 5 + 10; - } - else if (listViewItem.Tag.ToString() == "ARM1") - { - x = 105; - y = 55 + (int)double.Parse(this.offsetArms.Text) * 5 + 10; - } - else if (listViewItem.Tag.ToString() == "LEG0") - { - x = 70; - y = 116 + (int)double.Parse(this.offsetLegs.Text) * 5; - } - else if (listViewItem.Tag.ToString() == "LEG1") - { - x = 90; - y = 116 + (int)double.Parse(this.offsetLegs.Text) * 5; - } - graphics.FillRectangle((Brush)new SolidBrush(listViewItem.ForeColor), x + (int)double.Parse(listViewItem.SubItems[1].Text) * 5, y + (int)double.Parse(listViewItem.SubItems[2].Text) * 5, (int)double.Parse(listViewItem.SubItems[4].Text) * 5, (int)double.Parse(listViewItem.SubItems[5].Text) * 5); - listViewItem.Remove(); - } - catch (Exception ex) - { - - } - } + boxes.Add(part.ToProperty()); } - //Body Offsets - boxes.Add(new ValueTuple("OFFSET", "HEAD Y " + offsetHead.Text)); - boxes.Add(new ValueTuple("OFFSET", "BODY Y " + offsetBody.Text)); - boxes.Add(new ValueTuple("OFFSET", "ARM0 Y " + offsetArms.Text)); - boxes.Add(new ValueTuple("OFFSET", "ARM1 Y " + offsetArms.Text)); - boxes.Add(new ValueTuple("OFFSET", "LEG0 Y " + offsetLegs.Text)); - boxes.Add(new ValueTuple("OFFSET", "LEG1 Y " + offsetLegs.Text)); - //Armor Offsets - boxes.Add(new ValueTuple("OFFSET", "HELMET Y " + offsetHelmet.Text)); - boxes.Add(new ValueTuple("OFFSET", "TOOL0 Y " + offsetTool.Text)); - boxes.Add(new ValueTuple("OFFSET", "TOOL1 Y " + offsetTool.Text)); - boxes.Add(new ValueTuple("OFFSET", "PANTS0 Y " + offsetPants.Text)); - boxes.Add(new ValueTuple("OFFSET", "PANTS1 Y " + offsetPants.Text)); - boxes.Add(new ValueTuple("OFFSET", "BOOTS0 Y " + offsetBoots.Text)); - boxes.Add(new ValueTuple("OFFSET", "BOOTS1 Y " + offsetBoots.Text)); Bitmap bitmap2 = new Bitmap(64, 64); using (Graphics graphics = Graphics.FromImage(bitmap2)) @@ -1625,21 +1123,7 @@ namespace PckStudio graphics.DrawImage(texturePreview.Image, 0, 0, 64, 64); graphics.InterpolationMode = InterpolationMode.NearestNeighbor; } - texturePreview.Image = bitmap2; - try - { - using (FileStream stream = new FileStream(Application.StartupPath + "\\temp.png", FileMode.Create, FileAccess.Write)) - { - bitmap2.Save(stream, ImageFormat.Png); - stream.Close(); - stream.Dispose(); - } - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString()); - } - skinPreview.Image = (Image)bitmap1; + skinPreview.Image = bitmap1; Close(); } @@ -1649,20 +1133,12 @@ namespace PckStudio render(); } - - //Deciphers wether to auto-generate model texture or not - private void checkTextureGenerate_CheckedChanged(object sender, EventArgs e) - { - autoTexture = checkTextureGenerate.Checked; - } - - //Trigger Dialog to select model part/item color private void listView1_DoubleClick(object sender, EventArgs e) { ColorDialog colorDialog = new ColorDialog(); if (colorDialog.ShowDialog() == DialogResult.OK) - selected.ForeColor = colorDialog.Color; + listViewBoxes.SelectedItems[0].ForeColor = colorDialog.Color; render(); } @@ -1684,103 +1160,35 @@ namespace PckStudio //Loads in model template(Steve) private void buttonTemplate_Click(object sender, EventArgs e) { - ListViewItem owner = new ListViewItem(); - owner.Text = "HEAD"; - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "-4")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "-8")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "-4")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "8")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "8")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "8")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "0")); - owner.SubItems.Add(new ListViewItem.ListViewSubItem(owner, "0")); - owner.Tag = (object)"HEAD"; - owner.ForeColor = Color.Yellow; - this.listViewBoxes.Items.Add(owner); - this.listViewBoxes.Items.Add(new ListViewItem() - { - Text = "BODY", - SubItems = { - new ListViewItem.ListViewSubItem(owner, "-4"), - new ListViewItem.ListViewSubItem(owner, "0"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "8"), - new ListViewItem.ListViewSubItem(owner, "12"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "16"), - new ListViewItem.ListViewSubItem(owner, "16") - }, - Tag = (object)"BODY", - ForeColor = Color.Violet - }); - this.listViewBoxes.Items.Add(new ListViewItem() - { - Text = "ARM0", - SubItems = { - new ListViewItem.ListViewSubItem(owner, "-3"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "12"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "40"), - new ListViewItem.ListViewSubItem(owner, "16") - }, - Tag = (object)"ARM0", - ForeColor = Color.SkyBlue - }); - this.listViewBoxes.Items.Add(new ListViewItem() - { - Text = "ARM1", - SubItems = { - new ListViewItem.ListViewSubItem(owner, "-1"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "12"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "40"), - new ListViewItem.ListViewSubItem(owner, "16") - }, - Tag = (object)"ARM1", - ForeColor = Color.SkyBlue - }); - this.listViewBoxes.Items.Add(new ListViewItem() - { - Text = "LEG0", - SubItems = { - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "0"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "12"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "0"), - new ListViewItem.ListViewSubItem(owner, "16") - }, - Tag = (object)"LEG0", - ForeColor = Color.SpringGreen - }); - this.listViewBoxes.Items.Add(new ListViewItem() - { - Text = "LEG1", - SubItems = { - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "0"), - new ListViewItem.ListViewSubItem(owner, "-2"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "12"), - new ListViewItem.ListViewSubItem(owner, "4"), - new ListViewItem.ListViewSubItem(owner, "0"), - new ListViewItem.ListViewSubItem(owner, "16") - }, - Tag = (object)"LEG1", - ForeColor = Color.SpringGreen - }); - this.comboParent.Enabled = true; + modelParts.Add(new ModelPart("HEAD", -4, -8, -4, 8, 8, 8, 0, 0)); + modelParts.Add(new ModelPart("BODY", -4, 0, -2, 8, 12, 4, 16, 16)); + modelParts.Add(new ModelPart("ARM0", -3, -2, -2, 4, 12, 4, 40, 16)); + modelParts.Add(new ModelPart("ARM1", -1, -2, -2, 4, 12, 4, 40, 16)); + modelParts.Add(new ModelPart("LEG0", -2, 0, -2, 4, 12, 4, 0, 16)); + modelParts.Add(new ModelPart("LEG1", -2, 0, -2, 4, 12, 4, 0, 16)); + comboParent.Enabled = true; + updateListView(); render(); } + private void updateListView() + { + listViewBoxes.Items.Clear(); + foreach (var part in modelParts) + { + ListViewItem listViewItem = new ListViewItem(part.Type); + listViewItem.Tag = part; + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.X.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Y.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Z.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Width.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Height.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Length.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.U.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.V.ToString())); + listViewBoxes.Items.Add(listViewItem); + } + } //Exports model (int)doubleo reusable project file private void buttonExportModel_Click(object sender, EventArgs e) @@ -1790,7 +1198,7 @@ namespace PckStudio if (saveFileDialog.ShowDialog() != DialogResult.OK) return; string contents = ""; - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) + foreach (ListViewItem listViewItem in listViewBoxes.Items) { string str = ""; foreach (ListViewItem.ListViewSubItem subItem in listViewItem.SubItems) @@ -1798,7 +1206,7 @@ namespace PckStudio if (subItem.Text != "unchecked") str = str + subItem.Text + Environment.NewLine; } - contents = contents + (listViewItem.Text + Environment.NewLine + listViewItem.Tag) + Environment.NewLine + str; + contents += (listViewItem.Text + Environment.NewLine + listViewItem.Tag) + Environment.NewLine + str; } File.WriteAllText(saveFileDialog.FileName, contents); @@ -1813,7 +1221,7 @@ namespace PckStudio openFileDialog.Title = "Select Custom Skin Model File"; if (MessageBox.Show("Import custom model project file? Your current work will be lost!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes && openFileDialog.ShowDialog() == DialogResult.OK) { - this.listViewBoxes.Items.Clear(); + listViewBoxes.Items.Clear(); string str1 = File.ReadAllText(openFileDialog.FileName); int x = 0; foreach (string str2 in str1.Split("\n\r".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) @@ -1844,7 +1252,7 @@ namespace PckStudio if (num4 == 1 + 11 * current.Index) listViewItem.Text = text; else if (num4 == 2 + 11 * current.Index) - listViewItem.Tag = (object)text; + listViewItem.Tag = text; else if (num4 == 4 + 11 * current.Index) listViewItem.SubItems.Add(text); else if (num4 == 5 + 11 * current.Index) @@ -1862,7 +1270,7 @@ namespace PckStudio else if (num4 == 11 + 11 * current.Index) { listViewItem.SubItems.Add(text); - this.listViewBoxes.Items.Add(listViewItem); + listViewBoxes.Items.Add(listViewItem); } } } @@ -1880,40 +1288,27 @@ namespace PckStudio render(); } - - //debug - private void button3_Click(object sender, EventArgs e) - { - this.setZ(); - } - - - //render with guide settings - private void checkGuide_CheckedChanged(object sender, EventArgs e) - { - render(); - } - - //Clones Item private void cloneToolStripMenuItem_Click(object sender, EventArgs e) { try { ListViewItem listViewItem = new ListViewItem(); - listViewItem.Text = this.selected.Text; - listViewItem.Tag = this.selected.Tag; + var selected = listViewBoxes.SelectedItems[0]; + listViewItem.Text = selected.Text; + listViewItem.Tag = selected.Tag; int num = 0; - foreach (ListViewItem.ListViewSubItem subItem in this.selected.SubItems) + foreach (ListViewItem.ListViewSubItem subItem in selected.SubItems) { if (num > 0) listViewItem.SubItems.Add(subItem.Text); ++num; } - this.listViewBoxes.Items.Add(listViewItem); + listViewBoxes.Items.Add(listViewItem); } catch (Exception ex) { + Console.WriteLine(ex.Message); MessageBox.Show("Please Select a Part"); } } @@ -1922,32 +1317,19 @@ namespace PckStudio //Deletes Item private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { - try - { - if (selected == null) - return; - this.selected.Remove(); - this.render(); - } - catch (Exception ex) - { - } + if (listViewBoxes.SelectedItems[0] == null) + return; + listViewBoxes.SelectedItems[0].Remove(); + render(); } //Changes item color private void changeColorToolStripMenuItem_Click(object sender, EventArgs e) { - try - { - ColorDialog colorDialog = new ColorDialog(); - colorDialog.ShowDialog(); - this.selected.ForeColor = colorDialog.Color; - this.render(); - } - catch (Exception ex) - { - MessageBox.Show("Please Select a Part"); - } + ColorDialog colorDialog = new ColorDialog(); + if (colorDialog.ShowDialog() == DialogResult.OK) + listViewBoxes.SelectedItems[0].ForeColor = colorDialog.Color; + render(); } //Re-renders tool with updated x-offset @@ -1980,23 +1362,42 @@ namespace PckStudio render(); } - //Toggles armor position overylay view - private void checkBoxArmor_Click(object sender, EventArgs e) - { - render(); - } - //Item Selection private void listView1_Click(object sender, EventArgs e) { - try + if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0] != null && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - selected = listViewBoxes.SelectedItems[0]; - } - catch (Exception) - { - + var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + comboParent.Text = part.Type; + PosXUpDown.Value = (decimal)part.X; + PosYUpDown.Value = (decimal)part.Y; + PosZUpDown.Value = (decimal)part.Z; + SizeXUpDown.Value = (decimal)part.Width; + SizeYUpDown.Value = (decimal)part.Height; + SizeZUpDown.Value = (decimal)part.Length; + TextureXUpDown.Value = part.U; + TextureYUpDown.Value = part.V; + SizeXUpDown.Enabled = true; + SizeYUpDown.Enabled = true; + SizeZUpDown.Enabled = true; + PosXUpDown.Enabled = true; + PosYUpDown.Enabled = true; + PosZUpDown.Enabled = true; + TextureXUpDown.Enabled = true; + TextureYUpDown.Enabled = true; + comboParent.Enabled = true; + return; } + SizeXUpDown.Enabled = false; + SizeYUpDown.Enabled = false; + SizeZUpDown.Enabled = false; + PosXUpDown.Enabled = false; + PosYUpDown.Enabled = false; + PosZUpDown.Enabled = false; + TextureXUpDown.Enabled = false; + TextureYUpDown.Enabled = false; + comboParent.Enabled = false; render(); } @@ -2014,93 +1415,29 @@ namespace PckStudio //Del stuff using key private void delStuffUsingDelKey(object sender, KeyEventArgs e) { - if (e.KeyValue == (char)Keys.Delete) + if (e.KeyCode == Keys.Delete && listViewBoxes.SelectedItems.Count != 0 && + listViewBoxes.SelectedItems[0].Tag is ModelPart) { - this.selected.Remove(); - this.render(); + if (modelParts.Remove(listViewBoxes.SelectedItems[0].Tag as ModelPart)) + listViewBoxes.SelectedItems[0].Remove(); + render(); } } - private void generateModel_ResizeBegin(object sender, EventArgs e) - { - } - - private void generateModel_ResizeEnd(object sender, EventArgs e) - { - //ResizeWidth(this.Width); - //ResizeHeight(this.Height); - } - - public void ResizeWidth(int newWidth, int newHeight) - { - this.Width = (int)((double)newHeight * (double)((double)839 / (double)750)); - this.Height = newHeight; - - int newDisplayHeight = newHeight - 170; - displayBox.Width = (int)((double)newDisplayHeight * (double)((double)530 / (double)580)); - displayBox.Height = newDisplayHeight; - } - private void generateModel_SizeChanged(object sender, EventArgs e) { - ResizeWidth(this.Width, this.Height); render(); } - private void listViewBGs_ItemActivate(object sender, EventArgs e) - { - - } - - private void listViewBGs_SelectedIndexChanged(object sender, EventArgs e) - { - } - - private void listViewBGs_Click(object sender, EventArgs e) - { - try - { - backgroundColor = listViewBGs.SelectedItems[0].BackColor; - render(); - } - catch (Exception) - { - - } - } - - private void textXc_Leave(object sender, EventArgs e) - { - textBoxFailCheck((TextBox)sender); - } - - - private void button3_Click_1(object sender, EventArgs e) - { - - string contents = ""; - foreach (ListViewItem listViewItem in this.listViewBoxes.Items) - { - string str = ""; - foreach (ListViewItem.ListViewSubItem subItem in listViewItem.SubItems) - { - if (subItem.Text != "unchecked") - str = str + subItem.Text + Environment.NewLine; - } - contents = contents + (listViewItem.Text + Environment.NewLine + listViewItem.Tag) + Environment.NewLine + str; - } - Console.WriteLine(contents); - } private void OpenJSONButton_Click(object sender, EventArgs e) { - OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "JSON Model File | *.JSON"; openFileDialog.Title = "Select JSON Model File"; if (MessageBox.Show("Import custom model project file? Your current work will be lost!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes && openFileDialog.ShowDialog() == DialogResult.OK) { - this.listViewBoxes.Items.Clear(); + listViewBoxes.Items.Clear(); string str1 = JSONToCSM(openFileDialog.FileName); int x = 0; foreach (string str2 in str1.Split("\n\r".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)) @@ -2169,9 +1506,9 @@ namespace PckStudio public string JSONToCSM(string InputFilePath) { - dynamic jsonDe = JsonConvert.DeserializeObject(File.ReadAllText(InputFilePath)); + dynamic jsonDe = JsonConvert.DeserializeObject(File.ReadAllText(InputFilePath)); string CSMData = ""; - foreach (JObjectGroup group in jsonDe.groups) + foreach (CSMJObjectGroup group in jsonDe.groups) { string PARENT = group.name; foreach (int i in group.children) @@ -2183,30 +1520,30 @@ namespace PckStudio float SizeX = jsonDe.elements[i].to[0] - jsonDe.elements[i].from[0]; float SizeY = jsonDe.elements[i].to[1] - jsonDe.elements[i].from[1]; float SizeZ = jsonDe.elements[i].to[2] - jsonDe.elements[i].from[2]; - float UvX = 0; - float UvY = 0; + float U = 0; + float V = 0; - CSMData += name + "\n" + PARENT + "\n" + name + "\n" + PosX + "\n" + PosY + "\n" + PosZ + "\n" + SizeX + "\n" + SizeY + "\n" + SizeZ + "\n" + UvX + "\n" + UvY + "\n"; + CSMData += name + "\n" + PARENT + "\n" + name + "\n" + PosX + "\n" + PosY + "\n" + PosZ + "\n" + SizeX + "\n" + SizeY + "\n" + SizeZ + "\n" + U + "\n" + V + "\n"; } } return CSMData; } } - class JObject + class CSMJObject { public string credit; public int[] texture_size; - public JObjectElement[] elements; - public JObjectGroup[] groups; + public CSMJObjectElement[] elements; + public CSMJObjectGroup[] groups; } - class JObjectElement + class CSMJObjectElement { public string name; public float[] from; public float[] to; } - class JObjectGroup + class CSMJObjectGroup { public string name; public float[] origin; diff --git a/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.resx b/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.resx index 78abcb0a..e07040e4 100644 --- a/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.resx +++ b/MinecraftUSkinEditor/Forms/Skins-And-Textures/generateModel.resx @@ -117,346 +117,14 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Right - - - Flat - - - NoControl - - - - 242, 3 - - - 134, 21 - - - - 96 - - - OPEN CSM - - - buttonImportModel - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 5 - - - Top, Right - - - Flat - - - NoControl - - - 483, 3 - - - 89, 21 - - - 97 - - - EXPORT CSM - - - buttonExportModel - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 3 - - - True - - - NoControl - - - 242, 681 - - - 134, 17 - - - 104 - - - Auto Generate Texture - - - checkTextureGenerate - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 43 - - - True - - - NoControl - - - 130, 681 - - - 82, 17 - - - 103 - - - Guide Lines - - - checkGuide - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 42 - - - Left, Right - - - True - - - NoControl - - - 242, 657 - - - 134, 13 - - - 102 - - - View: - - - labelView - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 41 - - - Flat - - - NoControl - - - 130, 652 - - - 89, 23 - - - 101 - - - Rotate Left - - - button2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 39 - - - Top, Right - - - Flat - - - NoControl - - - 483, 652 - - - 89, 23 - - - 100 - - - Rotate Right - - - button1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 40 - - - Left - - - True - - - NoControl - - - 578, 194 - - - 22, 13 - - - 131 - - - UV - - - label7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 9 - - - Top, Right - - - GrowAndShrink - - - 11 - - - Bottom, Left - - - True - - - NoControl - - - 3, 14 - - - 63, 13 - - - 133 - - - Model Parts - - - labelModeParts - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 0 - - - Top, Right - - - Flat - - - NoControl - - - 130, 3 - - - 106, 21 - - - 145 - - - OPEN JSON - - - OpenJSONButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 1 - 17, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC @@ -470,7 +138,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vgAADr4B6kKxwAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAAHbSURBVDhPYyjZ + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAAHbSURBVDhPYyjZ 5F622bt8o1fmYpvMxdY5691T5prlrnJq2BsKFM9Z6Zix1DZruX3yAovAPrX8NS4MJZs98la7de2M/I8E khdZJsw3m3IwacL+hIoNPkkLDEpWumYus8tf6cTQuSc6zFZj7slckEIGBhD6/z/WUr1oq0fDvtApB1Mm H0uOtFaNmaKbPM8iykaTIcpGPSs3K8JWHVlDpK1q4gLDcFv1rHXOIfbq1UGmIfZqQJWVoVYgaQSAaYCD @@ -491,7 +159,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAACESURBVDhPlY0B + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAACESURBVDhPlY0B DoAgDAP3Dj7r09WTkqGUgJfUxtrOmHFEnL0U76FBqW8PZXmk/9uONEsIb3gsNRzoL/+R5hWC759mGsbQ DnzdZbhmiSvhLsM1S1wJdxmuWeJKuMtwzRJXwl2Ga5a4Eu4yXLPElXCX4Zol/WCl6YGdI62n2Zv2cSXV byIunLh7mD2ySLcAAAAASUVORK5CYII= @@ -506,7 +174,7 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAAFhSURBVFhH7ZY/ + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAAFhSURBVFhH7ZY/ S8RAEMXHW23zDexFkNSSTyDYijZyYq2V4BWBmPZaK7/B1fZiK1iIrRxod4r/Gq38N+7L7B5LyFllVuF8 8Mhm55HfZJZAaBq1Zs2yjKx5C+7OiLF223EEYM+CeVaMJlxJXdt1ONZRJuBH/mHo1sPfDY2iwcO39naj 35CUkibBo4z+H/6n4EcdetSGzwHQ79BLHf5q6EYbvgTAmaFhHQ67zy2TaPvaAdy+5XUTHMexSHTpsq1r @@ -531,857 +199,154 @@ System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill - - - 3, 30 - - - 121, 346 - - - 132 - - - listViewBoxes - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 2 - - - Fill - - - NoControl - - - 130, 30 - - - 442, 616 - - - StretchImage - - - 98 - - - displayBox - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 4 - - - True - - - NoControl - - - 578, 0 - - - 128, 13 - - - 113 - - - Texture Mapping Preview - - - labelTextureMappingPreview - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 6 - - - NoControl - - - 578, 30 - - - 128, 128 - - - StretchImage - - - 112 - - - texturePreview - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 7 - - - False - - + + Flat - + NoControl - - 578, 164 + + 654, 676 - - 61, 21 + + 130, 22 - - 128 + + + 111 - - IMPORT + + Create - - buttonIMPORT + + buttonDone - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanelMain + + $this - - 8 - - - False - - - Flat - - - NoControl - - - 645, 164 - - - 61, 21 - - - 114 - - - EXPORT - - - buttonEXPORT - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 10 - - - 645, 191 - - - 30, 20 - - - 129 - - - textTextureX - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 12 - - - Bottom, Left - - - True - - - NoControl - - - 578, 214 - - - 27, 13 - - - 142 - - - Size - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 13 - - - Flat - - - MiddleRight - - - NoControl - - - 578, 230 - - - 38, 23 - - - 115 - - - + - - - buttonXfplus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 14 - - - 578, 259 - - - 38, 20 - - - 108 - - - textXf - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 15 - - - Flat - - - NoControl - - - 578, 285 - - - 38, 23 - - - 119 - - - - - - - buttonXfminus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 16 - - - True - - - NoControl - - - 578, 311 - - - 44, 13 - - - 127 - - - Position - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 17 - - - Flat - - - MiddleRight - - - NoControl - - - 578, 327 - - - 38, 23 - - - 121 - - - + - - - buttonXcplus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 18 - - - 578, 356 - - - 38, 20 - - - 105 - - - textXc - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 19 - - - Flat - - - NoControl - - - 578, 382 - - - 38, 23 - - - 125 - - - - - - - buttonXcminus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 20 - - - Flat - - - NoControl - - - 622, 230 - - - 38, 23 - - - 116 - - - + - - - buttonYfplus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 21 - - - 622, 259 - - - 38, 20 - - - 107 - - - textYf - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 22 - - - Flat - - - NoControl - - - 622, 285 - - - 38, 23 - - - 118 - - - - - - - buttonYfminus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 23 - - - Flat - - - NoControl - - - 622, 327 - - - 38, 23 - - - 122 - - - + - - - buttonYcplus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 24 - - - 622, 356 - - - 38, 20 - - - 110 - - - textYc - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 25 - - - Flat - - - NoControl - - - 622, 382 - - - 38, 23 - - - 124 - - - - - - - buttonYcminus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 26 - - - Flat - - - NoControl - - - 667, 230 - - - 38, 23 - - - 120 - - - + - - - buttonZfplus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 27 - - - 667, 259 - - - 38, 20 - - - 106 - - - textZf - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 28 - - - Flat - - - NoControl - - - 667, 285 - - - 38, 23 - - - 117 - - - - - - - buttonZfminus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - + 29 - - Flat - - - NoControl - - - 667, 327 - - - 38, 23 - - - 126 - - - + - - - buttonZcplus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 30 - - - 667, 356 - - - 38, 20 - - - 109 - - - textZc - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 31 - - - Flat - - - NoControl - - - 667, 382 - - - 38, 23 - - - 123 - - - - - - - buttonZcminus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 32 - - - HEAD - - - BODY - - - ARM0 - - - ARM1 - - - LEG0 - - - LEG1 - - - 3, 652 - - - 114, 21 - - - 134 - - - comboParent - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 33 - - - Bottom, Left - - + True - + NoControl - - 3, 636 + + 289, 647 - - 38, 13 + + 33, 13 - - 137 + + 102 - - Parent + + View: - - label6 + + labelView - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanelMain + + $this - - 34 + + 28 - + + Flat + + NoControl - - 3, 681 + + 554, 642 - - 114, 23 + + 89, 23 - - 140 + + 100 - - Load Template + + Rotate Right - - buttonTemplate + + rotateRightBtn - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanelMain + + $this - - 35 + + 27 + + + Flat + + + NoControl + + + 194, 643 + + + 89, 23 + + + 101 + + + Rotate Left + + + rotateLeftBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 26 + + + 4, 22 + + + 3, 3, 3, 3 + + + 116, 132 + + + 1 + + + Armor + + + tabArmor + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabBody + + + 0 2 @@ -1390,7 +355,7 @@ Left - 59, 151 + 58, 99 43, 20 @@ -1423,7 +388,7 @@ NoControl - 3, 154 + 3, 103 38, 13 @@ -1450,7 +415,7 @@ Left - 59, 59 + 58, 36 43, 20 @@ -1477,7 +442,7 @@ Left - 59, 105 + 58, 67 43, 20 @@ -1510,7 +475,7 @@ NoControl - 3, 16 + 3, 9 37, 13 @@ -1543,7 +508,7 @@ NoControl - 3, 108 + 3, 71 35, 13 @@ -1570,7 +535,7 @@ Left - 59, 13 + 58, 5 43, 20 @@ -1603,7 +568,7 @@ NoControl - 3, 62 + 3, 40 37, 13 @@ -1636,7 +601,7 @@ 4 - 112, 184 + 110, 126 146 @@ -1663,7 +628,7 @@ 3, 3, 3, 3 - 118, 190 + 116, 132 0 @@ -1681,486 +646,6 @@ tabBody - 0 - - - 2 - - - Left - - - True - - - NoControl - - - 3, 163 - - - 43, 13 - - - 103 - - - CHEST - - - label8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 0 - - - Left - - - 76, 81 - - - 43, 20 - - - 93 - - - 0 - - - offsetBoots - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 1 - - - Left - - - 76, 55 - - - 43, 20 - - - 91 - - - 0 - - - offsetPants - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 2 - - - Left - - - 76, 29 - - - 43, 20 - - - 99 - - - 0 - - - offsetTool - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 3 - - - Left - - - True - - - NoControl - - - 3, 32 - - - 36, 13 - - - 100 - - - TOOL - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 4 - - - Left - - - True - - - NoControl - - - 3, 6 - - - 51, 13 - - - 95 - - - HELMET - - - label9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 5 - - - Left - - - 76, 3 - - - 43, 20 - - - 94 - - - 0 - - - offsetHelmet - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 6 - - - Left - - - True - - - NoControl - - - 3, 84 - - - 44, 13 - - - 98 - - - BOOTS - - - label15 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 7 - - - Left - - - True - - - NoControl - - - 3, 58 - - - 43, 13 - - - 96 - - - PANTS - - - label16 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 8 - - - Left - - - True - - - NoControl - - - 3, 136 - - - 42, 13 - - - 101 - - - WAIST - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 9 - - - Left - - - True - - - NoControl - - - 3, 110 - - - 67, 13 - - - 102 - - - SHOULDER - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 10 - - - Left - - - 76, 107 - - - 43, 20 - - - 104 - - - 0 - - - offsetShoulder - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 11 - - - Left - - - 76, 133 - - - 43, 20 - - - 105 - - - 0 - - - offsetWaist - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 12 - - - Left - - - 76, 160 - - - 43, 20 - - - 106 - - - 0 - - - Chest - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - myTablePanel1 - - - 13 - - - Fill - - - 3, 3 - - - 7 - - - 112, 184 - - - 145 - - - myTablePanel1 - - - PckStudio.Forms.MyTablePanel, PCK Studio, Version=5.3.0.0, Culture=neutral, PublicKeyToken=null - - - tabArmor - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label8" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="offsetBoots" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="offsetPants" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="offsetTool" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label9" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="offsetHelmet" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label15" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label16" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="offsetShoulder" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="offsetWaist" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="Chest" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="Percent,14.28571,Percent,14.28571,Percent,14.28571,Percent,14.28571,Percent,14.28571,Percent,14.28571,Percent,14.28571" /></TableLayoutSettings> - - - 4, 22 - - - 3, 3, 3, 3 - - - 118, 190 - - - 1 - - - Armor - - - tabArmor - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabBody - - 1 @@ -2170,7 +655,7 @@ 3, 16 - 126, 216 + 124, 158 144 @@ -2187,14 +672,11 @@ 0 - - Fill - - 578, 411 + 654, 459 - 132, 235 + 130, 177 139 @@ -2209,226 +691,499 @@ System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - tableLayoutPanelMain + $this - 36 + 24 - - Bottom, Left - - + True - + NoControl - - 3, 395 + + 23, 459 - - 65, 13 + + 38, 13 - - 144 + + 137 - - Background + + Parent - - labelTheme + + label6 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanelMain + + $this - - 37 + + 22 - - Fill + + HEAD - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAVCbGFja/////8F+/// - /xRTeXN0ZW0uRHJhd2luZy5Db2xvcgQAAAAEbmFtZQV2YWx1ZQprbm93bkNvbG9yBXN0YXRlAQAAAAkH - BwMAAAAKAAAAAAAAAAAjAAEAAAkGAAAAAfn////7////CgAAAAAAAAAApAABAAEFBgAAABNTeXN0ZW0u - RHJhd2luZy5Gb250BAAAAAROYW1lBFNpemUFU3R5bGUEVW5pdAEABAQLGFN5c3RlbS5EcmF3aW5nLkZv - bnRTdHlsZQMAAAAbU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AwAAAAMAAAAGCAAAABRNaWNyb3Nv - ZnQgU2FucyBTZXJpZgAABEEF9////xhTeXN0ZW0uRHJhd2luZy5Gb250U3R5bGUBAAAAB3ZhbHVlX18A - CAMAAAAAAAAABfb///8bU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AQAAAAd2YWx1ZV9fAAgDAAAA - AwAAAAs= - + + BODY - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAZTaWx2ZXL/////Bfv/ - //8UU3lzdGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJ - BwcDAAAACgAAAAAAAAAAlgABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVt - LkRyYXdpbmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5G - b250U3R5bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAUTWljcm9z - b2Z0IFNhbnMgU2VyaWYAAARBBff///8YU3lzdGVtLkRyYXdpbmcuRm9udFN0eWxlAQAAAAd2YWx1ZV9f - AAgDAAAAAAAAAAX2////G1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAEAAAAHdmFsdWVfXwAIAwAA - AAMAAAAL - + + ARM0 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAANSZWT/////Bfv///8U - U3lzdGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcD - AAAACgAAAAAAAAAAjQABAAAJBgAAAAH5////+////woAAAAAAAAAAKQAAQABBQYAAAATU3lzdGVtLkRy - YXdpbmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250 - U3R5bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAUTWljcm9zb2Z0 - IFNhbnMgU2VyaWYAAARBBff///8YU3lzdGVtLkRyYXdpbmcuRm9udFN0eWxlAQAAAAd2YWx1ZV9fAAgD - AAAAAAAAAAX2////G1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAEAAAAHdmFsdWVfXwAIAwAAAAMA - AAAL - + + ARM1 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAARDeWFu/////wX7//// - FFN5c3RlbS5EcmF3aW5nLkNvbG9yBAAAAARuYW1lBXZhbHVlCmtub3duQ29sb3IFc3RhdGUBAAAACQcH - AwAAAAoAAAAAAAAAADAAAQAACQYAAAAB+f////v///8KAAAAAAAAAAAaAAEAAQUGAAAAE1N5c3RlbS5E - cmF3aW5nLkZvbnQEAAAABE5hbWUEU2l6ZQVTdHlsZQRVbml0AQAEBAsYU3lzdGVtLkRyYXdpbmcuRm9u - dFN0eWxlAwAAABtTeXN0ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQDAAAAAwAAAAYIAAAAFE1pY3Jvc29m - dCBTYW5zIFNlcmlmAAAEQQX3////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAI - AwAAAAAAAAAF9v///xtTeXN0ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAAD - AAAACw== - + + LEG0 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAVHcmVlbv////8F+/// - /xRTeXN0ZW0uRHJhd2luZy5Db2xvcgQAAAAEbmFtZQV2YWx1ZQprbm93bkNvbG9yBXN0YXRlAQAAAAkH - BwMAAAAKAAAAAAAAAABPAAEAAAkGAAAAAfn////7////CgAAAAAAAAAApAABAAEFBgAAABNTeXN0ZW0u - RHJhd2luZy5Gb250BAAAAAROYW1lBFNpemUFU3R5bGUEVW5pdAEABAQLGFN5c3RlbS5EcmF3aW5nLkZv - bnRTdHlsZQMAAAAbU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AwAAAAMAAAAGCAAAABRNaWNyb3Nv - ZnQgU2FucyBTZXJpZgAABEEF9////xhTeXN0ZW0uRHJhd2luZy5Gb250U3R5bGUBAAAAB3ZhbHVlX18A - CAMAAAAAAAAABfb///8bU3lzdGVtLkRyYXdpbmcuR3JhcGhpY3NVbml0AQAAAAd2YWx1ZV9fAAgDAAAA - AwAAAAs= - + + LEG1 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAZZZWxsb3f/////Bfv/ - //8UU3lzdGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJ - BwcDAAAACgAAAAAAAAAApgABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVt - LkRyYXdpbmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5G - b250U3R5bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAUTWljcm9z - b2Z0IFNhbnMgU2VyaWYAAARBBff///8YU3lzdGVtLkRyYXdpbmcuRm9udFN0eWxlAQAAAAd2YWx1ZV9f - AAgDAAAAAAAAAAX2////G1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAEAAAAHdmFsdWVfXwAIAwAA - AAMAAAAL - + + 23, 484 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAZJbmRpZ2//////Bfv/ - //8UU3lzdGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJ - BwcDAAAACgAAAAAAAAAAVAABAAAJBgAAAAH5////+////woAAAAAAAAAAKQAAQABBQYAAAATU3lzdGVt - LkRyYXdpbmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5G - b250U3R5bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAUTWljcm9z - b2Z0IFNhbnMgU2VyaWYAAARBBff///8YU3lzdGVtLkRyYXdpbmcuRm9udFN0eWxlAQAAAAd2YWx1ZV9f - AAgDAAAAAAAAAAX2////G1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAEAAAAHdmFsdWVfXwAIAwAA - AAMAAAAL - + + 114, 21 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAdDYXB0aW9u/////wX7 - ////FFN5c3RlbS5EcmF3aW5nLkNvbG9yBAAAAARuYW1lBXZhbHVlCmtub3duQ29sb3IFc3RhdGUBAAAA - CQcHAwAAAAoAAAAAAAAAABEAAQAACQYAAAAB+f////v///8KAAAAAAAAAAAaAAEAAQUGAAAAE1N5c3Rl - bS5EcmF3aW5nLkZvbnQEAAAABE5hbWUEU2l6ZQVTdHlsZQRVbml0AQAEBAsYU3lzdGVtLkRyYXdpbmcu - Rm9udFN0eWxlAwAAABtTeXN0ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQDAAAAAwAAAAYIAAAAFE1pY3Jv - c29mdCBTYW5zIFNlcmlmAAAEQQX3////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVf - XwAIAwAAAAAAAAAF9v///xtTeXN0ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMA - AAADAAAACw== - + + 134 - - 3, 411 + + comboParent - - 121, 222 + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + $this + + + 21 + + + True + + + NoControl + + + 691, 357 + + + 44, 13 + + + 127 + + + Position + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 31 + + + True + + + NoControl + + + 691, 259 + + + 27, 13 + + + 142 + + + Size + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 30 + + + False + + + Flat + + + NoControl + + + 722, 206 + + + 61, 21 + + + 114 + + + EXPORT + + + buttonEXPORT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 18 + + + True + + + NoControl + + + 654, 236 + + + 22, 13 + + + 131 + + + UV + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 25 + + + False + + + Flat + + + NoControl + + + 655, 206 + + + 61, 21 + + + 128 + + + IMPORT + + + buttonIMPORT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 23 + + + NoControl + + + 655, 72 + + + 128, 128 + + + Zoom + + + 112 + + + texturePreview + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 20 + + + True + + + NoControl + + + 655, 56 + + + 128, 13 + + + 113 + + + Texture Mapping Preview + + + labelTextureMappingPreview + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 19 + + + Flat + + + NoControl + + + 306, 677 + + + 106, 21 + + + 96 + + + OPEN CSM + + + buttonImportModel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 17 + + + NoControl + + + 194, 56 + + + 449, 580 + + + StretchImage + + + 98 + + + displayBox + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 13 + + + Flat + + + NoControl + + + 418, 677 + + + 89, 21 + + + 97 + + + EXPORT CSM + + + buttonExportModel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 16 + + + Flat + + + NoControl + + + 194, 677 + + + 106, 21 + + 145 - - listViewBGs + + OPEN JSON - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + OpenJSONButton - - tableLayoutPanelMain + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 38 + + $this + + + 15 + + + 23, 511 + + + 114, 21 + + + 146 + + + Load Template + + + buttonTemplate + + + MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a + + + $this + + + 12 + + + True + + + 23, 556 + + + 140, 15 + + + 147 + + + Auto Generate Texture + + + checkTextureGenerate + + + MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a + + + $this + + + 11 + + + True + + + 23, 577 + + + 84, 15 + + + 148 + + + Guide Lines + + + checkGuide + + + MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a + + + $this + + + 10 True - - NoControl - - 382, 681 + 23, 598 - 119, 17 + 129, 15 - 143 + 149 Show Armor Offsets @@ -2437,91 +1192,289 @@ checkBoxArmor - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - tableLayoutPanelMain - - - 44 - - - Flat - - - NoControl - - - 645, 681 - - - 64, 22 - - - 111 - - - Create - - - buttonDone - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelMain - - - 45 - - - 20, 60 - - - 20 - - - 713, 707 - - - 144 - - - tableLayoutPanelMain - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this - + + 9 + + + 658, 275 + + + 119, 20 + + + 150 + + + Center + + + SizeXUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 658, 301 + + + 119, 20 + + + 151 + + + Center + + + SizeYUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 658, 327 + + + 119, 20 + + + 152 + + + Center + + + SizeZUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 682, 233 + + + 43, 20 + + + 156 + + + TextureXUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 731, 234 + + + 43, 20 + + + 157 + + + TextureYUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 657, 425 + + + 120, 20 + + + 160 + + + Center + + + PosZUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 1 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelModeParts" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="OpenJSONButton" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="listViewBoxes" Row="1" RowSpan="14" Column="0" ColumnSpan="1" /><Control Name="buttonExportModel" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="displayBox" Row="1" RowSpan="17" Column="1" ColumnSpan="3" /><Control Name="buttonImportModel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelTextureMappingPreview" Row="0" RowSpan="1" Column="5" ColumnSpan="6" /><Control Name="texturePreview" Row="1" RowSpan="5" Column="5" ColumnSpan="6" /><Control Name="buttonIMPORT" Row="6" RowSpan="1" Column="5" ColumnSpan="3" /><Control Name="label7" Row="7" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="buttonEXPORT" Row="6" RowSpan="1" Column="8" ColumnSpan="3" /><Control Name="textTextureY" Row="7" RowSpan="1" Column="6" ColumnSpan="2" /><Control Name="textTextureX" Row="7" RowSpan="1" Column="8" ColumnSpan="2" /><Control Name="label3" Row="8" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="buttonXfplus" Row="9" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="textXf" Row="10" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="buttonXfminus" Row="11" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="label5" Row="12" RowSpan="1" Column="5" ColumnSpan="3" /><Control Name="buttonXcplus" Row="13" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="textXc" Row="14" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="buttonXcminus" Row="15" RowSpan="1" Column="5" ColumnSpan="2" /><Control Name="buttonYfplus" Row="9" RowSpan="1" Column="7" ColumnSpan="2" /><Control Name="textYf" Row="10" RowSpan="1" Column="7" ColumnSpan="2" /><Control Name="buttonYfminus" Row="11" RowSpan="1" Column="7" ColumnSpan="2" /><Control Name="buttonYcplus" Row="13" RowSpan="1" Column="7" ColumnSpan="2" /><Control Name="textYc" Row="14" RowSpan="1" Column="7" ColumnSpan="2" /><Control Name="buttonYcminus" Row="15" RowSpan="1" Column="7" ColumnSpan="2" /><Control Name="buttonZfplus" Row="9" RowSpan="1" Column="9" ColumnSpan="2" /><Control Name="textZf" Row="10" RowSpan="1" Column="9" ColumnSpan="2" /><Control Name="buttonZfminus" Row="11" RowSpan="1" Column="9" ColumnSpan="2" /><Control Name="buttonZcplus" Row="13" RowSpan="1" Column="9" ColumnSpan="2" /><Control Name="textZc" Row="14" RowSpan="1" Column="9" ColumnSpan="2" /><Control Name="buttonZcminus" Row="15" RowSpan="1" Column="9" ColumnSpan="2" /><Control Name="comboParent" Row="18" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label6" Row="17" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonTemplate" Row="19" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox1" Row="16" RowSpan="2" Column="5" ColumnSpan="6" /><Control Name="labelTheme" Row="15" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="listViewBGs" Row="16" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button2" Row="18" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="button1" Row="18" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="labelView" Row="18" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="checkGuide" Row="19" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkTextureGenerate" Row="19" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="checkBoxArmor" Row="19" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="buttonDone" Row="19" RowSpan="1" Column="8" ColumnSpan="3" /></Controls><Columns Styles="AutoSize,0,Percent,25,Percent,31.25,Percent,43.75,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> + + 658, 399 - - 609, 191 + + 119, 20 - - 30, 20 + + 159 - - 130 + + Center - - textTextureY + + PosYUpDown - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanelMain + + $this - - 11 + + 2 + + + 658, 373 + + + 119, 20 + + + 158 + + + Center + + + PosXUpDown + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + Part + + + 40 + + + X + + + Center + + + 25 + + + Y + + + Center + + + 25 + + + Z + + + Center + + + 25 + + + Width + + + Center + + + Height + + + Center + + + Length + + + Center + + + U + + + Center + + + 25 + + + V + + + Center + + + 25 + + + 23, 59 + + + 165, 378 + + + 132 + + + listViewBoxes + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 14 True @@ -2533,7 +1486,7 @@ 6, 13 - 753, 787 + 806, 721 @@ -4296,6 +3249,60 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Part + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + X + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Y + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Z + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Width + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Height + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Length + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + U + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + V + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + generateModel