diff --git a/pk3DS/Subforms/RSTE.Designer.cs b/pk3DS/Subforms/RSTE.Designer.cs index 207dbf3..8d3619f 100644 --- a/pk3DS/Subforms/RSTE.Designer.cs +++ b/pk3DS/Subforms/RSTE.Designer.cs @@ -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(); diff --git a/pk3DS/Subforms/RSTE.cs b/pk3DS/Subforms/RSTE.cs index e4673b5..97ec851 100644 --- a/pk3DS/Subforms/RSTE.cs +++ b/pk3DS/Subforms/RSTE.cs @@ -957,5 +957,10 @@ private int GetRandomMegaEvolvablePokemon(int type) List 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(); + } } } \ No newline at end of file