From c38f3cb216e33ff881108a2e6ef6505519f5a6d1 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 23 Nov 2016 20:24:46 -0800 Subject: [PATCH] Add gamestring refs for Gen7 report Adds gen2 as well. Closes #482 --- PKHeX/PKM/PKX.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PKHeX/PKM/PKX.cs b/PKHeX/PKM/PKX.cs index 7cba8e3d6..f9fcbdb02 100644 --- a/PKHeX/PKM/PKX.cs +++ b/PKHeX/PKM/PKX.cs @@ -323,6 +323,8 @@ public static string getLocation(PKM pk, bool eggmet) int locval = eggmet ? pk.Egg_Location : pk.Met_Location; + if (pk.Format == 2) + return Main.GameStrings.metGSC_00000[locval]; if (pk.Format == 3) return Main.GameStrings.metRSEFRLG_00000[locval%0x100]; if (pk.Gen4 && (eggmet || pk.Format == 4)) @@ -345,7 +347,14 @@ public static string getLocation(PKM pk, bool eggmet) if (locval < 60000) return Main.GameStrings.metXY_40000[locval % 10000 - 1]; return Main.GameStrings.metXY_60000[locval % 10000 - 1]; } - return null; // Shouldn't happen. + if (pk.Gen7 || pk.Format <= 7) + { + if (locval < 30000) return Main.GameStrings.metSM_00000[locval]; + if (locval < 40000) return Main.GameStrings.metSM_30000[locval % 10000 - 1]; + if (locval < 60000) return Main.GameStrings.metSM_40000[locval % 10000 - 1]; + return Main.GameStrings.metSM_60000[locval % 10000 - 1]; + } + return null; // Shouldn't happen for gen 3+ } public static string[] getQRText(PKM pkm) {