Compare commits

..

No commits in common. "d97ee1d30204f0fc574e8702343f22dff30251bf" and "ef002ccf53ba6035ed0855d6fcf512649a043dbd" have entirely different histories.

66 changed files with 260 additions and 530 deletions

51
.gitignore vendored
View File

@ -1,38 +1,31 @@
*/Binaries/Win64/*.patch_*.* Project/Binaries
Project/Intermediate
Project/.idea Project/Saved/Crashes
Project/Saved/SourceControl
Project/Saved/ShaderDebugInfo
Project/Saved/Logs
Project/Saved/Autosaves
Project/Saved/Config/CrashReportClient
Project/Saved/Config/WindowsEditor
Project/Saved/Config/WorldState
Project/Saved/AutoScreenshot.png
Project/Platforms
Project/.vs Project/.vs
Project/.vsconfig Project/.vsconfig
*.sln
*.target
*.modules
Project/.idea
Project/Binaries Project/Saved/Screenshots
*/Binaries/Win64/*.patch_*.*
Project/Saved/ImGui
Project/Saved/ImGui/imgui.ini
GasaGen_*.pdb
Project/Binaries/GasaGen.exe Project/Binaries/GasaGen.exe
Project/Binaries/GasaGen.map Project/Binaries/GasaGen.map
Project/Binaries/GasaGen.obj Project/Binaries/GasaGen.obj
Project/Binaries/vc140.pdb Project/Binaries/vc140.pdb
Project/Intermediate
Project/Platforms
Project/Saved/Config/ConsoleHistory.ini Project/Saved/Config/ConsoleHistory.ini
Project/Saved/Autosaves
Project/Saved/AutoScreenshot.png
Project/Saved/Config/CrashReportClient
Project/Saved/Config/WindowsEditor
Project/Saved/Config/WorldState
Project/Saved/Crashes
Project/Saved/Diff
Project/Saved/ImGui
Project/Saved/ImGui/imgui.ini
Project/Saved/Logs
Project/Saved/Screenshots
Project/Saved/ShaderDebugInfo
Project/Saved/SourceControl
*.modules
*.pdb *.pdb
*.sln Project/Saved/Diff
*.target
GasaGen_*.pdb

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -49,15 +49,6 @@ r.ReflectionMethod=1
r.Shadow.Virtual.Enable=1 r.Shadow.Virtual.Enable=1
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
r.CustomDepth=3 r.CustomDepth=3
r.DefaultFeature.Bloom=False
r.DefaultFeature.AmbientOcclusion=False
r.DefaultFeature.AmbientOcclusionStaticFraction=False
r.DefaultFeature.AutoExposure=False
r.DefaultFeature.MotionBlur=False
r.AntiAliasingMethod=0
r.MSAACount=1
r.ScreenPercentage.Default=25.000000
r.SupportSkyAtmosphere=False
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings] [/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet' CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'
@ -139,4 +130,3 @@ ManualIPAddress=
+CollisionChannelRedirects=(OldName="Dynamic",NewName="WorldDynamic") +CollisionChannelRedirects=(OldName="Dynamic",NewName="WorldDynamic")
+CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle") +CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
+CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn") +CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")

View File

@ -10,7 +10,6 @@ Tag_GlobalPPV=Global_PPV
Template_PlayerCamera=/Game/Actors/BP_CameraMount.BP_CameraMount_C Template_PlayerCamera=/Game/Actors/BP_CameraMount.BP_CameraMount_C
Template_HUD_HostUI=/Game/UI/UI_Host.UI_Host_C Template_HUD_HostUI=/Game/UI/UI_Host.UI_Host_C
Template_HostWidgetController=/Game/UI/BP_HostWidgetController.BP_HostWidgetController_C Template_HostWidgetController=/Game/UI/BP_HostWidgetController.BP_HostWidgetController_C
TaggedMessageTable=/Game/Core/Tables/DT_TaggedMessages.DT_TaggedMessages
[/Script/GameplayAbilities.AbilitySystemGlobals] [/Script/GameplayAbilities.AbilitySystemGlobals]
bUseDebugTargetFromHud=true bUseDebugTargetFromHud=true

View File

@ -1,20 +0,0 @@
[/Script/GameplayTags.GameplayTagsSettings]
ImportTagsFromConfig=True
WarnOnInvalidTags=True
ClearInvalidTags=False
AllowEditorTagUnloading=True
AllowGameTagUnloading=False
FastReplication=False
InvalidTagCharacters="\"\',"
+GameplayTagTableList=/Game/Core/Tables/DT_PrimaryAttributes.DT_PrimaryAttributes
NumBitsForContainerSize=6
NetIndexFirstBitSegment=16
+GameplayTagList=(Tag="Attributes.Vital.Health",DevComment="")
+GameplayTagList=(Tag="Attributes.Vital.Mana",DevComment="")
+GameplayTagList=(Tag="Attributes.Vital.MaxHealth",DevComment="")
+GameplayTagList=(Tag="Attributes.Vital.MaxMana",DevComment="")
+GameplayTagList=(Tag="Message.Crystal.Health",DevComment="")
+GameplayTagList=(Tag="Message.Crystal.Mana",DevComment="")
+GameplayTagList=(Tag="Message.Potion.Health",DevComment="")
+GameplayTagList=(Tag="Message.Potion.Mana",DevComment="")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Project/Content/Core/BP_AreaFire.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Project/Content/Core/Game/BP_HUD.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Project/Content/Core/Pickups/BP_HealthCrystal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Project/Content/Core/Pickups/BP_HealthPotion.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
Project/Content/Core/Pickups/BP_ManaCrystal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Project/Content/Levels/StartupMap.umap (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Project/Content/UI/RTD_Default.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Project/Content/UI/UI_EffectMessage.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Project/Content/UI/UI_GlobeTemplate.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Project/Content/UI/UI_Host.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -1,7 +0,0 @@
{
"ColumnWidths":
{
"DevComment": 405,
"Tag": 381
}
}

View File

@ -1,6 +0,0 @@
{
"ColumnWidths":
{
"TextStyle": 1099
}
}

View File

@ -1,9 +0,0 @@
{
"ColumnWidths":
{
"Image": 487,
"Tag": 246,
"Message": 439,
"MessageTemplate": 232
}
}

View File

@ -1,38 +0,0 @@
#include "EffectProperties.h"
#include "AbilitySystemComponent.h"
#include "AbilitySystemGlobals.h"
#include "GameplayEffect.h"
#include "GameplayEffectExtension.h"
#include "GameFramework/Pawn.h"
#include "GameFramework/PlayerController.h"
void FEffectProperties::Populate(FGameplayEffectModCallbackData const& Data)
{
Context = Data.EffectSpec.GetContext();
SourceAbilitySystem = Context.GetOriginalInstigatorAbilitySystemComponent();
if (IsValid(SourceAbilitySystem)
&& SourceAbilitySystem->AbilityActorInfo.IsValid()
&& SourceAbilitySystem->AbilityActorInfo->AvatarActor.IsValid())
{
FGameplayAbilityActorInfo* AbilityInfo = SourceAbilitySystem->AbilityActorInfo.Get();
SourceAvatar = AbilityInfo->AvatarActor.Get();
SourceController = AbilityInfo->PlayerController.Get();
if (SourceController == nullptr && SourceAvatar)
{
APawn* Pawn = Cast<APawn>(SourceAvatar);
if (Pawn)
SourceController = Pawn->GetController();
}
}
if (Data.Target.AbilityActorInfo.IsValid() && Data.Target.AbilityActorInfo->AvatarActor.IsValid())
{
FGameplayAbilityActorInfo* AbilityInfo = Data.Target.AbilityActorInfo.Get();
TargetAvatar = AbilityInfo->AvatarActor.Get();
TargetController = AbilityInfo->PlayerController.Get();
TargetAbilitySystem = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(TargetAvatar);
}
}

View File

@ -1,34 +0,0 @@
#pragma once
#include "GameplayEffectTypes.h"
#include "GasaCommon.h"
#include "EffectProperties.generated.h"
USTRUCT()
struct GASA_API FEffectProperties
{
GENERATED_BODY()
FGameplayEffectContextHandle Context;
UPROPERTY(VisibleAnywhere)
UAbilitySystemComponent* SourceAbilitySystem;
UPROPERTY(VisibleAnywhere)
AActor* SourceAvatar;
UPROPERTY(VisibleAnywhere)
AController* SourceController;
UPROPERTY(VisibleAnywhere)
UAbilitySystemComponent* TargetAbilitySystem;
UPROPERTY(VisibleAnywhere)
AActor* TargetAvatar;
UPROPERTY(VisibleAnywhere)
APlayerController* TargetController;
void Populate(FGameplayEffectModCallbackData const& Data);
};

View File

@ -1,33 +1 @@
#include "GasaAbilitySystemComponent.h" #include "GasaAbilitySystemComponent.h"
#include "Engine/Engine.h"
#include "Engine/GameViewportClient.h"
#include "Game/GasaGameState.h"
#include "Game/GasaPlayerController.h"
#include "GameFramework/HUD.h"
#include "Slate/SceneViewport.h"
#include "UI/GasaHUD.h"
#include "CogDebugDraw.h"
using namespace Gasa;
void UGasaAbilitySystemComp::OnAbilityActorInfoSet()
{
if ( ! OnGameplayEffectAppliedDelegateToSelf.IsBoundToObject(this))
OnGameplayEffectAppliedDelegateToSelf.AddUObject(this, & ThisClass::EffectApplied);
}
void UGasaAbilitySystemComp::EffectApplied(UAbilitySystemComponent* AbilitySystem, FGameplayEffectSpec const& Spec,
FActiveGameplayEffectHandle ActiveEffect)
{
Log("EFFECT APPLIED?");
FGameplayTagContainer Tags;
Spec.GetAllAssetTags(Tags);
Event_OnEffectAppliedAssetTags.Broadcast(Tags);
}
void UGasaAbilitySystemComp::InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor)
{
Super::InitAbilityActorInfo(InOwnerActor, InAvatarActor);
}

View File

@ -1,27 +1,15 @@
#pragma once #pragma once
#include "AbilitySystemComponent.h" #include "AbilitySystemComponent.h"
#include "GasaCommon.h" #include "GasaCommon.h"
#include "GasaAbilitySystemComponent.generated.h" #include "GasaAbilitySystemComponent.generated.h"
DECLARE_MULTICAST_DELEGATE_OneParam(FEffectAssetTagsSig, FGameplayTagContainer const& /*Tags*/);
UCLASS(BlueprintType) UCLASS(BlueprintType)
class GASA_API UGasaAbilitySystemComp : public UAbilitySystemComponent class GASA_API UGasaAbilitySystemComp : public UAbilitySystemComponent
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
FEffectAssetTagsSig Event_OnEffectAppliedAssetTags;
void OnAbilityActorInfoSet();
void EffectApplied(UAbilitySystemComponent* AbilitySystem, FGameplayEffectSpec const& Spec, FActiveGameplayEffectHandle ActiveEffect);
#pragma region AbilitySystemComponent
void InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor) override;
#pragma endregion AbilitySystemComponent
}; };

