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