update non-module GasaGen

This commit is contained in:
2024-12-15 14:13:44 -05:00
parent 2cf78790db
commit 0ad0b337b3
14 changed files with 362 additions and 141 deletions

View File

@ -70,7 +70,7 @@ void AGasaCharacter::ApplyEffectToSelf(TSubclassOf<UGameplayEffect> GE, float Le
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
ensure(ASC);
ensure(GE);
FGameplayEffectContextHandle Context = ASC->MakeEffectContext();
FGameplayEffectContextHandle Context = ASC->MakeEffectContext(); Context.AddSourceObject(this);
FGameplayEffectSpecHandle Spec = ASC->MakeOutgoingSpec(GE, Level, Context );
ASC->ApplyGameplayEffectSpecToTarget( * Spec.Data, ASC );
}

View File

@ -4,9 +4,11 @@
#include "GasaCommon.generated.h"
#ifndef global
#define global
#define internal static
#define local_persist static
#endif
#ifndef ccast
#define ccast( Type, Value ) ( *const_cast<(Type)*>( &( Value ) ) )
@ -15,7 +17,9 @@
#define scast( Type, Value ) static_cast<Type>( Value )
#endif
#ifndef bit
#define bit(position) (1 << position)
#endif
#pragma region Math
#define m_pow2( value ) (value * value)
@ -45,8 +49,10 @@ class UCameraComponent;
class UGameplayEffect;
class UInputAction;
class UInputMappingContext;
class UNamedSlot;
class USphereComponent;
class USpringArmComponent;
class UTextBlock;
class UTexture2D;
#pragma endregion Engine Forwards
@ -68,6 +74,9 @@ class AGasaPlayerController;
class AGasaPlayerState;
class APlayerCharacter;
class UAttributeMenu;
class UAttributeMenu_FramedValue;
class UAttributeMenu_TextValueRow;
class UGasaAbilitySystemComp;
class UGasaAttributeSet;
class UGasaDevOptions;

View File

@ -0,0 +1,3 @@
#include "AttributeMenu.h"

View File

@ -0,0 +1,14 @@
#pragma once
#include "UI/GasaUserWidget.h"
#include "AttributeMenu.generated.h"
UCLASS(Blueprintable)
class GASA_API UAttributeMenu : public UGasaUserWidget
{
GENERATED_BODY()
public:
};

View File

@ -0,0 +1,26 @@
#include "FramedValue.h"
#include "UI/GasaImage.h"
#include "Components/TextBlock.h"
#include "UI/GasaSizeBox.h"
void UAttributeMenu_FramedValue::SetBackgroundBrush(FSlateBrush Brush)
{
BG->SetBrush(Brush);
}
void UAttributeMenu_FramedValue::SetBorderBrush(FSlateBrush Brush)
{
Border->SetBrush(Brush);
}
void UAttributeMenu_FramedValue::SetBoxSize(float Width, float Height)
{
SB_Root->SetWidthOverride(Width);
SB_Root->SetHeightOverride(Height);
}
void UAttributeMenu_FramedValue::SetText(FText Content)
{
Value->SetText(Content);
}

View File

@ -0,0 +1,42 @@
#pragma once
#include "UI/GasaUserWidget.h"
#include "FramedValue.generated.h"
UCLASS(Blueprintable)
class GASA_API UAttributeMenu_FramedValue : public UGasaUserWidget
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UGasaSizeBox* SB_Root;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UGasaImage* BG;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UGasaImage* Border;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UTextBlock* Value;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame")
float BoxHeight;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame")
float BoxWidth;
UFUNCTION(BlueprintCallable)
void SetBackgroundBrush(FSlateBrush Brush);
UFUNCTION(BlueprintCallable)
void SetBorderBrush(FSlateBrush Brush);
UFUNCTION(BlueprintCallable)
void SetBoxSize(float Width, float Height);
UFUNCTION(BlueprintCallable)
void SetText(FText Content);
};

View File

@ -0,0 +1,21 @@
#include "TextValueRow.h"
#include "Components/TextBlock.h"
#include "UI/GasaSizeBox.h"
void UAttributeMenu_TextValueRow::SetAttributeName(FText Name)
{
TB_AttributeName->SetText(Name);
}
void UAttributeMenu_TextValueRow::SetBoxSize(float Width, float Height)
{
SB_Root->SetWidthOverride(Width);
SB_Root->SetHeightOverride(Height);
}
void UAttributeMenu_TextValueRow::NativePreConstruct()
{
Super::NativePreConstruct();
}

View File

@ -0,0 +1,43 @@
#pragma once
#include "UI/GasaUserWidget.h"
#include "TextValueRow.generated.h"
UCLASS(Blueprintable)
class GASA_API UAttributeMenu_TextValueRow : public UGasaUserWidget
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UGasaSizeBox* SB_Root;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UTextBlock* TB_AttributeName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UAttributeMenu_FramedValue* Value;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame", meta=(BindWidget))
UNamedSlot* NSlot;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame")
FText AttributeName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame")
float BoxHeight;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Frame")
float BoxWidth;
UFUNCTION(BlueprintCallable)
void SetAttributeName(FText Name);
UFUNCTION(BlueprintCallable)
void SetBoxSize(float Width, float Height);
#pragma region UserWidget
void NativePreConstruct() override;
#pragma endregion UserWidget
};

View File

@ -196,4 +196,3 @@ void UGlobeProgressBar::Serialize(FStructuredArchive::FRecord Record)
Super::Serialize(Record);
}
#pragma endregion UserWidget