#pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "Common.h" #include "Templates/Tuple.h" #include "AssetLookup.generated.h" class AActor; class UUserWidget; class UlxLookAtWidget; class UStaticMesh; class USkeletalMesh; class UAnimSequence; UCLASS(MinimalAPI) class UlxAssetLookup : public UObject { GENERATED_BODY() private: // // At initialization time, we scan the asset directories // to see what assets are present. These maps store the // result of the scan. Each entry in the map contains a // classname, a short name, and a path: // // -> "/Game/AnimSequences/SEQ_Jump" // TMap, FString> AssetPaths; private: void AddAssets(const TCHAR *Path, UClass *Class, const TCHAR *NamePrefix); static UObject *LoadAsset(const UObject *Context, UClass *Class, UClass *ChildOf, const FString &Name, bool ErrorIfNotFound); public: void RebuildIndex(); // Get a static mesh by name UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context", ExpandEnumAsExecs="ReturnValue"), Category = "Luprex|Asset Loading") static ElxValidOrNotValid LoadStaticMeshAsset( UStaticMesh *&Result, const UObject *Context, const FString &Name, bool ErrorIfNotFound = false); // Get a skeletal mesh by name UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context", ExpandEnumAsExecs="ReturnValue"), Category = "Luprex|Asset Loading") static ElxValidOrNotValid LoadSkeletalMeshAsset( USkeletalMesh *&Result, const UObject *Context, const FString &Name, bool ErrorIfNotFound = false); // Get an animation sequence by name. UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context", ExpandEnumAsExecs="ReturnValue"), Category = "Luprex|Asset Loading") static ElxValidOrNotValid LoadAnimSequenceAsset( UAnimSequence *&Result, const UObject *Context, const FString &Name, bool ErrorIfNotFound = false); // Get a tangible class by name UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context", ExpandEnumAsExecs="ReturnValue"), Category = "Luprex|Asset Loading") static ElxValidOrNotValid LoadTangibleBlueprintAsset( TSubclassOf &Result, const UObject *Context, const FString &Name, bool ErrorIfNotFound = false); // Get a widget blueprint by name UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context", ExpandEnumAsExecs="ReturnValue"), Category = "Luprex|Asset Loading") static ElxValidOrNotValid LoadUserWidgetAsset( TSubclassOf &Result, const UObject *Context, const FString &Name, bool ErrorIfNotFound = false); // Get a look-at widget blueprint by name UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context", ExpandEnumAsExecs="ReturnValue"), Category = "Luprex|Asset Loading") static ElxValidOrNotValid LoadLuaWidgetAsset( TSubclassOf &Result, const UObject *Context, const FString &Name, bool ErrorIfNotFound = false); };