preparing to generate the attribute set from the table

This commit is contained in:
Edward R. Gonzalez 2024-10-21 22:47:37 -04:00
parent 8f81a08d21
commit a1a5f2f309
13 changed files with 100 additions and 12 deletions

3
.vs/ProjectSettings.json Normal file
View File

@ -0,0 +1,3 @@
{
"CurrentProjectSetting": "No Configurations"
}

View File

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\Gasa.sln",
"PreviewInSolutionExplorer": false
}

BIN
.vs/slnx.sqlite Normal file

Binary file not shown.

View File

@ -1,4 +1,8 @@
{
"autoHide.autoHideSideBar": false,
"autoHide.autoHidePanel": false
"autoHide.autoHidePanel": false,
"files.associations": {
"*.rmd": "markdown",
"*.rh": "cpp"
}
}

Binary file not shown.

View File

@ -5,12 +5,12 @@ ProjectName=GASATHON
CopyrightNotice=
[/Script/Gasa.GasaDevOptions]
Tag_PPV=Global_PPV
Tag_GlobalPPV=Global_PPV
+AttributeSets=/Game/Core/Tables/DT_AttributeSet.DT_AttributeSet
TaggedMessageTable=/Game/Core/Tables/DT_TaggedMessages.DT_TaggedMessages
Template_PlayerCamera=/Game/Actors/BP_CameraMount.BP_CameraMount_C
Template_HUD_HostUI=/Game/UI/UI_Host.UI_Host_C
Template_HostWidgetController=/Game/UI/BP_HostWidgetController.BP_HostWidgetController_C
TaggedMessageTable=/Game/Core/Tables/DT_TaggedMessages.DT_TaggedMessages
Tag_GlobalPPV=Global_PPV
[/Script/GameplayAbilities.AbilitySystemGlobals]
bUseDebugTargetFromHud=true

View File

@ -0,0 +1,10 @@
{
"ColumnWidths":
{
"MaxValue": 165,
"Description": 135,
"Category": 96,
"BaseValue": 106,
"Name": 82
}
}

View File

@ -1,5 +1,62 @@
#pragma once
#pragma once
#include "GasaCommon.h"
#include "Engine/DataTable.h"
#include "GasaAbilitySystem.generated.h"
USTRUCT(BlueprintType)
struct GASA_API FAttributeSetField : public FTableRowBase
{
GENERATED_BODY()
FAttributeSetField()
: Name("Provide_Name")
, Description("Provide Description")
, Category("Optional Category")
, BaseValue(0)
, bUseMinAttribute(false)
, bUseMaxAttribute(false)
, MinAttribute("Attribute behaving has minimum value")
, MinValue(0)
, MaxAttribute("Attribute behaving has maximum value")
, MaxValue(0)
{}
virtual ~FAttributeSetField()
{}
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
FString Description;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
FString Category;
// UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
// FGameplayTag Tag;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
float BaseValue;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
bool bUseMinAttribute;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute")
bool bUseMaxAttribute;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute", meta =( EditCondition="bUseMinAttribute", EditConditionHides))
FString MinAttribute;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute", meta =( EditCondition="bUseMinAttribute==false", EditConditionHides))
float MinValue;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute", meta =( EditCondition="bUseMaxAttribute", EditConditionHides))
FString MaxAttribute;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Gameplay Attribute", meta =( EditCondition="bUseMaxAttribute==false", EditConditionHides))
float MaxValue;
};

View File

@ -109,8 +109,6 @@ void UGasaAttributeSet::PostGameplayEffectExecute( FGameplayEffectModCallbackDat
{
SetMaxMana( FMath::Clamp( GetMaxMana(), 0, 99999.000000 ) );
}
PostAttributeChange_Custom();
}
void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute, float& NewValue )
@ -149,8 +147,6 @@ void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute,
{
NewValue = FMath::Clamp( NewValue, 0, 99999.000000 );
}
PreAttributeChange_Custom();
}
void UGasaAttributeSet::GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Networking/GasaNetLibrary.h"
#include "GasaDevOptionsCache.h"

View File

@ -16,6 +16,9 @@ public:
// NOTE(Ed): Any Soft-References must have their includes defined in GasaDevOptions.cpp
// They are used by GasaGen for the GasaDevOptionsCache
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="GAS")
TArray< TSoftObjectPtr<UDataTable>> AttributeSets;
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="UI")
TSoftObjectPtr<UDataTable> TaggedMessageTable;

View File

@ -11,6 +11,12 @@ void FGasaDevOptionsCache::CachedDevOptions()
{
UGasaDevOptions* DevOpts = GetMutDevOptions();
for ( auto& entry : DevOpts->AttributeSets )
{
AttributeSets.Push( entry.LoadSynchronous() );
ensureMsgf( entry != nullptr, TEXT( "An AttributeSets entry is null, DO NOT RUN PIE or else you may get a crash if not handled in BP or C++" ) );
}
TaggedMessageTable = DevOpts->TaggedMessageTable.LoadSynchronous();
ensureMsgf( TaggedMessageTable != nullptr, TEXT( "TaggedMessageTable is null, DO NOT RUN PIE or else you may get a crash if not handled in BP or C++" ) );

View File

@ -8,6 +8,8 @@ struct GASA_API FGasaDevOptionsCache
{
GENERATED_BODY()
UPROPERTY()
TArray<UObject*> AttributeSets;
UPROPERTY()
UObject* TaggedMessageTable;
UPROPERTY()