diff --git a/.gitignore b/.gitignore index 27e2d30..7a27832 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Binaries +Build DerivedDataCache Intermediate Saved diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini index 57b84de..3fbe229 100644 --- a/Config/DefaultGame.ini +++ b/Config/DefaultGame.ini @@ -1,4 +1,5 @@ + [/Script/EngineSettings.GeneralProjectSettings] ProjectID=09D27A7F49EDD2A17DE1879F3BDEF448 ProjectVersion=0.1 @@ -15,6 +16,107 @@ bMoviesAreSkippable=True bWaitForMoviesToComplete=True [/Script/UnrealEd.ProjectPackagingSettings] +Build=IfProjectHasCode +BuildConfiguration=PPBC_Development +BuildTarget= +FullRebuild=False +ForDistribution=False +IncludeDebugFiles=False +BlueprintNativizationMethod=Disabled +bIncludeNativizedAssetsInProjectGeneration=False +bExcludeMonolithicEngineHeadersInNativizedCode=False +UsePakFile=True bUseIoStore=False +bUseZenStore=False +bMakeBinaryConfig=False +bGenerateChunks=True +bGenerateNoChunks=False +bChunkHardReferencesOnly=False +bForceOneChunkPerFile=False +MaxChunkSize=0 +bBuildHttpChunkInstallData=False +HttpChunkInstallDataDirectory=(Path="") +WriteBackMetadataToAssetRegistry=Disabled +bWritePluginSizeSummaryJsons=False +bCompressed=True +PackageCompressionFormat=Oodle +bForceUseProjectCompressionFormatIgnoreHardwareOverride=False +PackageAdditionalCompressionOptions= +PackageCompressionMethod=Kraken +PackageCompressionLevel_DebugDevelopment=4 +PackageCompressionLevel_TestShipping=4 +PackageCompressionLevel_Distribution=7 +PackageCompressionMinBytesSaved=1024 +PackageCompressionMinPercentSaved=5 +bPackageCompressionEnableDDC=False +PackageCompressionMinSizeToConsiderDDC=0 +HttpChunkInstallDataVersion= +IncludePrerequisites=True +IncludeAppLocalPrerequisites=False +bShareMaterialShaderCode=True +bDeterministicShaderCodeOrder=False +bSharedMaterialNativeLibraries=True +ApplocalPrerequisitesDirectory=(Path="") +IncludeCrashReporter=False +InternationalizationPreset=English +-CulturesToStage=en ++CulturesToStage=en +LocalizationTargetCatchAllChunkId=0 +bCookAll=False +bCookMapsOnly=False bSkipEditorContent=True +bSkipMovies=False +-IniKeyDenylist=KeyStorePassword +-IniKeyDenylist=KeyPassword +-IniKeyDenylist=rsa.privateexp +-IniKeyDenylist=rsa.modulus +-IniKeyDenylist=rsa.publicexp +-IniKeyDenylist=aes.key +-IniKeyDenylist=SigningPublicExponent +-IniKeyDenylist=SigningModulus +-IniKeyDenylist=SigningPrivateExponent +-IniKeyDenylist=EncryptionKey +-IniKeyDenylist=DevCenterUsername +-IniKeyDenylist=DevCenterPassword +-IniKeyDenylist=IOSTeamID +-IniKeyDenylist=SigningCertificate +-IniKeyDenylist=MobileProvision +-IniKeyDenylist=IniKeyDenylist +-IniKeyDenylist=IniSectionDenylist ++IniKeyDenylist=KeyStorePassword ++IniKeyDenylist=KeyPassword ++IniKeyDenylist=rsa.privateexp ++IniKeyDenylist=rsa.modulus ++IniKeyDenylist=rsa.publicexp ++IniKeyDenylist=aes.key ++IniKeyDenylist=SigningPublicExponent ++IniKeyDenylist=SigningModulus ++IniKeyDenylist=SigningPrivateExponent ++IniKeyDenylist=EncryptionKey ++IniKeyDenylist=DevCenterUsername ++IniKeyDenylist=DevCenterPassword ++IniKeyDenylist=IOSTeamID ++IniKeyDenylist=SigningCertificate ++IniKeyDenylist=MobileProvision ++IniKeyDenylist=IniKeyDenylist ++IniKeyDenylist=IniSectionDenylist +-IniSectionDenylist=HordeStorageServers +-IniSectionDenylist=StorageServers ++IniSectionDenylist=HordeStorageServers ++IniSectionDenylist=StorageServers ++DirectoriesToAlwaysCook=(Path="/Game/Misc/Interactables") +bRetainStagedDirectory=False +CustomStageCopyHandler= + +[/Script/Engine.AssetManagerSettings] +-PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) +-PrimaryAssetTypesToScan=(PrimaryAssetType="PrimaryAssetLabel",AssetBaseClass=/Script/Engine.PrimaryAssetLabel,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) ++PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass="/Script/Engine.World",bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) ++PrimaryAssetTypesToScan=(PrimaryAssetType="PrimaryAssetLabel",AssetBaseClass="/Script/Engine.PrimaryAssetLabel",bHasBlueprintClasses=False,bIsEditorOnly=False,Directories=((Path="/Game")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) +bOnlyCookProductionAssets=False +bShouldManagerDetermineTypeAndName=False +bShouldGuessTypeAndNameInEditor=True +bShouldAcquireMissingChunksOnLoad=False +bShouldWarnAboutInvalidAssets=True +MetaDataTagsForAssetRegistry=() diff --git a/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset b/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset new file mode 100644 index 0000000..22bbe71 Binary files /dev/null and b/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset differ diff --git a/Content/Levels/Test/Actors/SaveTest/BP_Test_Load.uasset b/Content/Levels/Test/Actors/SaveTest/BP_Test_SaveLoad.uasset similarity index 68% rename from Content/Levels/Test/Actors/SaveTest/BP_Test_Load.uasset rename to Content/Levels/Test/Actors/SaveTest/BP_Test_SaveLoad.uasset index ca86f3a..066b7bf 100644 Binary files a/Content/Levels/Test/Actors/SaveTest/BP_Test_Load.uasset and b/Content/Levels/Test/Actors/SaveTest/BP_Test_SaveLoad.uasset differ diff --git a/Content/Levels/Test/L_Test.umap b/Content/Levels/Test/L_Test.umap index ab7e81a..19be340 100644 Binary files a/Content/Levels/Test/L_Test.umap and b/Content/Levels/Test/L_Test.umap differ diff --git a/Content/Misc/ImportTest/BP_ImportTest_Barrel.uasset b/Content/Misc/ImportTest/BP_ImportTest_Barrel.uasset new file mode 100644 index 0000000..57aa3d8 Binary files /dev/null and b/Content/Misc/ImportTest/BP_ImportTest_Barrel.uasset differ diff --git a/Content/Misc/ImportTest/Build/pakchunk100-Windows.pak b/Content/Misc/ImportTest/Build/pakchunk100-Windows.pak new file mode 100644 index 0000000..2f77b5d Binary files /dev/null and b/Content/Misc/ImportTest/Build/pakchunk100-Windows.pak differ diff --git a/Content/Misc/ImportTest/DA_ImportTest.uasset b/Content/Misc/ImportTest/DA_ImportTest.uasset new file mode 100644 index 0000000..4dd8f34 Binary files /dev/null and b/Content/Misc/ImportTest/DA_ImportTest.uasset differ diff --git a/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset b/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset new file mode 100644 index 0000000..22bda87 Binary files /dev/null and b/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset differ diff --git a/Content/Misc/ImportTest/M_ImportTest_BarrelRings.uasset b/Content/Misc/ImportTest/M_ImportTest_BarrelRings.uasset new file mode 100644 index 0000000..46914ca Binary files /dev/null and b/Content/Misc/ImportTest/M_ImportTest_BarrelRings.uasset differ diff --git a/Content/Misc/ImportTest/SM_ImportTest_Barrel.uasset b/Content/Misc/ImportTest/SM_ImportTest_Barrel.uasset new file mode 100644 index 0000000..56a1632 Binary files /dev/null and b/Content/Misc/ImportTest/SM_ImportTest_Barrel.uasset differ diff --git a/Source/Lost_Edge/Lost_Edge.Build.cs b/Source/Lost_Edge/Lost_Edge.Build.cs index 6146c8f..f0e199e 100644 --- a/Source/Lost_Edge/Lost_Edge.Build.cs +++ b/Source/Lost_Edge/Lost_Edge.Build.cs @@ -8,7 +8,7 @@ public class Lost_Edge : ModuleRules { PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" }); - PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "TextureCompressor", + PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor", "LevelSequence", "MovieScene" }); // "Slate", "SlateCore" // UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false"))); diff --git a/Source/Lost_Edge/Private/ContentLoader.cpp b/Source/Lost_Edge/Private/ContentLoader.cpp new file mode 100644 index 0000000..c281b88 --- /dev/null +++ b/Source/Lost_Edge/Private/ContentLoader.cpp @@ -0,0 +1,211 @@ +// Oleg Petruny proprietary. + + +#include "ContentLoader.h" + +#include "IPlatformFilePak.h" + +#include "UObject/Class.h" +#include "UObject/UObjectIterator.h" + +namespace +{ + constexpr auto mountPath = TEXT("/Game/LoadedContent"); +} + +UClass* UContentLoader::MountAndRegisterPak(FString pakFilePath) +{ + if(pakFilePath.IsEmpty()) + return nullptr; + + pakFilePath = FPaths::ProjectContentDir() / pakFilePath; + + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, FString::Printf(TEXT("ContentLoader: Starting to mount pak: %s"), *pakFilePath)); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Starting to mount pak: %s"), *pakFilePath); + + if(!MountPak(*pakFilePath)) + return nullptr; + + TArray content; + FString mountPoint = GetPakMountContentPath(pakFilePath, content); + //RegisterMountPoint("/Game/", mountPoint); + + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, FString::Printf(TEXT("ContentLoader: Pak '%s' contains %d items"), *FPaths::GetCleanFilename(pakFilePath), content.Num())); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Pak '%s' contains %d items"), *FPaths::GetCleanFilename(pakFilePath), content.Num()); + + for(auto& i : content) + { + if(FPaths::GetCleanFilename(i).StartsWith(TEXT("BP_"))) + { + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, FString::Printf(TEXT("ContentLoader: Found BP class: '%s'"), *i)); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Found BP class: '%s'"), *i); + return LoadPakObjClassReference(i); + } + } + + return nullptr; +} + +void UContentLoader::BeginDestroy() +{ + while(mountedFiles.Num() > 0) + UnmountPak(*mountedFiles.begin()); + + FPlatformFileManager::Get().RemovePlatformFile(GetPakPlatformFile()); + + UObject::BeginDestroy(); +} + +FPakPlatformFile* UContentLoader::GetPakPlatformFile() +{ + FPakPlatformFile* pakPlatformFile = nullptr; + + IPlatformFile& platformFile = FPlatformFileManager::Get().GetPlatformFile(); + if(!platformFile.GetLowerLevel()) + { + pakPlatformFile = new FPakPlatformFile(); + pakPlatformFile->Initialize(&platformFile, TEXT("")); + FPlatformFileManager::Get().SetPlatformFile(*pakPlatformFile); + } + else + { + pakPlatformFile = (FPakPlatformFile*)(FPlatformFileManager::Get().FindPlatformFile(TEXT("PakFile"))); + } + + if(!pakPlatformFile) + { + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("ContentLoader: PakFileManager not found")); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: PakFileManager not found")); + } + + return pakPlatformFile; +} + +bool UContentLoader::MountPak(const FString& path) +{ + FPakPlatformFile* pakFileMgr = GetPakPlatformFile(); + + if(!pakFileMgr) + return false; + + FString mountPoint = FString::Printf(TEXT("%s/%s"), mountPath, *FPaths::GetBaseFilename(*path)); + bool mounted = pakFileMgr->Mount(*path, 0, *mountPoint); + if(!mounted) + { + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, FString::Printf(TEXT("ContentLoader: Pak %s mount failed"), *FPaths::GetCleanFilename(path))); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Pak %s mount failed"), *FPaths::GetCleanFilename(path)); + return false; + } + else + { + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, FString::Printf(TEXT("ContentLoader: Pak %s mounted at %s"), *FPaths::GetCleanFilename(path), *mountPoint)); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Pak %s mounted at %s"), *FPaths::GetCleanFilename(path), *mountPoint); + + mountedLock.Lock(); + mountedFiles.Add(path); + mountedLock.Unlock(); + } + + return true; +} +bool UContentLoader::UnmountPak(const FString& path) +{ + FPakPlatformFile* pakFileMgr = GetPakPlatformFile(); + + if(!pakFileMgr) + return false; + + bool unmounted = pakFileMgr->Unmount(*path); + if(!unmounted) + { + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, FString::Printf(TEXT("ContentLoader: Pak %s unmount failed"), *FPaths::GetCleanFilename(path))); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Pak %s unmount failed"), *FPaths::GetCleanFilename(path)); + return false; + } + else + { + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, FString::Printf(TEXT("ContentLoader: Pak %s unmounted successfully"), *FPaths::GetCleanFilename(path))); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Pak %s unmounted successfully"), *FPaths::GetCleanFilename(path)); + + mountedLock.Lock(); + mountedFiles.Remove(path); + mountedLock.Unlock(); + } + + return true; +} + +void UContentLoader::RegisterMountPoint(const FString& rootPath, const FString& contentPath) +{ + FPackageName::RegisterMountPoint(rootPath, contentPath); +} +void UContentLoader::UnRegisterMountPoint(const FString& rootPath, const FString& contentPath) +{ + FPackageName::UnRegisterMountPoint(rootPath, contentPath); +} + +FString UContentLoader::GetPakMountPoint(const FString& pakFilePath) +{ + TRefCountPtr pakFile = new FPakFile(FPlatformFileManager::Get().FindPlatformFile(TEXT("PakFile")), *pakFilePath, false); + + if(pakFile.GetReference()->IsValid()) + { + return pakFile.GetReference()->GetMountPoint(); + } + + return {}; +} + +TArray UContentLoader::GetPakContent(const FString& pakFilePath, const FString& appendPath) +{ + TRefCountPtr pakFile = new FPakFile(FPlatformFileManager::Get().FindPlatformFile(TEXT("PakFile")), *pakFilePath, false); + TArray pakContent; + + if(pakFile.GetReference()->IsValid()) + { + for(FPakFile::FFilenameIterator it{ *pakFile, false }; it; ++it) + { + if(FPaths::GetExtension(it.Filename()) == TEXT("uasset")) + { + pakContent.Add(FString::Printf(TEXT("%s%s"), *appendPath, *it.Filename())); + } + } + } + return pakContent; +} + +FString UContentLoader::GetPakMountContentPath(const FString& pakFilePath, TArray& content) +{ + FString contentPath, appendPath; + FString mountPoint = GetPakMountPoint(pakFilePath); + + if(mountPoint.Split("/Content/", &contentPath, &appendPath)) + { + content = GetPakContent(pakFilePath, appendPath); + return FString::Printf(TEXT("%s/Content/"), *contentPath); + } + else + { + content = GetPakContent(pakFilePath, appendPath); + if(content.Num() > 0) + { + mountPoint = FString::Printf(TEXT("%s%s"), *mountPoint, *content[0]); + if(mountPoint.Split("/Content/", &contentPath, &appendPath)) + { + return FString::Printf(TEXT("%s/Content/"), *contentPath); + } + } + } + + return {}; +} + +UClass* UContentLoader::LoadPakObjClassReference(const FString& pakContentPath) +{ + FString assetName = FString::Printf(TEXT("/Game/%s.%s_C"), *FPaths::GetBaseFilename(pakContentPath, false), *FPaths::GetBaseFilename(pakContentPath, true)); + + GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, FString::Printf(TEXT("ContentLoader: Loading '%s' class"), *assetName)); + UE_LOG(LogTemp, Log, TEXT("ContentLoader: Loading '%s' class"), *assetName); + + return StaticLoadClass(UObject::StaticClass(), nullptr, *assetName); +} \ No newline at end of file diff --git a/Source/Lost_Edge/Private/ContentLoader.h b/Source/Lost_Edge/Private/ContentLoader.h new file mode 100644 index 0000000..8448aca --- /dev/null +++ b/Source/Lost_Edge/Private/ContentLoader.h @@ -0,0 +1,39 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "UObject/Object.h" + +#include "ContentLoader.generated.h" + +UCLASS(BlueprintType) +class UContentLoader : public UObject +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintCallable, Category = "ContentLoader") + UClass* MountAndRegisterPak(FString pakFilePath); + + + +protected: + virtual void BeginDestroy() override; + + class FPakPlatformFile* GetPakPlatformFile(); + + bool MountPak(const FString& path); + bool UnmountPak(const FString& path); + + void RegisterMountPoint(const FString& rootPath, const FString& contentPath); + void UnRegisterMountPoint(const FString& rootPath, const FString& contentPath); + + FString GetPakMountPoint(const FString& pakFilePath); + TArray GetPakContent(const FString& pakFilePath, const FString& appendPath); + FString GetPakMountContentPath(const FString& pakFilePath, TArray& content); + + UClass* LoadPakObjClassReference(const FString& pakContentPath); + + TSet mountedFiles; + FCriticalSection mountedLock; +}; diff --git a/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp b/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp index 80f1941..4162ab1 100644 --- a/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp +++ b/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp @@ -9,6 +9,7 @@ #include "Kismet/GameplayStatics.h" #include "CommonFunctions.h" +#include "ContentLoader.h" #include "CustomGameUserSettings.h" #include "Interactable/Activators/InCameraInteractableActivator.h" #include "Interactable/Activators/RaycastInteractableActivator.h" @@ -22,11 +23,12 @@ UCustomGameInstanceBase* UCustomGameInstanceBase::instance = nullptr; void UCustomGameInstanceBase::Init() { - instance = this; - UGameInstance::Init(); - // IN FUTURE ASSIGN FROM CONTENT LOADER MEMBER + instance = this; + + contentLoader = NewObject(this); + interactionsActivators.Add(URaycastInteractableActivator::StaticClass()); interactionsActivators.Add(UInCameraInteractableActivator::StaticClass()); diff --git a/Source/Lost_Edge/Private/CustomGameInstanceBase.h b/Source/Lost_Edge/Private/CustomGameInstanceBase.h index b70a536..4d9e762 100644 --- a/Source/Lost_Edge/Private/CustomGameInstanceBase.h +++ b/Source/Lost_Edge/Private/CustomGameInstanceBase.h @@ -42,4 +42,8 @@ public: UPROPERTY(VisibleAnywhere) class USaveData* saveData = nullptr; + +protected: + class UContentLoader* contentLoader; + }; diff --git a/Source/Lost_Edge/Private/CutsceneManager.cpp b/Source/Lost_Edge/Private/CutsceneManager.cpp index 179e568..132bb2c 100644 --- a/Source/Lost_Edge/Private/CutsceneManager.cpp +++ b/Source/Lost_Edge/Private/CutsceneManager.cpp @@ -18,7 +18,8 @@ UCutsceneManager::UCutsceneManager() { - _inputContext = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/IMC_Cutscene.IMC_Cutscene'") } }; + static ConstructorHelpers::FObjectFinder asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/IMC_Cutscene.IMC_Cutscene'") }; + _inputContext = asset.Object; if(auto world = GetWorld()) { if(auto GI = Cast(world->GetGameInstance())) diff --git a/Source/Lost_Edge/Private/DialogueManager.cpp b/Source/Lost_Edge/Private/DialogueManager.cpp index b04d56e..fb39f60 100644 --- a/Source/Lost_Edge/Private/DialogueManager.cpp +++ b/Source/Lost_Edge/Private/DialogueManager.cpp @@ -20,7 +20,8 @@ UDialogueManager::UDialogueManager() { - _inputContext = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/IMC_Dialogue.IMC_Dialogue'") } }; + static ConstructorHelpers::FObjectFinder asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/IMC_Dialogue.IMC_Dialogue'") }; + _inputContext = asset.Object; if(auto world = GetWorld()) { if(auto GI = Cast(world->GetGameInstance())) diff --git a/Source/Lost_Edge/Private/Interactable/Activators/InteractableScreenCapturer.cpp b/Source/Lost_Edge/Private/Interactable/Activators/InteractableScreenCapturer.cpp index d520aaa..ea2fd42 100644 --- a/Source/Lost_Edge/Private/Interactable/Activators/InteractableScreenCapturer.cpp +++ b/Source/Lost_Edge/Private/Interactable/Activators/InteractableScreenCapturer.cpp @@ -11,7 +11,6 @@ #include "RHIGPUReadback.h" #include "RHIResources.h" #include "SceneView.h" -#include "TextureCompressorModule.h" #include "CommonFunctions.h" #include "Interactable/Interactable.h" @@ -30,7 +29,8 @@ UInteractableScreenCapturer::UInteractableScreenCapturer(const FObjectInitialize PrimaryComponentTick.bCanEverTick = false; PrimaryComponentTick.bStartWithTickEnabled = false; - TextureTarget = LoadObject(this, TEXT("/Game/Misc/Interactables/T_InteractableScreencapturerDebugInput")); + static ConstructorHelpers::FObjectFinder inputTexture{ TEXT("/Script/Engine.TextureRenderTarget2D'/Game/Misc/Interactables/T_InteractableScreencapturerDebugInput.T_InteractableScreencapturerDebugInput'") }; + TextureTarget = inputTexture.Object; //_output = LoadObject(this, TEXT("/Game/Misc/Interactables/T_InteractableScreencapturerDebugOutput")); //TextureTarget = ObjectInitializer.CreateDefaultSubobject(this, TEXT("UInteractableScreenCapturer_TextureRenderTarget")); //TextureTarget->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA8; @@ -49,8 +49,8 @@ UInteractableScreenCapturer::UInteractableScreenCapturer(const FObjectInitialize CompositeMode = ESceneCaptureCompositeMode::SCCM_Overwrite; PostProcessBlendWeight = 1; - auto ppMaterial = LoadObject(this, TEXT("/Game/Misc/Interactables/M_InteractableScreencapturerPP")); - PostProcessSettings.AddBlendable(ppMaterial, 1.0f); + static ConstructorHelpers::FObjectFinder ppMaterial{ TEXT("/Script/Engine.Material'/Game/Misc/Interactables/M_InteractableScreencapturerPP.M_InteractableScreencapturerPP'") }; + PostProcessSettings.AddBlendable(ppMaterial.Object, 1.0f); PostProcessSettings.Sharpen = 0; bUseCustomProjectionMatrix = false; bAlwaysPersistRenderingState = true; diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp index a535557..0e8a784 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/ActivateInteractableModificator.cpp @@ -17,7 +17,8 @@ UActivateInteractableModificator::UActivateInteractableModificator(const FObject { activatorTypes |= static_cast(EActivatorType::Use); - inputMapping = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Interactables/IMC_InteractableActivate.IMC_InteractableActivate'") } }; + static ConstructorHelpers::FObjectFinder asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Interactables/IMC_InteractableActivate.IMC_InteractableActivate'") }; + inputMapping = asset.Object; } void UActivateInteractableModificator::Bind_Implementation(UEnhancedInputComponent* input) diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/InventoryInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/InventoryInteractableModificator.cpp index fbc690d..ac90f8c 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/InventoryInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/InventoryInteractableModificator.cpp @@ -17,7 +17,8 @@ UInventoryInteractableModificator::UInventoryInteractableModificator(const FObje { activatorTypes |= static_cast(EActivatorType::Use); - inputMapping = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Interactables/IMC_InteractableInventory.IMC_InteractableInventory'") } }; + static ConstructorHelpers::FObjectFinder asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Interactables/IMC_InteractableInventory.IMC_InteractableInventory'") }; + inputMapping = asset.Object; } void UInventoryInteractableModificator::Bind_Implementation(UEnhancedInputComponent* input) diff --git a/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp b/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp index 59e35c4..a081215 100644 --- a/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp +++ b/Source/Lost_Edge/Private/Interactable/Modificators/MoveInteractableModificator.cpp @@ -17,7 +17,8 @@ UMoveInteractableModificator::UMoveInteractableModificator(const FObjectInitiali { activatorTypes |= static_cast(EActivatorType::Use); - inputMapping = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Interactables/IMC_InteractableMove.IMC_InteractableMove'") } }; + static ConstructorHelpers::FObjectFinder asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Interactables/IMC_InteractableMove.IMC_InteractableMove'") }; + inputMapping = asset.Object; actor = Cast(GetOwner()); diff --git a/Source/Lost_Edge/Private/Minigame/SubwaySurf/SubwaySurfManager.cpp b/Source/Lost_Edge/Private/Minigame/SubwaySurf/SubwaySurfManager.cpp index 3a5efdd..a904839 100644 --- a/Source/Lost_Edge/Private/Minigame/SubwaySurf/SubwaySurfManager.cpp +++ b/Source/Lost_Edge/Private/Minigame/SubwaySurf/SubwaySurfManager.cpp @@ -18,7 +18,8 @@ ASubwaySurfManager::ASubwaySurfManager() : AMinigame() { - input = { FSoftObjectPath{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Minigame/IMC_SubwaySurf.IMC_SubwaySurf'") } }; + static ConstructorHelpers::FObjectFinder asset{ TEXT("/Script/EnhancedInput.InputMappingContext'/Game/Input/Minigame/IMC_SubwaySurf.IMC_SubwaySurf'") }; + input = asset.Object; auto root = CreateDefaultSubobject(TEXT("Scene"));