2024-10-24 18:06:58 +02:00

42 lines
1.0 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "RRDADataAssetBase.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDADataAssetBase : public UPrimaryDataAsset
{
GENERATED_BODY()
protected:
/**
* Can be overridden to disable the asset or make some other checks
*/
virtual bool IsEnabled_Internal(UObject* WorldContextObject) const
{
return !mIsDisabled;
}
virtual FPrimaryAssetId GetPrimaryAssetId() const override
{
return FPrimaryAssetId(FPrimaryAssetType("RRDADataAsset"), GetFName());
}
public:
UFUNCTION( BlueprintPure, Category="FicsitFarming|Dirt" )
static bool IsEnabled(URRDADataAssetBase* Asset, UObject* WorldContextObject)
{
if(!Asset) return false;
return Asset->IsEnabled_Internal(WorldContextObject);
};
/**
* Disable this asset from being used in the game
* For example if a mod is disabling some content from another mod
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Asset")
bool mIsDisabled;
};