View File

@ -18,7 +18,7 @@ namespace Gasa
// From: UAbilitySystemGlobals::GetAbilitySystemComponentFromActor // From: UAbilitySystemGlobals::GetAbilitySystemComponentFromActor
inline inline
UGasaAbilitySystemComp* GetAbilitySystem(AActor* Actor, bool LookForComponent = true) UGasaAbilitySystemComp* GetAbilitySystem(AActor* Actor, bool LookForComponent = false)
{ {
if (Actor == nullptr) if (Actor == nullptr)
return nullptr; return nullptr;

View File

@ -1,7 +1,6 @@
// Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp // Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp
#include "GasaAttributeSet.h" #include "GasaAttributeSet.h"
#include "GasaAttributeSet_Inlines.h" #include "GasaAttributeSet_Inlines.h"
#include "EffectProperties.h"
#include "AbilitySystemComponent.h" #include "AbilitySystemComponent.h"
#include "Net/UnrealNetwork.h" #include "Net/UnrealNetwork.h"
@ -42,13 +41,6 @@ void UGasaAttributeSet::Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMan
} }
#pragma endregion Rep Notifies #pragma endregion Rep Notifies
void UGasaAttributeSet::PostGameplayEffectExecute( FGameplayEffectModCallbackData const& Data )
{
Super::PostGameplayEffectExecute( Data );
FEffectProperties Props;
Props.Populate( Data );
}
void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute, float& NewValue ) void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute, float& NewValue )
{ {
Super::PreAttributeChange( Attribute, NewValue ); Super::PreAttributeChange( Attribute, NewValue );
@ -70,7 +62,6 @@ void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute,
NewValue = FMath::Clamp( NewValue, 0, 99999.000000 ); NewValue = FMath::Clamp( NewValue, 0, 99999.000000 );
} }
} }
void UGasaAttributeSet::GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const void UGasaAttributeSet::GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const
{ {
Super::GetLifetimeReplicatedProps( OutLifetimeProps ); Super::GetLifetimeReplicatedProps( OutLifetimeProps );

View File

@ -58,8 +58,7 @@ public:
#pragma endregion Getters #pragma endregion Getters
#pragma region Setters #pragma region Setters
FORCEINLINE void FORCEINLINE void SetHealth( float NewVal );
SetHealth( float NewVal );
FORCEINLINE void SetMaxHealth( float NewVal ); FORCEINLINE void SetMaxHealth( float NewVal );
FORCEINLINE void SetMana( float NewVal ); FORCEINLINE void SetMana( float NewVal );
FORCEINLINE void SetMaxMana( float NewVal ); FORCEINLINE void SetMaxMana( float NewVal );
@ -87,13 +86,10 @@ public:
#pragma endregion Setters #pragma endregion Setters
#pragma region AttributeSet #pragma region AttributeSet
void void PreAttributeChange( const FGameplayAttribute& Attribute, float& NewValue ) override;
PreAttributeChange( const FGameplayAttribute& Attribute, float& NewValue ) override; #pragma endregion AttributeSet
void PostGameplayEffectExecute( FGameplayEffectModCallbackData const& Data ) override;
#pragma endregion AttributeSet
#pragma region UObject #pragma region UObject
void void GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const override;
GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const override;
#pragma endregion UObject #pragma endregion UObject
}; };

