A modded EditSaber for making beat saber maps.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

  1. #include "ZipUtilityPrivatePCH.h"
  2. #include "ZipFileFunctionInternalCallback.h"
  3. UZipFileFunctionInternalCallback::UZipFileFunctionInternalCallback()
  4. {
  5. CompressionFormat = ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN;
  6. DestinationFolder = FString();
  7. File = FString();
  8. FileIndex = 0;
  9. Callback = NULL;
  10. }
  11. void UZipFileFunctionInternalCallback::OnFileFound_Implementation(const FString& archive, const FString& fileIn, int32 size)
  12. {
  13. if (!bFileFound && fileIn.ToLower().Contains(File.ToLower()))
  14. {
  15. TArray<int32> FileIndices = { FileIndex };
  16. if (bUnzipto)
  17. {
  18. UZipFileFunctionLibrary::UnzipFilesTo(FileIndices, archive, DestinationFolder, Callback, CompressionFormat);
  19. }
  20. else
  21. {
  22. UZipFileFunctionLibrary::UnzipFiles(FileIndices, archive, Callback, CompressionFormat);
  23. }
  24. if (bSingleFile)
  25. {
  26. bFileFound = true;
  27. }
  28. }
  29. FileIndex++;
  30. }
  31. void UZipFileFunctionInternalCallback::SetCallback(const FString& FileName, UObject* CallbackIn, TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormatIn /*= ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN*/)
  32. {
  33. File = FileName;
  34. Callback = CallbackIn;
  35. CompressionFormat = CompressionFormatIn;
  36. FileIndex = 0;
  37. }
  38. void UZipFileFunctionInternalCallback::SetCallback(const FString& FileName, const FString& DestinationFolderIn, UObject* CallbackIn, TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormatIn /*= ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN*/)
  39. {
  40. SetCallback(FileName, CallbackIn, CompressionFormatIn);
  41. bUnzipto = true;
  42. DestinationFolder = DestinationFolderIn;
  43. }