From fa9fba464b78e94a0a492c877835e1f1ce64297d Mon Sep 17 00:00:00 2001 From: ReignOfComputer Date: Sun, 29 Jan 2017 01:48:00 +0800 Subject: [PATCH] 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 --- PKHeX.WinForms/Program.cs | 13 +++++++++++++ PKHeX/PKM/PK1.cs | 2 ++ 2 files changed, 15 insertions(+) diff --git a/PKHeX.WinForms/Program.cs b/PKHeX.WinForms/Program.cs index fa9e17837..6230ea9f5 100644 --- a/PKHeX.WinForms/Program.cs +++ b/PKHeX.WinForms/Program.cs @@ -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); diff --git a/PKHeX/PKM/PK1.cs b/PKHeX/PKM/PK1.cs index 50e9fbbd8..ed02ae969 100644 --- a/PKHeX/PKM/PK1.cs +++ b/PKHeX/PKM/PK1.cs @@ -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;