Fix Issue 5: Not saving current entry on FormClose

https://github.com/kwsch/pk3DS/issues/5
Underlying issue is that the entry is not saved when you close the form.
This commit is contained in:
Kurt
2015-04-22 20:31:27 -07:00
parent 5f3e13abc0
commit eb6181cf88
2 changed files with 6 additions and 0 deletions

View File

@@ -2067,6 +2067,7 @@ private void InitializeComponent()
this.MaximizeBox = false;
this.Name = "RSTE";
this.Text = "Trainer Editor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.formClosing);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();

View File

@@ -957,5 +957,10 @@ private int GetRandomMegaEvolvablePokemon(int type)
List<int> valids = megaEvos.Where(spec => (int)personal[spec][6] == type || (int)personal[spec][7] == type).ToList();
return valids[(int)(rnd32() % valids.Count)];
}
private void formClosing(object sender, FormClosingEventArgs e)
{
writeFile();
}
}
}