View File

@ -10,8 +10,6 @@ AGasaEffectActor::AGasaEffectActor()
RootComponent = CreateDefaultSubobject<USceneComponent>("Root"); RootComponent = CreateDefaultSubobject<USceneComponent>("Root");
Level = 1.f;
InstantEffectUsage = EInstantEffectUsagePolicy::DoNotApply; InstantEffectUsage = EInstantEffectUsagePolicy::DoNotApply;
DurationEffectUsage = DefaultEffectUsagePolicy; DurationEffectUsage = DefaultEffectUsagePolicy;
InfiniteEffectUsage = DefaultEffectUsagePolicy; InfiniteEffectUsage = DefaultEffectUsagePolicy;
@ -26,7 +24,7 @@ void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEf
Context = AS->MakeEffectContext(); Context = AS->MakeEffectContext();
Context.AddSourceObject(Actor); Context.AddSourceObject(Actor);
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, Level, Context ); FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context );
FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
if (bRemoveOnEndOverlap) if (bRemoveOnEndOverlap)
ActiveEffectsToRemove.Add(ActiveEffect, AS); ActiveEffectsToRemove.Add(ActiveEffect, AS);
@ -41,16 +39,16 @@ void AGasaEffectActor::OnOverlap(AActor* Actor)
if (InstantEffectClass && InstantEffectUsage == EInstantEffectUsagePolicy::ApplyOnOverlap) if (InstantEffectClass && InstantEffectUsage == EInstantEffectUsagePolicy::ApplyOnOverlap)
{ {
FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, Level, Context ); FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, 1.0f, Context );
AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
} }
if (DurationEffectClass) if (DurationEffectClass)
{ {
if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::ApplyOnOverlap)) if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::ApplyOnOverlap))
{ {
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, Level, Context ); FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, 1.0f, Context );
FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) if (Bitfield_IsSet(DurationEffectUsage, (int32)EEffectUsagePolicy::RemoveOnEndOverlap))
ActiveDuration = ActiveEffect; ActiveDuration = ActiveEffect;
} }
if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnOverlap))
@ -61,9 +59,9 @@ void AGasaEffectActor::OnOverlap(AActor* Actor)
bool bApplyOnOverlap = Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::ApplyOnOverlap); bool bApplyOnOverlap = Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::ApplyOnOverlap);
if (bApplyOnOverlap) if (bApplyOnOverlap)
{ {
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, Level, Context ); FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, 1.0f, Context );
FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) if (Bitfield_IsSet(InfiniteEffectUsage, (int32)EEffectUsagePolicy::RemoveOnEndOverlap))
ActiveInfinite = ActiveEffect; ActiveInfinite = ActiveEffect;
} }
if (ActiveInfinite.IsValid() && Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) if (ActiveInfinite.IsValid() && Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnOverlap))
@ -83,28 +81,28 @@ void AGasaEffectActor::OnEndOverlap(AActor* Actor)
if (InstantEffectClass && InstantEffectUsage == EInstantEffectUsagePolicy::ApplyOnEndOverlap) if (InstantEffectClass && InstantEffectUsage == EInstantEffectUsagePolicy::ApplyOnEndOverlap)
{ {
FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, Level, Context ); FGameplayEffectSpecHandle Spec= AS->MakeOutgoingSpec( InstantEffectClass, 1.0f, Context );
AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
} }
if (DurationEffectClass) if (DurationEffectClass)
{ {
if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::ApplyOnEndOverlap)) if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::ApplyOnEndOverlap))
{ {
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, Level, Context ); FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( DurationEffectClass, 1.0f, Context );
FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
if (Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) if (Bitfield_IsSet(DurationEffectUsage, (int32)EEffectUsagePolicy::RemoveOnOverlap))
ActiveDuration = ActiveEffect; ActiveDuration = ActiveEffect;
} }
if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) if (ActiveDuration.IsValid() && Bitfield_IsSet(DurationEffectUsage, (int32)EEffectUsagePolicy::RemoveOnEndOverlap))
AS->RemoveActiveGameplayEffect(ActiveDuration); AS->RemoveActiveGameplayEffect(ActiveDuration);
} }
if (InfiniteEffectClass) if (InfiniteEffectClass)
{ {
if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::ApplyOnEndOverlap)) if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::ApplyOnEndOverlap))
{ {
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, Level, Context ); FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( InfiniteEffectClass, 1.0f, Context );
FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); FActiveGameplayEffectHandle ActiveEffect = AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
if (Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnOverlap)) if (Bitfield_IsSet(InfiniteEffectUsage, (int32)EEffectUsagePolicy::RemoveOnOverlap))
ActiveInfinite = ActiveEffect; ActiveInfinite = ActiveEffect;
} }
if (ActiveInfinite.IsValid() && Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap)) if (ActiveInfinite.IsValid() && Bitfield_IsSet(InfiniteEffectUsage, EEffectUsagePolicy::RemoveOnEndOverlap))

View File

