From 9de8c5628890e679e139764f496a340a33284250 Mon Sep 17 00:00:00 2001 From: Alberto Barbati Date: Mon, 8 May 2023 16:01:51 +0200 Subject: [PATCH 1/2] Fixed bug: banks with non-default locale are never recognized even if suffix is correct --- FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp b/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp index 0835f47..22a1830 100644 --- a/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp +++ b/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp @@ -269,7 +269,7 @@ void FFMODAssetBuilder::BuildBankLookup(const FString &AssetName, const FString bool foundLocale = false; for (const FFMODProjectLocale& Locale : InSettings.Locales) { - if (Locale.bDefault && BankPath.EndsWith(FString("_") + Locale.LocaleCode + FString(".bank"))) + if (BankPath.EndsWith(FString("_") + Locale.LocaleCode + FString(".bank"))) { foundLocale = true; break; From 608b826f0105bde1eed29d7809d6cc1684e6da32 Mon Sep 17 00:00:00 2001 From: Alberto Barbati Date: Mon, 5 Jun 2023 09:43:56 +0200 Subject: [PATCH 2/2] Remove warning about banks with locale not matching setting, when they actually do --- .../FMODStudioEditor/Private/FMODAssetBuilder.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp b/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp index 22a1830..9005093 100644 --- a/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp +++ b/FMODStudio/Source/FMODStudioEditor/Private/FMODAssetBuilder.cpp @@ -266,20 +266,23 @@ void FFMODAssetBuilder::BuildBankLookup(const FString &AssetName, const FString FString* otherBankPath = BankGuids.Find(GUID); if (otherBankPath != nullptr) { - bool foundLocale = false; + enum { LocaleNotFound, DefaultLocale, OtherLocale } locale = LocaleNotFound; for (const FFMODProjectLocale& Locale : InSettings.Locales) { if (BankPath.EndsWith(FString("_") + Locale.LocaleCode + FString(".bank"))) { - foundLocale = true; + locale = Locale.bDefault ? DefaultLocale : OtherLocale; break; } } - if (!foundLocale) + if (locale == LocaleNotFound) { - UE_LOG(LogFMOD, Warning, TEXT("Ignoring bank %s as another bank with the same GUID is already being used.\n" - "Bank %s does not match any locales in the FMOD Studio plugin settings."), *BankPath, *BankPath); - continue; + UE_LOG(LogFMOD, Warning, TEXT("Ignoring bank %s as another bank with the same GUID is already being used.\n" + "Bank %s does not match any locales in the FMOD Studio plugin settings."), *BankPath, *BankPath); + } + if (locale != DefaultLocale) + { + continue; } } BankGuids.Add(GUID, BankPath);