remove mod folder path prefix from asset path so GetAudio can add it back lol

This commit is contained in:
JohnCorby 2022-06-22 23:10:28 -07:00
parent 22b6388da0
commit f897a9487f
2 changed files with 4 additions and 8 deletions

View File

@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.30204.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OWVoiceMod", "OWVoiceMod\OWVoiceMod.csproj", "{8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostBuildApp", "PostBuildApp\PostBuildApp.csproj", "{60F55877-6B85-49E8-94E9-19E037914E65}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -17,10 +15,6 @@ Global
{8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF}.Release|Any CPU.Build.0 = Release|Any CPU
{60F55877-6B85-49E8-94E9-19E037914E65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60F55877-6B85-49E8-94E9-19E037914E65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60F55877-6B85-49E8-94E9-19E037914E65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60F55877-6B85-49E8-94E9-19E037914E65}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -121,9 +121,10 @@ namespace OWVoiceMod
.Replace("(", "")
.Replace(")", "")
.ToLower();
string assetPath = assetPathS.Substring(ModHelper.Manifest.ModFolderPath.Length);
if (assetFileName.Split('+').Any(x => x == currentAssetName.ToLower()))
{
audioSource.clip = ModHelper.Assets.GetAudio(Path.GetFileName(assetPathS));
audioSource.clip = ModHelper.Assets.GetAudio(assetPath);
if (volume > 0 && audioSource.clip != null) audioSource.Play();
break;
}
@ -177,9 +178,10 @@ namespace OWVoiceMod
.Replace("(", "")
.Replace(")", "")
.ToLower();
string assetPath = assetPathS.Substring(iModHelper.Manifest.ModFolderPath.Length);
if (assetFileName.Split('+').Any(x => x == currentTextName.ToLower()))
{
audioSource.clip = iModHelper.Assets.GetAudio(Path.GetFileName(assetPathS));
audioSource.clip = iModHelper.Assets.GetAudio(assetPath);
if (volume > 0 && audioSource.clip != null) audioSource.Play();
break;
}