@ -35,11 +35,6 @@ class GASA_API AGasaEffectActor : public AGasaActor
GENERATED_BODY() GENERATED_BODY()
public: public:
AGasaEffectActor();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
float Level;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
TSubclassOf<UGameplayEffect> InstantEffectClass; TSubclassOf<UGameplayEffect> InstantEffectClass;
@ -67,6 +62,8 @@ public:
FActiveGameplayEffectHandle ActiveDuration; FActiveGameplayEffectHandle ActiveDuration;
FActiveGameplayEffectHandle ActiveInfinite; FActiveGameplayEffectHandle ActiveInfinite;
AGasaEffectActor();
UFUNCTION(BlueprintCallable, Category = "Gameplay Effects") UFUNCTION(BlueprintCallable, Category = "Gameplay Effects")
void ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEffect> EffectClass, bool bRemoveOnEndOverlap = false); void ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEffect> EffectClass, bool bRemoveOnEndOverlap = false);
@ -76,3 +73,4 @@ public:
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
void OnEndOverlap(AActor* Actor); void OnEndOverlap(AActor* Actor);
}; };

View File

@ -156,12 +156,11 @@ void AGasaCharacter::PossessedBy(AController* NewController)
GetMesh()->bOnlyAllowAutonomousTickPose = true; GetMesh()->bOnlyAllowAutonomousTickPose = true;
} }
#if 0
if (bAutoAbilitySystem) if (bAutoAbilitySystem)
{ {
// TODO(Ed): Do we need to do this for enemies?
AbilitySystem->InitAbilityActorInfo(this, this); AbilitySystem->InitAbilityActorInfo(this, this);
} }
#endif
} }
void AGasaCharacter::SetPlayerDefaults() void AGasaCharacter::SetPlayerDefaults()
@ -180,12 +179,10 @@ void AGasaCharacter::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
// TODO(Ed): Find out if this is the best spot todo this
// There is also OnPossessed, PostInitializeComponents, etc...
if (bAutoAbilitySystem) if (bAutoAbilitySystem)
{ {
// TODO(Ed): Do we need to do this for enemies?
AbilitySystem->InitAbilityActorInfo(this, this); AbilitySystem->InitAbilityActorInfo(this, this);
Cast<UGasaAbilitySystemComp>(AbilitySystem)->OnAbilityActorInfoSet();
} }
} }

View File

@ -232,7 +232,8 @@ void AGasaGameMode::HandleSeamlessTravelPlayer(AController*& Controller)
void AGasaGameMode::InitializeHUDForPlayer_Implementation(APlayerController* NewPlayer) void AGasaGameMode::InitializeHUDForPlayer_Implementation(APlayerController* NewPlayer)
{ {
Super::InitializeHUDForPlayer_Implementation(NewPlayer); // Super::InitializeHUDForPlayer_Implementation(NewPlayer);
NewPlayer->ClientSetHUD(HUDClass);
} }
void AGasaGameMode::InitSeamlessTravelPlayer(AController* NewController) void AGasaGameMode::InitSeamlessTravelPlayer(AController* NewController)

View File

@ -0,0 +1,147 @@
#include "GasaGameState.h"
#include "CogAll.h"
#include "CogWindowManager.h"
#include "GasaPlayerState.h"
#include "GasaGameInstance.h"
#include "Net/UnrealNetwork.h"
#include "Networking/GasaNetLibrary_Inlines.h"
using namespace Gasa;
AGasaGameState::AGasaGameState()
{
// Enable ticking
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.SetTickFunctionEnable(true);
PrimaryActorTick.bStartWithTickEnabled = true;
// Replication
bReplicates = true;
bNetLoadOnClient = false;
NetDormancy = DORM_Awake;
NetCullDistanceSquared = NetCullDist_Default;
NetUpdateFrequency = 10.0f;
MinNetUpdateFrequency = 1.0f;
NetPriority = 5.0f;
}
#pragma region GameFramework
void AGasaGameState::OnGameFrameworkInitialized()
{
NetLog("Received gameplay framework initialization.");
if (IsServer())
{
if (PlayerArray.Num() > 0)
{
ListenServerHost = Cast<AGasaPlayerState>(PlayerArray[0]);
}
else
{
NetLog("Was not able to assign HostingPlayer!", ELogV::Error);
}
}
BP_OnGameFrameworkInitialized();
}
#pragma endregion GameFramework
#pragma region Networking
void AGasaGameState::Client_OnRep_OnlinePlayers()
{
}
#pragma endregion Networking
#pragma region Seamless Travel
void AGasaGameState::Multicast_R_NotifySeamlessTravelEnd_Implementation()
{
NetLog("Multicast_R_NotifySeamlessTravelEnd_Implementation");
BP_Event_OnSeamlessTravelEnd.Broadcast();
Event_OnSeamlessTravelEnd.Broadcast();
}
#pragma endregion Seamless Travel
#pragma region GameStateBase
void AGasaGameState::HandleBeginPlay()
{
Super::HandleBeginPlay();
NetLog("HandleBeginPlay: Directly called from GM");
}
void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap)
{
Super::SeamlessTravelTransitionCheckpoint(bToTransitionMap);
NetLog("SeamlessTravelTransitionCheckpoint");
NetLog(FString("ToTransitionMap: ") + FString(bToTransitionMap ? "true" : "false"));
if (bToTransitionMap)
{
Event_OnSeamlessTravelStart.Broadcast();
}
else
{
Multicast_R_NotifySeamlessTravelEnd();
}
}
#pragma endregion GameStateBase
#pragma region Actor
void AGasaGameState::BeginPlay()
{
Super::BeginPlay();
NetLog("BeginPlay");
// Notified as initialized here as any possible components should also be initialized by this point.
UGasaGameInstance*
GI = GetGameInstance<UGasaGameInstance>();
GI->Event_OnGameFrameworkInitialized.AddDynamic(this, & ThisClass::OnGameFrameworkInitialized);
GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState);
#if ENABLE_COG
CogWindowManager = NewObject<UCogWindowManager>(this);
CogWindowManagerRef = CogWindowManager;
// Add all the built-in windows
Cog::AddAllWindows(*CogWindowManager);
#endif //ENABLE_COG
}
void AGasaGameState::PostInitializeComponents()
{
NetLog("PostInitializeComponents");
Super::PostInitializeComponents();
if ( ! GetWorld()->IsEditorWorld() && IsServer())
{
OnlinePlayers.Empty();
#if 0
const auto GI = Cast<UGasaGameInstance>(GetGameInstance());
if (GI != nullptr)
{
int32 NumConnections = GI->SessionSettings.bPublicGame
? GI->SessionSettings.PublicConnections
: GI->SessionSettings.PrivateConnections;
OnlinePlayers.Init(nullptr, NumConnections);
}
#endif
}
}
void AGasaGameState::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
#if ENABLE_COG
if (CogWindowManager)
CogWindowManager->Tick(DeltaSeconds);
#endif //ENABLE_COG
}
#pragma endregion Actor
#pragma region UObject
void AGasaGameState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AGasaGameState, ListenServerHost);
DOREPLIFETIME(AGasaGameState, OnlinePlayers);
}
#pragma endregion UObject

