private void LegalizeActive() { var pk = PKMEditor.PreparePKM(); var la = new LegalityAnalysis(pk); if (la.Valid) { return; // already valid, don't modify it } var sav = SaveFileEditor.SAV; var result = sav.Legalize(pk); // let's double check la = new LegalityAnalysis(result); if (!la.Valid) { var res = WinFormsUtil.ALMError("Unable to make the Active Pokemon legal!", "Please refer to the wiki by clicking on the GitHub button for further help!"); if (res == DialogResult.Yes) { Process.Start("https://discord.gg/tDMvSRv"); } else if (res == DialogResult.No) { Process.Start("https://github.com/architdate/PKHeX-Plugins/wiki/Getting-Started-with-Auto-Legality-Mod"); } return; } PKMEditor.PopulateFields(result); WinFormsUtil.Alert("Legalized Active Pokemon!"); }