Fix Missing PK1->PK7 Geolocations (#764) & dll missing

* Check for Missing Code Library with Error Message

If PKHeX.Core (or other external dependency) is missing, display an
error message at launch.

Closes #763

* Fix Missing PK1->PK7 Geolocation
This commit is contained in:
ReignOfComputer 2017-01-29 01:48:00 +08:00 committed by Kaphotics
parent 89ad74eddb
commit fa9fba464b
2 changed files with 15 additions and 0 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Threading;
using System.Windows.Forms;
@ -23,6 +24,18 @@ namespace PKHeX.WinForms
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
#endif
try
{
StartPKHeX();
}
catch (FileNotFoundException)
{
MessageBox.Show("Could not locate PKHeX.Core.dll. Make sure you're running PKHeX together with its code library. Usually caused when all files are not extracted.", "PKHeX Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
static void StartPKHeX()
{
// Run the application
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

View file

@ -350,6 +350,8 @@ namespace PKHeX.Core
HT_Name = PKMConverter.OT_Name,
HT_Gender = PKMConverter.OT_Gender,
Language = PKMConverter.Language,
Geo1_Country = PKMConverter.Country,
Geo1_Region = PKMConverter.Region
};
pk7.OT_Friendship = pk7.HT_Friendship = PersonalTable.SM[Species].BaseFriendship;