View File

@ -3,7 +3,6 @@
#include "Networking/GasaNetLibrary_Inlines.h" #include "Networking/GasaNetLibrary_Inlines.h"
#include "AbilitySystemComponent.h" #include "AbilitySystemComponent.h"
#include "DrawDebugHelpers.h"
#include "Engine/LocalPlayer.h" #include "Engine/LocalPlayer.h"
#include "EnhancedInputComponent.h" #include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h" #include "EnhancedInputSubsystems.h"
@ -19,7 +18,6 @@
#include "GasaGameInstance.h" #include "GasaGameInstance.h"
#include "GasaGameState.h" #include "GasaGameState.h"
#include "GasaPlayerState.h" #include "GasaPlayerState.h"
#include "AbilitySystem/GasaAbilitySystemComponent.h"
#include "Actors/CameraMount.h" #include "Actors/CameraMount.h"
#include "UI/GasaHUD.h" #include "UI/GasaHUD.h"
#include "UI/WidgetController.h" #include "UI/WidgetController.h"
@ -68,18 +66,14 @@ void AGasaPlayerController::NetOwner_OnReady()
if (IsClient()) if (IsClient())
ServerRPC_R_NotifyOwningClientReady(); ServerRPC_R_NotifyOwningClientReady();
Cam = GetWorld()->SpawnActor<ACameraMount>(GetDevOptions()->Template_PlayerCamera.Get(), FActorSpawnParameters() );
SetViewTarget(Cam);
AGasaPlayerState* PS = GetPlayerState(); AGasaPlayerState* PS = GetPlayerState();
APlayerCharacter* PlayerChar = GetPawn<APlayerCharacter>(); APlayerCharacter* PlayerChar = GetPawn<APlayerCharacter>();
{ {
PlayerChar->AbilitySystem = PS->AbilitySystem; PlayerChar->AbilitySystem = PS->AbilitySystem;
PlayerChar->Attributes = PS->Attributes; PlayerChar->Attributes = PS->Attributes;
PS->AbilitySystem->InitAbilityActorInfo(PS, PlayerChar); PlayerChar->AbilitySystem->InitAbilityActorInfo(PS, this);
Cast<UGasaAbilitySystemComp>(PS->AbilitySystem)->OnAbilityActorInfoSet();
}
Cam->AttachToActor(PlayerChar, FAttachmentTransformRules::KeepRelativeTransform); Cam->AttachToActor(PlayerChar, FAttachmentTransformRules::KeepRelativeTransform);
}
} }
void AGasaPlayerController::OnGameFrameworkInitialized() void AGasaPlayerController::OnGameFrameworkInitialized()
@ -422,11 +416,15 @@ void AGasaPlayerController::BeginPlay()
void AGasaPlayerController::PostInitializeComponents() void AGasaPlayerController::PostInitializeComponents()
{ {
Super::PostInitializeComponents(); Super::PostInitializeComponents();
Cam = GetWorld()->SpawnActor<ACameraMount>(GetDevOptions()->Template_PlayerCamera.Get(), FActorSpawnParameters() );
SetViewTarget(Cam);
} }
void AGasaPlayerController::Tick(float DeltaSeconds) void AGasaPlayerController::Tick(float DeltaSeconds)
{ {
Super::Tick(DeltaSeconds); Super::Tick(DeltaSeconds);
#if 0 #if 0
switch (HighlightState) switch (HighlightState)
{ {

View File

@ -84,15 +84,6 @@ public class Gasa : ModuleRules
PrivateIncludePathModuleNames.AddRange( new string[] PrivateIncludePathModuleNames.AddRange( new string[]
{ {
"CogCommon", "CogCommon",
"CogAbility",
"CogAI",
"CogAll",
"CogDebug",
"CogDebugEditor",
"CogEngine",
"CogImgui",
"CogInput",
"CogWindow",
}); });
PrivateDependencyModuleNames.AddRange(new string[] PrivateDependencyModuleNames.AddRange(new string[]
{ {

View File

@ -21,9 +21,6 @@
#pragma region Engine Forwards #pragma region Engine Forwards
struct FInputActionValue; struct FInputActionValue;
struct FGameplayEffectContextHandle;
struct FGameplayEffectModCallbackData;
struct FGameplayTagContainer;
struct FOnAttributeChangeData; struct FOnAttributeChangeData;
struct FReplicationFlags; struct FReplicationFlags;
@ -45,7 +42,6 @@ class UInputAction;
class UInputMappingContext; class UInputMappingContext;
class USphereComponent; class USphereComponent;
class USpringArmComponent; class USpringArmComponent;
class UTexture2D;
#pragma endregion Engine Forwards #pragma endregion Engine Forwards
#pragma region Engine Plugin Forwards #pragma region Engine Plugin Forwards
@ -74,7 +70,6 @@ class UGasaObject;
class UGasaOverlay; class UGasaOverlay;
class UGasaProgressBar; class UGasaProgressBar;
class UGasaSizeBox; class UGasaSizeBox;
class UGasaUserWidget;
class UHostWidgetController; class UHostWidgetController;
class UHUDHostWidget; class UHUDHostWidget;
class UWidgetController; class UWidgetController;
@ -163,8 +158,7 @@ namespace Gasa
// Works for Unreal 5.4, Win64 MSVC (untested in other scenarios, for now) // Works for Unreal 5.4, Win64 MSVC (untested in other scenarios, for now)
inline inline
void Log( FString Message void Log( FString Message, EGasaVerbosity Verbosity = EGasaVerbosity::Log
, EGasaVerbosity Verbosity = EGasaVerbosity::Log
, FLogCategoryBase& Category = LogGasa , FLogCategoryBase& Category = LogGasa
, bool DumpStack = false , bool DumpStack = false
, int32 Line = __builtin_LINE() , int32 Line = __builtin_LINE()

View File

@ -2,14 +2,6 @@
#include "GasaCommon.h" #include "GasaCommon.h"
template<typename RowType>
inline
RowType* GetDataTableRowByTag(UDataTable* DT, FGameplayTag& Tag)
{
RowType* Row = DT->FindRow<RowType>(Tag.GetTagName(), TEXT(""));
return Row;
}
template<typename KeyType, typename ValueType> template<typename KeyType, typename ValueType>
inline inline
void RemoveKeys(TMap<KeyType, ValueType> Map, TArray<KeyType> Keys) void RemoveKeys(TMap<KeyType, ValueType> Map, TArray<KeyType> Keys)

View File

@ -1,11 +1,10 @@
#pragma once #pragma once
#include "Engine/DataTable.h"
#include "Engine/DeveloperSettings.h" #include "Engine/DeveloperSettings.h"
#include "GasaCommon.h" #include "GasaCommon.h"
#include "GasaDevOptions.generated.h"
#include "GasaDevOptions.generated.h"
UCLASS(Config=Game, DefaultConfig, meta=(DisplayName="Gasa")) UCLASS(Config=Game, DefaultConfig, meta=(DisplayName="Gasa"))
class GASA_API UGasaDevOptions : public UDeveloperSettings class GASA_API UGasaDevOptions : public UDeveloperSettings
@ -16,9 +15,6 @@ public:
// NOTE(Ed): Any Soft-References must have their includes defined in GasaDevOptions.cpp // NOTE(Ed): Any Soft-References must have their includes defined in GasaDevOptions.cpp
// They are used by GasaGen for the GasaDevOptionsCache // They are used by GasaGen for the GasaDevOptionsCache
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="UI")
TSoftObjectPtr<UDataTable> TaggedMessageTable;
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="UI") UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="UI")
TSoftClassPtr<ACameraMount> Template_PlayerCamera; TSoftClassPtr<ACameraMount> Template_PlayerCamera;

View File

@ -11,9 +11,6 @@ void FGasaDevOptionsCache::CachedDevOptions()
{ {
UGasaDevOptions* DevOpts = GetMutDevOptions(); UGasaDevOptions* DevOpts = GetMutDevOptions();
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++" ) );
Template_PlayerCamera = DevOpts->Template_PlayerCamera.LoadSynchronous(); Template_PlayerCamera = DevOpts->Template_PlayerCamera.LoadSynchronous();
ensureMsgf( ensureMsgf(
Template_PlayerCamera != nullptr, TEXT( "Template_PlayerCamera is null, DO NOT RUN PIE or else you may get a crash if not handled in BP or C++" ) Template_PlayerCamera != nullptr, TEXT( "Template_PlayerCamera is null, DO NOT RUN PIE or else you may get a crash if not handled in BP or C++" )

View File

@ -8,8 +8,6 @@ struct GASA_API FGasaDevOptionsCache
{ {
GENERATED_BODY() GENERATED_BODY()
UPROPERTY()
UObject* TaggedMessageTable;
UPROPERTY() UPROPERTY()
UClass* Template_PlayerCamera; UClass* Template_PlayerCamera;
UPROPERTY() UPROPERTY()

View File

@ -14,15 +14,12 @@ void AGasaHUD::InitHostWidget(FWidgetControllerData const* WidgetControllerData)
HostWidgetController = NewObject<UHostWidgetController>(this, GetDevOptions()->Template_HostWidgetController.Get()); HostWidgetController = NewObject<UHostWidgetController>(this, GetDevOptions()->Template_HostWidgetController.Get());
HostWidgetController->Data = (* WidgetControllerData); HostWidgetController->Data = (* WidgetControllerData);
HostWidget->SetWidgetController(HostWidgetController); HostWidget->SetWidgetController(HostWidgetController);
HostWidgetController->BindCallbacksToDependencies();
HostWidgetController->BroadcastInitialValues(); HostWidgetController->BroadcastInitialValues();
HostWidget->AddToViewport(); HostWidget->AddToViewport();
} }
void AGasaHUD::DrawHUD()
{
Super::DrawHUD();
}
#pragma region HUD #pragma region HUD
void AGasaHUD::ShowHUD() void AGasaHUD::ShowHUD()
{ {
@ -35,9 +32,4 @@ void AGasaHUD::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
} }
void AGasaHUD::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
}
#pragma endregion Actor #pragma endregion Actor

View File

@ -22,13 +22,10 @@ public:
void InitHostWidget(FWidgetControllerData const* WidgetControllerData); void InitHostWidget(FWidgetControllerData const* WidgetControllerData);
#pragma region HUD #pragma region HUD
void DrawHUD() override;
void ShowHUD() override; void ShowHUD() override;
#pragma endregion HUD #pragma endregion HUD
#pragma region Actor #pragma region Actor
void BeginPlay() override; void BeginPlay() override;
void Tick(float DeltaSeconds) override;
#pragma endregion Actor #pragma endregion Actor
}; };

View File

@ -1,4 +1,4 @@
#include "GasaUserWidget.h" #include "GasaUserWidget.h"
#include "Blueprint/WidgetBlueprintGeneratedClass.h" #include "Blueprint/WidgetBlueprintGeneratedClass.h"
#include "Blueprint/WidgetTree.h" #include "Blueprint/WidgetTree.h"
@ -227,7 +227,7 @@ bool UGasaUserWidget::Initialize()
// For backward compatibility, run the initialize event on widget that doesn't have a player context only when the class authorized it. // For backward compatibility, run the initialize event on widget that doesn't have a player context only when the class authorized it.
bool bClassWantsToRunInitialized = BGClass && BGClass->bCanCallInitializedWithoutPlayerContext; bool bClassWantsToRunInitialized = BGClass && BGClass->bCanCallInitializedWithoutPlayerContext;
if (!IsDesignTime() && (GetPlayerContext().IsValid() || bClassWantsToRunInitialized)) if (!IsDesignTime() && (PlayerContext.IsValid() || bClassWantsToRunInitialized))
{ {
NativeOnInitialized(); NativeOnInitialized();
} }

View File

@ -1,4 +1,4 @@
#include "GlobeProgressBar.h" #include "GlobeProgressBar.h"
#include "GasaImage.h" #include "GasaImage.h"
#include "GasaOverlay.h" #include "GasaOverlay.h"

View File

@ -2,9 +2,6 @@
#include "AbilitySystem/GasaAbilitySystemComponent_Inlines.h" #include "AbilitySystem/GasaAbilitySystemComponent_Inlines.h"
#include "AbilitySystem/GasaAttributeSet.h" #include "AbilitySystem/GasaAttributeSet.h"
#include "GameplayEffectTypes.h" #include "GameplayEffectTypes.h"
#include "GasaDevOptions.h"
#include "TaggedMessageRow.h"
using namespace Gasa;
@ -33,20 +30,6 @@ void UHostWidgetController::MaxManaChanged( FOnAttributeChangeData const& Attrib
} }
#pragma endregion Attribute Changed Callbacks #pragma endregion Attribute Changed Callbacks
void UHostWidgetController::OnEffectAppliedAssetTags( FGameplayTagContainer const& AssetTags )
{
UDataTable* TaggedMessages = GetDevOptions()->TaggedMessageTable.Get();
for ( FGameplayTag const& Tag : AssetTags )
{
FGameplayTag MessageTagCategory = FGameplayTag::RequestGameplayTag( FName( "Message" ) );
if ( ! Tag.MatchesTag( MessageTagCategory ) )
continue;
FTaggedMessageRow* Row = TaggedMessages->FindRow<FTaggedMessageRow>( Tag.GetTagName(), TEXT( "" ) );
OnTaggedAssetMessage.Broadcast( *Row );
}
}
void UHostWidgetController::BroadcastInitialValues() void UHostWidgetController::BroadcastInitialValues()
{ {
// This function is managed by: GenGasa/GenGasa_HostWidgetController.cpp // This function is managed by: GenGasa/GenGasa_HostWidgetController.cpp
@ -83,6 +66,4 @@ void UHostWidgetController::BindCallbacksToDependencies()
FOnGameplayAttributeValueChange& MaxManaAttributeChangedDelegate = FOnGameplayAttributeValueChange& MaxManaAttributeChangedDelegate =
AbilitySystem->GetGameplayAttributeValueChangeDelegate( GasaAttribs->GetMaxManaAttribute() ); AbilitySystem->GetGameplayAttributeValueChangeDelegate( GasaAttribs->GetMaxManaAttribute() );
MaxManaAttributeChangedDelegate.AddUObject( this, &ThisClass::MaxManaChanged ); MaxManaAttributeChangedDelegate.AddUObject( this, &ThisClass::MaxManaChanged );
AbilitySystem->Event_OnEffectAppliedAssetTags.AddUObject( this, &UHostWidgetController::OnEffectAppliedAssetTags );
} }

View File

@ -1,11 +1,8 @@
#pragma once #pragma once
#include "GasaCommon.h"
#include "TaggedMessageRow.h"
#include "WidgetController.h" #include "WidgetController.h"
#include "HostWidgetController.generated.h" #include "HostWidgetController.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FAttributeFloatChangedSig, float, NewValue );
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FAttributeChangedSig, float, NewValue );
UCLASS( Blueprintable, BlueprintType ) UCLASS( Blueprintable, BlueprintType )
class GASA_API UHostWidgetController : public UWidgetController class GASA_API UHostWidgetController : public UWidgetController
@ -16,16 +13,16 @@ public:
// Attribute Events are generated by GasaGen/GasaGen_HostWidgetController.cpp // Attribute Events are generated by GasaGen/GasaGen_HostWidgetController.cpp
UPROPERTY( BlueprintAssignable, Category = "Attributes" ) UPROPERTY( BlueprintAssignable, Category = "Attributes" )
FAttributeChangedSig Event_OnHealthChanged; FAttributeFloatChangedSig Event_OnHealthChanged;
UPROPERTY( BlueprintAssignable, Category = "Attributes" ) UPROPERTY( BlueprintAssignable, Category = "Attributes" )
FAttributeChangedSig Event_OnMaxHealthChanged; FAttributeFloatChangedSig Event_OnMaxHealthChanged;
UPROPERTY( BlueprintAssignable, Category = "Attributes" ) UPROPERTY( BlueprintAssignable, Category = "Attributes" )
FAttributeChangedSig Event_OnManaChanged; FAttributeFloatChangedSig Event_OnManaChanged;
UPROPERTY( BlueprintAssignable, Category = "Attributes" ) UPROPERTY( BlueprintAssignable, Category = "Attributes" )
FAttributeChangedSig Event_OnMaxManaChanged; FAttributeFloatChangedSig Event_OnMaxManaChanged;
void HealthChanged( FOnAttributeChangeData const& Data ); void HealthChanged( FOnAttributeChangeData const& Data );
void MaxHealthChanged( FOnAttributeChangeData const& Data ); void MaxHealthChanged( FOnAttributeChangeData const& Data );
@ -33,11 +30,6 @@ public:
void MaxManaChanged( FOnAttributeChangeData const& Data ); void MaxManaChanged( FOnAttributeChangeData const& Data );
#pragma endregion Attribute Events #pragma endregion Attribute Events
UPROPERTY( BlueprintAssignable, Category = "Messages" )
FTaggedMessageRowSig OnTaggedAssetMessage;
void OnEffectAppliedAssetTags( FGameplayTagContainer const& AssetTags );
#pragma region WidgetController #pragma region WidgetController
void BroadcastInitialValues() override; void BroadcastInitialValues() override;
void BindCallbacksToDependencies() override; void BindCallbacksToDependencies() override;

View File

@ -1,28 +0,0 @@
#pragma once
#include "GameplayTagContainer.h"
#include "GasaCommon.h"
#include "Engine/DataTable.h"
#include "Templates/SubclassOf.h"
#include "TaggedMessageRow.generated.h"
USTRUCT(BlueprintType)
struct FTaggedMessageRow : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FGameplayTag Tag;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FText Message;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
TSubclassOf<UGasaUserWidget> MessageTemplate;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UTexture2D* Image;
};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FTaggedMessageRowSig, FTaggedMessageRow, Message);

View File

@ -72,7 +72,7 @@ void gen_UHostWidgetController()
)); ));
attribute_events.append(fmt_newline); attribute_events.append(fmt_newline);
attribute_events.append( parse_variable( attribute_events.append( parse_variable(
token_fmt( "field", (StrC) attribute_field.Name, stringize( FAttributeChangedSig Event_On<field>Changed; )) token_fmt( "field", (StrC) attribute_field.Name, stringize( FAttributeFloatChangedSig Event_On<field>Changed; ))
)); ));
attribute_events.append(fmt_newline); attribute_events.append(fmt_newline);
} }
@ -209,8 +209,6 @@ void gen_UHostWidgetController()
UGasaAttributeSet* GasaAttribs = Cast<UGasaAttributeSet>( Data.Attributes ); UGasaAttributeSet* GasaAttribs = Cast<UGasaAttributeSet>( Data.Attributes );
<bindings> <bindings>
AbilitySystem->Event_OnEffectAppliedAssetTags.AddUObject(this, & UHostWidgetController::OnEffectAppliedAssetTags);
}) })
)); ));
} }

