diff --git a/PKHeX.WinForms/Util/DevUtil.cs b/PKHeX.WinForms/Util/DevUtil.cs index 6cab0f106..cfed19aec 100644 --- a/PKHeX.WinForms/Util/DevUtil.cs +++ b/PKHeX.WinForms/Util/DevUtil.cs @@ -91,15 +91,16 @@ namespace PKHeX.WinForms nameof(SplashScreen), "Gender=", // editor gender labels "BTN_Shinytize", // ☆ - "Main.L_SizeH", // height rating - "Main.L_SizeW", // weight rating - "Main.B_Box", // << and >> arrows - "Main.L_Characteristic=", // Characterstic (dynamic) - "Main.L_Potential", // ★☆☆☆ IV judge evaluation - "SAV_HoneyTree.L_Tree0", // dynamic, don't bother - "SAV_Misc3.BTN_Symbol", // symbols should stay as their current character - "SAV_GameSelect.L_Prompt", // prompt text (dynamic) - "SAV_BlockDump8.L_BlockName", // Block name (dynamic) + $"{nameof(Main)}.L_SizeH", // height rating + $"{nameof(Main)}.L_SizeW", // weight rating + $"{nameof(Main)}.B_Box", // << and >> arrows + $"{nameof(Main)}.L_Characteristic=", // Characterstic (dynamic) + $"{nameof(Main)}.L_Potential", // ★☆☆☆ IV judge evaluation + $"{nameof(SAV_HoneyTree)}.L_Tree0", // dynamic, don't bother + $"{nameof(SAV_Misc3)}.BTN_Symbol", // symbols should stay as their current character + $"{nameof(SAV_GameSelect)}.L_Prompt", // prompt text (dynamic) + $"{nameof(SAV_BlockDump8)}.L_BlockName", // Block name (dynamic) + $"{nameof(SAV_PokedexResearchEditorLA)}.L_", // Dynamic label }; private static readonly string[] PurgeBanlist = @@ -142,12 +143,15 @@ namespace PKHeX.WinForms private static string GetResourcePath(params string[] subdir) { var path = Application.StartupPath; - const string projname = "PKHeX\\"; - var pos = path.LastIndexOf(projname, StringComparison.Ordinal); - var str = path[..(pos + projname.Length)]; - var coreFolder = Path.Combine(str, Path.Combine(subdir)); - - return coreFolder; + while (true) + { + var parent = Directory.GetParent(path); + if (parent is null) + throw new DirectoryNotFoundException(); + path = parent.FullName; + if (path.EndsWith("HeX")) + return Path.Combine(path, Path.Combine(subdir)); + } } } }