#pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "CommonTypes.h" #include "AssetLookup.generated.h" class AActor; class UUserWidget; class UlxLookAtWidget; class UStaticMesh; UCLASS(MinimalAPI) class UlxAssetLookup : public UObject { GENERATED_BODY() private: // Map from asset name to full loadable path. UPROPERTY() TMap CachedTangibles; // Map from asset name to to full loadable path. UPROPERTY() TMap CachedStaticMeshes; // Map from asset name to full loadable path. UPROPERTY() TMap CachedWidgets; private: void ScanTangibles(); void ScanStaticMeshes(); void ScanWidgets(); public: void RebuildIndex(); // Get the full LoadObject path of a Tangible. FString TangibleLoadPath(const FName &AssetName) const; // Get the full LoadObject path of a Static Mesh. FString StaticMeshLoadPath(const FName &AssetName) const; // Get the full LoadObject path of a Widget Blueprint. FString WidgetLoadPath(const FName &AssetName) const; // Get a static mesh by name UFUNCTION(BlueprintPure, meta = (WorldContext = "Context"), Category = "Luprex|Miscellaneous") static UStaticMesh *GetStaticMeshByName(const UObject *Context, const FString &Name, bool ErrorIfNotFound = false, bool ErrorIfInvalid = true); // Get a tangible class by name UFUNCTION(BlueprintPure, meta = (WorldContext = "Context"), Category = "Luprex|Miscellaneous") static TSubclassOf GetTangibleClassByName(const UObject *Context, const FString &Name, bool ErrorIfNotFound = false, bool ErrorIfInvalid = true); // Get a widget blueprint by name UFUNCTION(BlueprintPure, meta = (WorldContext = "Context"), Category = "Luprex|Miscellaneous") static TSubclassOf GetWidgetByName(const UObject *Context, const FString &Name, bool ErrorIfNotFound = false, bool ErrorIfInvalid = true); // Get a look-at widget blueprint by name UFUNCTION(BlueprintPure, meta = (WorldContext = "Context"), Category = "Luprex|Miscellaneous") static TSubclassOf GetLookAtWidgetByName(const UObject *Context, const FString &Name, bool ErrorIfNotFound = false, bool ErrorIfInvalid = true); };