View File

@ -104,7 +104,7 @@ void gen_UGasaAttributeSet()
body.append( def_pragma( txt("region AttributeSet"))); body.append( def_pragma( txt("region AttributeSet")));
body.append( code_str( body.append( code_str(
void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override; void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override;
void PostGameplayEffectExecute(FGameplayEffectModCallbackData const& Data) override; // void PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) override;
)); ));
body.append( def_pragma( txt("endregion AttributeSet"))); body.append( def_pragma( txt("endregion AttributeSet")));
body.append(fmt_newline); body.append(fmt_newline);
@ -170,7 +170,6 @@ void gen_UGasaAttributeSet()
header.print(fmt_newline); header.print(fmt_newline);
source.print( def_include( txt("GasaAttributeSet.h"))); source.print( def_include( txt("GasaAttributeSet.h")));
source.print( def_include( txt("GasaAttributeSet_Inlines.h"))); source.print( def_include( txt("GasaAttributeSet_Inlines.h")));
source.print( def_include( txt("EffectProperties.h")));
source.print(fmt_newline); source.print(fmt_newline);
source.print( def_include( txt("AbilitySystemComponent.h"))); source.print( def_include( txt("AbilitySystemComponent.h")));
source.print( def_include( txt("Net/UnrealNetwork.h"))); source.print( def_include( txt("Net/UnrealNetwork.h")));
@ -192,17 +191,6 @@ void gen_UGasaAttributeSet()
impl_attribute_fields( body, class_name, attribute_fields); impl_attribute_fields( body, class_name, attribute_fields);
Code PostGameplayEffectExecute = parse_function( code(
void UGasaAttributeSet::PostGameplayEffectExecute(FGameplayEffectModCallbackData const& Data)
{
Super::PostGameplayEffectExecute(Data);
FEffectProperties Props;
Props.Populate(Data);
}
));
body.append(PostGameplayEffectExecute);
body.append(fmt_newline);
CodeFn PreAttributeChange; CodeFn PreAttributeChange;
{ {
CodeBody attribute_clamps = def_body( CodeT::Function_Body ); CodeBody attribute_clamps = def_body( CodeT::Function_Body );
@ -233,8 +221,6 @@ void gen_UGasaAttributeSet()
} }
))); )));
} }
attribute_clamps.append(fmt_newline);
attribute_clamps.append(fmt_newline);
PreAttributeChange = parse_function( token_fmt( "attribute_clamps", (StrC)attribute_clamps.to_string(), stringize( PreAttributeChange = parse_function( token_fmt( "attribute_clamps", (StrC)attribute_clamps.to_string(), stringize(
void UGasaAttributeSet::PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) void UGasaAttributeSet::PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue)
{ {
@ -244,7 +230,6 @@ void gen_UGasaAttributeSet()
))); )));
} }
body.append(PreAttributeChange); body.append(PreAttributeChange);
body.append(fmt_newline);
CodeFn GetLifetimeOfReplicatedProps; CodeFn GetLifetimeOfReplicatedProps;
{ {

View File

@ -1,83 +0,0 @@
# PowerShell script to set up Git LFS for Content directory
clear-host
$path_scripts = $PSScriptRoot
$path_helpers = join-path $path_scripts 'helpers'
$path_root = split-path -Parent -Path $path_scripts
$path_ue = join-path '../../Surgo' 'UE'
$path_project = join-path $path_root 'Project'
# Set your repository paths here
$path_content = join-path $path_project 'Content'
# Function to remove Content directory from Git history
function Remove-ContentFromGitHistory {
push-location $path_repo
$cgit_filter_branch = 'filter-branch'
$cgit_for_each_ref = 'for-each-ref'
$cgit_update_ref = 'update-ref'
$cgit_reflog_expire = 'reflog expire'
$cgit_garbage_collect = 'gc'
$fgit_agressive = '--aggressive'
$fgit_all = '--all'
$fgit_cached = '--cached'
$fgit_format = '--format'
$fgit_expire_now = '--expire=now'
$fgit_ignore_unmatch = '--ignore-unmatch'
$fgit_index_filter = '--index-filter'
$fgit_force = '--force'
$fgit_prune_empty = '--prune-empty'
$fgit_prune_now = '--prune=now'
$fgit_tag_name_filter = '--tag-name-filter'
$fgit_stdin = '--stdin'
$fgit_filter_concat = 'cat'
$fgit_filter_separate = '--'
$fmt_delete_refs = 'delete $(refname)'
$original_refs = 'refs/original'
$filter_cmd = 'git rm -r --cached'
# Construct filter-branch command
$filter_branch_args = @()
$filter_branch_args += $fgit_force
$filter_branch_args += $fgit_index_filter
$filter_branch_args += "git rm -r $fgit_cached $fgit_ignore_unmatch $path_content"
$filter_branch_args += $fgit_prune_empty
$filter_branch_args += $fgit_tag_name_filter
$filter_branch_args += $fgit_filter_concat
$filter_branch_args += $fgit_filter_separate
$filter_branch_args += $fgit_all
# Execute filter-branch command
& git $cgit_filter_branch $filter_branch_args
# Construct for-each-ref command
$for_each_ref_args = @()
$for_each_ref_args += "$fgit_format='$fmt_delete_refs'"
$for_each_ref_args += $original_refs
# Execute for-each-ref and pipe to update-ref
$refs_to_delete = & git $cgit_for_each_ref $for_each_ref_args
$refs_to_delete | & git $cgit_update_ref $fgit_stdin
# Construct and execute reflog expire command
$reflog_expire_args = @()
$reflog_expire_args += $fgit_expire_now
$reflog_expire_args += $fgit_all
& git $cgit_reflog_expire $reflog_expire_args
# Construct and execute garbage collect command
$gc_args = @()
$gc_args += $fgit_prune_now
$gc_args += $fgit_aggressive
& git $cgit_garbage_collect $gc_args
pop-location
}
Remove-ContentFromGitHistory

View File

@ -54,7 +54,7 @@ elseif ( $release -eq $false ) {
else { else {
$optimize = $true $optimize = $true
} }
#endregion Configuration
. $vendor_toolchain . $vendor_toolchain
. $incremental_checks . $incremental_checks
@ -103,4 +103,3 @@ function run-gengasa
Pop-Location Pop-Location
} }
run-gengasa run-gengasa
#endregion Building

View File

@ -1,4 +0,0 @@
clear-host