diff --git a/CodeGenerator.cs b/CodeGenerator.cs index ce8eb71ee..55b99b4c0 100644 --- a/CodeGenerator.cs +++ b/CodeGenerator.cs @@ -260,8 +260,23 @@ private void B_Save_Click(object sender, EventArgs e) private void B_Copy_Click(object sender, EventArgs e) { - if (RTB_Code.Text.Length > 0) Clipboard.SetText(RTB_Code.Text); - else {MessageBox.Show("No code created!\n\nClick [Create Diff], then make sure that data appears in the Text Box below.\nIf no code appears, then you didn't save your changes.\n\nBe sure to Set the Pokemon you edited back into a Box/Party slot!","Alert");} + if (RTB_Code.Text.Length > 0) + { + Clipboard.SetText(RTB_Code.Text); + } + else + { + B_Diff.PerformClick(); + try + { + Clipboard.SetText(RTB_Code.Text); + MessageBox.Show("Code generated and copied to clipboard!\n\nNext time click [Create Diff] first.", "Alert"); + } + catch + { + MessageBox.Show("No code created!\n\nClick [Create Diff], then make sure that data appears in the Text Box below.\nIf no code appears, then you didn't save your changes.\n\nBe sure to Set the Pokemon you edited back into a Box/Party slot!", "Alert"); + } + } } private void B_Diff_Click(object sender, EventArgs e) diff --git a/Resources/text/en/lang_en.txt b/Resources/text/en/lang_en.txt index 87e221bfa..dd25d95b7 100644 --- a/Resources/text/en/lang_en.txt +++ b/Resources/text/en/lang_en.txt @@ -16,7 +16,7 @@ - Change stuff below this line, not above. ----------------Overall PKX Interface------------------ Menu_File = File ; Open... ; Save as... ; Exit -Menu_Tools = Tools ; Toggle Box Interface ; Load/Dump Boxes ; Box Data Report ; Code Generator +Menu_Tools = Tools ; Toggle Box Interface ; Load/Dump Boxes ; Box Data Report ; Code Generator Menu_Options = Options ; Language ; About PKHeX --------------------Main Tab Data---------------------- Tab_Main = Main diff --git a/f1-Main.cs b/f1-Main.cs index 11910ba93..024a4a029 100644 --- a/f1-Main.cs +++ b/f1-Main.cs @@ -6701,7 +6701,11 @@ public bool verifiedpkx() goto invalid; } #endregion - + if (getSpecies() == 0) // Not gonna write 0 species. + { + tabMain.SelectedIndex = 0; + goto invalid; + } // If no errors detected... return true; // else...