32. Overlay Widget Controller

This commit is contained in:
2024-04-21 18:56:57 -04:00
parent adfb17b7df
commit 811dc33f4a
40 changed files with 326 additions and 157 deletions

View File

@ -1,7 +1,6 @@
#pragma once
#include "AbilitySystemComponent.h"
#include "AbilitySystemInterface.h"
#include "GasaCommon.h"
@ -14,16 +13,3 @@ class GASA_API UGasaAbilitySystemComp : public UAbilitySystemComponent
GENERATED_BODY()
public:
};
namespace Gasa
{
inline
UGasaAbilitySystemComp* GetAbilitySystem(UObject* Object)
{
if (Object->Implements<UAbilitySystemInterface>())
{
return Cast<UGasaAbilitySystemComp>( Cast<IAbilitySystemInterface>(Object)->GetAbilitySystemComponent() );
}
return nullptr;
}
}

View File

@ -0,0 +1,16 @@
#pragma once
#include "GasaAbilitySystemComponent.h"
#include "AbilitySystemInterface.h"
namespace Gasa
{
inline
UGasaAbilitySystemComp* GetAbilitySystem(UObject* Object)
{
if (Object->Implements<UAbilitySystemInterface>())
{
return Cast<UGasaAbilitySystemComp>( Cast<IAbilitySystemInterface>(Object)->GetAbilitySystemComponent() );
}
return nullptr;
}
}

View File

@ -1,5 +1,6 @@
// This was generated by GasaGen/GasaGen.cpp
// Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp
#include "GasaAttributeSet.h"
#include "GasaAttributeSet_Inlines.h"
#include "AbilitySystemComponent.h"
#include "Net/UnrealNetwork.h"

View File

@ -1,7 +1,7 @@
// This was generated by GasaGen/GasaGen.cpp
// Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp
#pragma once
#include "AttributeSet.h"
#include "AbilitySystemComponent.h"
#include "GasaAttributeSet.generated.h"
UCLASS()
@ -53,6 +53,7 @@ public:
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxMana ) );
return Prop;
}
FORCEINLINE float GetHealth() const { return Health.GetCurrentValue(); }
FORCEINLINE float GetMaxHealth() const { return MaxHealth.GetCurrentValue(); }
FORCEINLINE float GetMana() const { return Mana.GetCurrentValue(); }
@ -61,38 +62,11 @@ public:
#pragma region Setters
FORCEINLINE void
SetHealth( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetHealthAttribute(), NewVal );
};
}
FORCEINLINE void SetMaxHealth( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetMaxHealthAttribute(), NewVal );
};
}
FORCEINLINE void SetMana( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetManaAttribute(), NewVal );
};
}
FORCEINLINE void SetMaxMana( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetMaxManaAttribute(), NewVal );
};
}
SetHealth( float NewVal );
FORCEINLINE void SetMaxHealth( float NewVal );
FORCEINLINE void SetMana( float NewVal );
FORCEINLINE void SetMaxMana( float NewVal );
FORCEINLINE void InitHealth( float NewVal )
{
Health.SetBaseValue( NewVal );
@ -121,11 +95,3 @@ public:
GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const override;
#pragma endregion UObject
};
namespace Gasa
{
inline UGasaAttributeSet const* GetAttributeSet( UAbilitySystemComponent* ASC )
{
return Cast<UGasaAttributeSet>( ASC->GetAttributeSet( UGasaAttributeSet::StaticClass() ) );
}
}

View File

@ -0,0 +1,51 @@
// Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp
#pragma once
#include "GasaAttributeSet.h"
#include "AbilitySystemComponent.h"
FORCEINLINE
void UGasaAttributeSet::SetHealth( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetHealthAttribute(), NewVal );
};
}
FORCEINLINE
void UGasaAttributeSet::SetMaxHealth( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetMaxHealthAttribute(), NewVal );
};
}
FORCEINLINE
void UGasaAttributeSet::SetMana( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetManaAttribute(), NewVal );
};
}
FORCEINLINE
void UGasaAttributeSet::SetMaxMana( float NewVal )
{
UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
if ( ensure( AbilityComp ) )
{
AbilityComp->SetNumericAttributeBase( GetMaxManaAttribute(), NewVal );
};
}
namespace Gasa
{
inline UGasaAttributeSet const* GetAttributeSet( UAbilitySystemComponent* ASC )
{
return Cast<UGasaAttributeSet>( ASC->GetAttributeSet( UGasaAttributeSet::StaticClass() ) );
}
}

View File

@ -1,8 +1,8 @@
#include "GasaEffectActor.h"
#include "AbilitySystemComponent.h"
#include "AbilitySystemInterface.h"
#include "GasaAttributeSet.h"
#include "GasaAttributeSet_Inlines.h"
#include "Components/SphereComponent.h"