From 663ec5c5366b8ed65bfb43e8cfce94d457222b28 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 14 May 2018 15:46:36 -0700 Subject: [PATCH] Add sound path Closes #1943 --- PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs | 6 ++++-- PKHeX.WinForms/MainWindow/Main.cs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs index 937a1d8d0..31699ef32 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs @@ -178,11 +178,13 @@ namespace PKHeX.WinForms.Controls return; string resource = $"{pk.Species}-{pk.AltForm}"; - var path = Path.Combine("sounds", $"{resource}.wav"); + string getpath() => Path.Combine(Main.CryPath, $"{resource}.wav"); + + var path = getpath(); if (!File.Exists(path)) { resource = $"{pk.Species}"; - path = Path.Combine("sounds", $"{resource}.wav"); + path = getpath(); if (!File.Exists(path)) return; } diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index 8ad4817cf..77e308745 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -92,6 +92,7 @@ namespace PKHeX.WinForms public static string DatabasePath => Path.Combine(WorkingDirectory, "pkmdb"); public static string MGDatabasePath => Path.Combine(WorkingDirectory, "mgdb"); public static string BackupPath => Path.Combine(WorkingDirectory, "bak"); + public static string CryPath => Path.Combine(WorkingDirectory, "sounds"); private static string TemplatePath => Path.Combine(WorkingDirectory, "template"); private static string PluginPath => Path.Combine(WorkingDirectory, "plugins"); private const string ThreadPath = "https://projectpokemon.org/pkhex/";