Last active
June 13, 2021 06:18
-
-
Save universax/0dd0aa04a6f82cf1a6062a4035c76dd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FString AFDVActor::GetSequenceFilePath() | |
{ | |
FString output = ""; | |
FString AppName = FApp::GetProjectName(); | |
// Content Dir path | |
FString ContentDir = FPaths::ProjectContentDir(); | |
UE_LOG(LogTemp, Log, TEXT("TAG: Content: %s"), *ContentDir); | |
// Target path | |
TArray<FString> tmpParsed; | |
_sequenceFile.FilePath.ParseIntoArray(tmpParsed, TEXT("/"), true); | |
FString TargetFilename = tmpParsed.Last(); | |
UE_LOG(LogTemp, Log, TEXT("TAG: Target File is: %s"), *TargetFilename); | |
// List of Content Dir | |
TArray<FString> fileList = GetAllFilesInDirectory(ContentDir, true, false, "", ""); | |
for (auto filename : fileList) { | |
// Filename | |
filename = filename.ToLower(); | |
UE_LOG(LogTemp, Log, TEXT("TAG: FileList of ContentDir: %s"), *filename); | |
if (IFileManager::Get().FileExists(*filename)) { | |
UE_LOG(LogTemp, Log, TEXT("TAG: File Exist ----- %s"), *filename); | |
if (filename.Contains(TargetFilename)) { | |
output = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*filename); | |
output = output.Replace(TEXT(".uasset"), TEXT(".uexp")); | |
// Case: Pak enabled | |
if (output.Contains("Pak: ")) { | |
output = output.ToLower(); | |
output.RemoveFromStart("Pak: "); | |
output = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*output); | |
} | |
break; | |
} | |
} | |
else { | |
UE_LOG(LogTemp, Log, TEXT("TAG: Error: File does't Exist ----- %s"), *filename); | |
} | |
} | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment