feat: Adapter cover work

This commit is contained in:
mrhid6 2024-11-20 20:21:10 +00:00
parent 1fef2bf81e
commit 1a87649dc6
3 changed files with 21 additions and 9 deletions

View File

@ -3,3 +3,14 @@
#include "DataAssets/RRDADataAssetDSAdapterCovers.h" #include "DataAssets/RRDADataAssetDSAdapterCovers.h"
TArray<FTransform> URRDADataAssetDSAdapterCovers::GetWorldTransforms(FTransform OriginTransform) {
TArray<FTransform> transforms;
for (FRRDADSAdapterCoverDetails CoverDetails : mCovers) {
FVector location = OriginTransform.TransformPosition(CoverDetails.mRelativeTransform.GetLocation());
FQuat rotation = OriginTransform.TransformRotation(CoverDetails.mRelativeTransform.GetRotation());
transforms.Add(FTransform(rotation, location, FVector(1.0f)));
}
return transforms;
}

View File

@ -17,11 +17,14 @@ class REFINEDRDAPI_API URRDADataAssetDSAdapterCovers : public URRDADataAssetBase
GENERATED_BODY() GENERATED_BODY()
public: public:
UFUNCTION(BlueprintPure, Category = "AdapterCovers")
TArray<FTransform> GetWorldTransforms(FTransform OriginTransform);
/* The building class these adapter covers belongs to */ /* The building class these adapter covers belongs to */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="AdapterCovers") UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category="AdapterCovers")
TSubclassOf<AFGBuildableFactory> mBuildingClass; TSubclassOf<AFGBuildableFactory> mBuildingClass;
/* An array of covers to place on the buildable connections */ /* An array of covers to place on the buildable connections */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="AdapterCovers") UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category="AdapterCovers")
TArray<FRRDADSAdapterCoverDetails> mCovers; TArray<FRRDADSAdapterCoverDetails> mCovers;
}; };

View File

@ -13,11 +13,11 @@ struct REFINEDRDAPI_API FRRDADSAdapterCoverDetails
public: public:
/* The relative transform from the buildings origin */ /* The relative transform from the buildings origin */
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
FTransform mRelativeTransform; FTransform mRelativeTransform;
/* If the cover should be a conveyor cover or a pipe cover */ /* If the cover should be a conveyor cover or a pipe cover */
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
bool bIsConveyor = true; bool bIsConveyor = true;
}; };
@ -28,13 +28,12 @@ struct REFINEDRDAPI_API FRRDADSModAdapterInventorySlotAccess
GENERATED_BODY() GENERATED_BODY()
public: public:
/* A custom display name for the inventory slot that will be displayed in the digital storage UI. /* A custom display name for the inventory slot that will be displayed in the digital storage UI.
This makes it easier for players to understand what this slot is used for. This makes it easier for players to understand what this slot is used for.
*/ */
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly)
FText mInventorySlotDisplayName; FText mInventorySlotDisplayName;
/* Set how digital storage should interact with this inventory slot */ /* Set how digital storage should interact with this inventory slot */
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly)
ERRDADSInventorySlotAccessInteraction mInteraction = ERRDADSInventorySlotAccessInteraction::Ignore; ERRDADSInventorySlotAccessInteraction mInteraction = ERRDADSInventorySlotAccessInteraction::Ignore;
@ -45,7 +44,7 @@ public:
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly)
EResourceForm mSlotItemForm = EResourceForm::RF_SOLID; EResourceForm mSlotItemForm = EResourceForm::RF_SOLID;
UPROPERTY( meta=(NoAutoJson = true) ) UPROPERTY(meta=(NoAutoJson = true))
bool mOverrideItemFilter = false; bool mOverrideItemFilter = false;
/* Limit the list of items this slot should contain, only items in this list will be displayed on the digital storage UI */ /* Limit the list of items this slot should contain, only items in this list will be displayed on the digital storage UI */
@ -59,11 +58,10 @@ struct REFINEDRDAPI_API FRRDADSModAdapterInventoryAccess
GENERATED_BODY() GENERATED_BODY()
public: public:
/* A custom name that should be used in the digital storage UI, by default will use "Inventory 1" */ /* A custom name that should be used in the digital storage UI, by default will use "Inventory 1" */
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly)
FText mInventoryDisplayName; FText mInventoryDisplayName;
/* The Inventory Name to search for */ /* The Inventory Name to search for */
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly)
FName mInventoryName; FName mInventoryName;