diff --git a/MaterialForm.Designer.cs b/MaterialForm.Designer.cs index 11fd9c9..f93dc31 100644 --- a/MaterialForm.Designer.cs +++ b/MaterialForm.Designer.cs @@ -28,7 +28,6 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.identTextBox = new System.Windows.Forms.TextBox(); this.nameTextBox = new System.Windows.Forms.TextBox(); this.bashResistUpDown = new System.Windows.Forms.NumericUpDown(); @@ -51,6 +50,26 @@ private void InitializeComponent() this.cutDmgVerbTextBox = new System.Windows.Forms.TextBox(); this.materialLoaderComboBox = new System.Windows.Forms.ComboBox(); this.densityUpDown = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.clearButton = new System.Windows.Forms.Button(); + this.clipboardButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.bashResistUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cutResistUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.acidResistUpDown)).BeginInit(); @@ -80,7 +99,7 @@ private void InitializeComponent() // // bashResistUpDown // - this.bashResistUpDown.Location = new System.Drawing.Point(60, 146); + this.bashResistUpDown.Location = new System.Drawing.Point(92, 146); this.bashResistUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -97,7 +116,7 @@ private void InitializeComponent() // // cutResistUpDown // - this.cutResistUpDown.Location = new System.Drawing.Point(60, 172); + this.cutResistUpDown.Location = new System.Drawing.Point(92, 172); this.cutResistUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -114,7 +133,7 @@ private void InitializeComponent() // // acidResistUpDown // - this.acidResistUpDown.Location = new System.Drawing.Point(60, 198); + this.acidResistUpDown.Location = new System.Drawing.Point(92, 198); this.acidResistUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -131,7 +150,7 @@ private void InitializeComponent() // // chipResistUpDown // - this.chipResistUpDown.Location = new System.Drawing.Point(60, 276); + this.chipResistUpDown.Location = new System.Drawing.Point(92, 276); this.chipResistUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -148,7 +167,7 @@ private void InitializeComponent() // // elecResistUpDown // - this.elecResistUpDown.Location = new System.Drawing.Point(60, 224); + this.elecResistUpDown.Location = new System.Drawing.Point(92, 224); this.elecResistUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -165,7 +184,7 @@ private void InitializeComponent() // // fireResistUpDown // - this.fireResistUpDown.Location = new System.Drawing.Point(60, 250); + this.fireResistUpDown.Location = new System.Drawing.Point(92, 250); this.fireResistUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -188,7 +207,7 @@ private void InitializeComponent() 0, 0, 131072}); - this.specificHeatLiquidUpDown.Location = new System.Drawing.Point(184, 146); + this.specificHeatLiquidUpDown.Location = new System.Drawing.Point(272, 149); this.specificHeatLiquidUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -211,7 +230,7 @@ private void InitializeComponent() 0, 0, 131072}); - this.specificHeatSolidUpDown.Location = new System.Drawing.Point(184, 172); + this.specificHeatSolidUpDown.Location = new System.Drawing.Point(272, 175); this.specificHeatSolidUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -234,7 +253,7 @@ private void InitializeComponent() 0, 0, 131072}); - this.latentHeatUpDown.Location = new System.Drawing.Point(184, 198); + this.latentHeatUpDown.Location = new System.Drawing.Point(272, 201); this.latentHeatUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -251,7 +270,7 @@ private void InitializeComponent() // // freezePointUpDown // - this.freezePointUpDown.Location = new System.Drawing.Point(184, 224); + this.freezePointUpDown.Location = new System.Drawing.Point(272, 227); this.freezePointUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -268,14 +287,14 @@ private void InitializeComponent() // // salvagedIntoTextBox // - this.salvagedIntoTextBox.Location = new System.Drawing.Point(184, 263); + this.salvagedIntoTextBox.Location = new System.Drawing.Point(272, 266); this.salvagedIntoTextBox.Name = "salvagedIntoTextBox"; this.salvagedIntoTextBox.Size = new System.Drawing.Size(100, 20); this.salvagedIntoTextBox.TabIndex = 12; // // repairedIntoTextBox // - this.repairedIntoTextBox.Location = new System.Drawing.Point(184, 299); + this.repairedIntoTextBox.Location = new System.Drawing.Point(272, 302); this.repairedIntoTextBox.Name = "repairedIntoTextBox"; this.repairedIntoTextBox.Size = new System.Drawing.Size(100, 20); this.repairedIntoTextBox.TabIndex = 13; @@ -283,7 +302,7 @@ private void InitializeComponent() // edibleCheckBox // this.edibleCheckBox.AutoSize = true; - this.edibleCheckBox.Location = new System.Drawing.Point(184, 326); + this.edibleCheckBox.Location = new System.Drawing.Point(272, 329); this.edibleCheckBox.Name = "edibleCheckBox"; this.edibleCheckBox.Size = new System.Drawing.Size(55, 17); this.edibleCheckBox.TabIndex = 14; @@ -293,7 +312,7 @@ private void InitializeComponent() // rottingCheckBox // this.rottingCheckBox.AutoSize = true; - this.rottingCheckBox.Location = new System.Drawing.Point(184, 349); + this.rottingCheckBox.Location = new System.Drawing.Point(272, 352); this.rottingCheckBox.Name = "rottingCheckBox"; this.rottingCheckBox.Size = new System.Drawing.Size(60, 17); this.rottingCheckBox.TabIndex = 15; @@ -303,7 +322,7 @@ private void InitializeComponent() // softCheckBox // this.softCheckBox.AutoSize = true; - this.softCheckBox.Location = new System.Drawing.Point(184, 372); + this.softCheckBox.Location = new System.Drawing.Point(272, 375); this.softCheckBox.Name = "softCheckBox"; this.softCheckBox.Size = new System.Drawing.Size(45, 17); this.softCheckBox.TabIndex = 16; @@ -313,7 +332,7 @@ private void InitializeComponent() // reinforcesCheckBox // this.reinforcesCheckBox.AutoSize = true; - this.reinforcesCheckBox.Location = new System.Drawing.Point(184, 395); + this.reinforcesCheckBox.Location = new System.Drawing.Point(272, 398); this.reinforcesCheckBox.Name = "reinforcesCheckBox"; this.reinforcesCheckBox.Size = new System.Drawing.Size(77, 17); this.reinforcesCheckBox.TabIndex = 17; @@ -338,7 +357,7 @@ private void InitializeComponent() // this.materialLoaderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.materialLoaderComboBox.FormattingEnabled = true; - this.materialLoaderComboBox.Location = new System.Drawing.Point(60, 13); + this.materialLoaderComboBox.Location = new System.Drawing.Point(90, 13); this.materialLoaderComboBox.Name = "materialLoaderComboBox"; this.materialLoaderComboBox.Size = new System.Drawing.Size(121, 21); this.materialLoaderComboBox.TabIndex = 20; @@ -346,7 +365,7 @@ private void InitializeComponent() // // densityUpDown // - this.densityUpDown.Location = new System.Drawing.Point(60, 302); + this.densityUpDown.Location = new System.Drawing.Point(92, 302); this.densityUpDown.Maximum = new decimal(new int[] { 99999, 0, @@ -356,11 +375,213 @@ private void InitializeComponent() this.densityUpDown.Size = new System.Drawing.Size(56, 20); this.densityUpDown.TabIndex = 21; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 61); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(31, 13); + this.label1.TabIndex = 22; + this.label1.Text = "Ident"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(23, 108); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 23; + this.label2.Text = "Name"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(27, 149); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(63, 13); + this.label3.TabIndex = 24; + this.label3.Text = "Bash Resist"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(35, 175); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(55, 13); + this.label4.TabIndex = 25; + this.label4.Text = "Cut Resist"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(30, 201); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(60, 13); + this.label5.TabIndex = 26; + this.label5.Text = "Acid Resist"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(30, 227); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(60, 13); + this.label6.TabIndex = 27; + this.label6.Text = "Elec Resist"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(34, 253); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(56, 13); + this.label7.TabIndex = 28; + this.label7.Text = "Fire Resist"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(30, 279); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(60, 13); + this.label8.TabIndex = 29; + this.label8.Text = "Chip Resist"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(48, 305); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(42, 13); + this.label9.TabIndex = 30; + this.label9.Text = "Density"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(173, 152); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(97, 13); + this.label10.TabIndex = 31; + this.label10.Text = "Specific Heat Solid"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(168, 178); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(102, 13); + this.label11.TabIndex = 32; + this.label11.Text = "Specific Heat Liquid"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(207, 204); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(63, 13); + this.label12.TabIndex = 33; + this.label12.Text = "Latent Heat"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(204, 230); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(66, 13); + this.label13.TabIndex = 34; + this.label13.Text = "Freeze Point"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(197, 269); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(73, 13); + this.label14.TabIndex = 35; + this.label14.Text = "Salvaged Into"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(199, 305); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(71, 13); + this.label15.TabIndex = 36; + this.label15.Text = "Repaired Into"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(241, 61); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(99, 13); + this.label16.TabIndex = 37; + this.label16.Text = "Bash Damage Verb"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(249, 87); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(91, 13); + this.label17.TabIndex = 38; + this.label17.Text = "Cut Damage Verb"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(15, 16); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(73, 13); + this.label18.TabIndex = 39; + this.label18.Text = "Load Existing:"; + // + // clearButton + // + this.clearButton.Location = new System.Drawing.Point(231, 13); + this.clearButton.Name = "clearButton"; + this.clearButton.Size = new System.Drawing.Size(75, 23); + this.clearButton.TabIndex = 40; + this.clearButton.Text = "Clear"; + this.clearButton.UseVisualStyleBackColor = true; + this.clearButton.Click += new System.EventHandler(this.clearButton_Click); + // + // clipboardButton + // + this.clipboardButton.Location = new System.Drawing.Point(312, 13); + this.clipboardButton.Name = "clipboardButton"; + this.clipboardButton.Size = new System.Drawing.Size(130, 23); + this.clipboardButton.TabIndex = 41; + this.clipboardButton.Text = "Copy Json to Clipboard"; + this.clipboardButton.UseVisualStyleBackColor = true; + this.clipboardButton.Click += new System.EventHandler(this.button2_Click); + // // MaterialForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.clipboardButton); + this.Controls.Add(this.clearButton); + this.Controls.Add(this.label18); + this.Controls.Add(this.label17); + this.Controls.Add(this.label16); + this.Controls.Add(this.label15); + this.Controls.Add(this.label14); + this.Controls.Add(this.label13); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.Controls.Add(this.densityUpDown); this.Controls.Add(this.materialLoaderComboBox); this.Controls.Add(this.cutDmgVerbTextBox); @@ -425,5 +646,25 @@ private void InitializeComponent() private System.Windows.Forms.TextBox cutDmgVerbTextBox; private System.Windows.Forms.ComboBox materialLoaderComboBox; private System.Windows.Forms.NumericUpDown densityUpDown; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Button clearButton; + private System.Windows.Forms.Button clipboardButton; } } \ No newline at end of file diff --git a/MaterialForm.cs b/MaterialForm.cs index 355e255..dc82675 100644 --- a/MaterialForm.cs +++ b/MaterialForm.cs @@ -1,4 +1,6 @@ -using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -16,6 +18,7 @@ public partial class MaterialForm : Form private BindingSource MaterialBindingSource; private void LoadMaterialDataBinding() { + components = new Container(); MaterialBindingSource = new BindingSource(components); ((ISupportInitialize)(MaterialBindingSource)).BeginInit(); @@ -78,5 +81,31 @@ private void materialLoaderComboBox_SelectedIndexChanged(object sender, EventArg main_material = mats[0].DeepCopy(); UpdateMainMaterialBindings(); } + + private void button2_Click(object sender, EventArgs e) + { + + IgnoreEmptyEnumerablesResolver contractResolver = new IgnoreEmptyEnumerablesResolver + { + NamingStrategy = new SnakeCaseNamingStrategy() + }; + + Clipboard.SetText(JsonConvert.SerializeObject( + main_material, + Formatting.Indented, + new JsonSerializerSettings + { + DefaultValueHandling = DefaultValueHandling.Ignore, + ContractResolver = contractResolver + } + )); + } + + private void clearButton_Click(object sender, EventArgs e) + { + main_material = new MaterialType() { }; + materialLoaderComboBox.SelectedIndex = -1; + UpdateMainMaterialBindings(); + } } } diff --git a/MonsterForm.Designer.cs b/MonsterForm.Designer.cs index b873619..ee6b63e 100644 --- a/MonsterForm.Designer.cs +++ b/MonsterForm.Designer.cs @@ -28,7 +28,6 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.nameTextBox = new System.Windows.Forms.TextBox(); this.clipboardButton = new System.Windows.Forms.Button(); this.nameLabel = new System.Windows.Forms.Label();