Stability fixes

aka idiotproofing
This commit is contained in:
Kurt 2014-07-27 18:53:06 -07:00
parent f370b90612
commit d37838c4d5
3 changed files with 23 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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...