Skip to content

Commit

Permalink
feat : 위젯에 실제 데이터 바인딩 구현1
Browse files Browse the repository at this point in the history
cpp에서 태그추가, 조회
  • Loading branch information
Bisu96 committed Jun 7, 2024
1 parent 320f2c5 commit 2bc8056
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 1 deletion.
1 change: 1 addition & 0 deletions Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'
[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/Aura")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/Aura")
AssetManagerClassName=/Script/Aura.AuraAssetManager

[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
bEnablePlugin=True
Expand Down
1 change: 0 additions & 1 deletion Config/DefaultGameplayTags.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ AllowEditorTagUnloading=True
AllowGameTagUnloading=False
FastReplication=False
InvalidTagCharacters="\"\',"
+GameplayTagTableList=/Game/Blueprints/AbilitySystem/GameplayTags/DT_PrimaryAttributes.DT_PrimaryAttributes
NumBitsForContainerSize=6
NetIndexFirstBitSegment=16
+GameplayTagList=(Tag="Attributes.Vital.Health",DevComment="Amount of dmg a player can take before death")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@

#include "AbilitySystem/AuraAbilitySystemComponent.h"

#include "AuraGameplayTags.h"

void UAuraAbilitySystemComponent::AbilityActorInfoSet()
{
OnGameplayEffectAppliedDelegateToSelf.AddUObject(this,&UAuraAbilitySystemComponent::EffectApplied);

const FAuraGameplayTags& GameplayTags= FAuraGameplayTags::Get();
//GameplayTags.Attributes_Secondary_Armor.ToString();
GEngine->AddOnScreenDebugMessage(
-1,10.f,FColor::Orange,FString::Printf(TEXT("Tag : %s"),*GameplayTags.Attributes_Secondary_Armor.ToString()));
}

void UAuraAbilitySystemComponent::EffectApplied(UAbilitySystemComponent* AbilitySystemComponent,
Expand Down
21 changes: 21 additions & 0 deletions Source/Aura/Private/AuraAssetManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "AuraAssetManager.h"
#include "AuraGameplayTags.h"

UAuraAssetManager& UAuraAssetManager::Get()
{
check(GEngine);
UAuraAssetManager* AuraAssetManager = Cast<UAuraAssetManager>(GEngine->AssetManager);
return *AuraAssetManager;
}

void UAuraAssetManager::StartInitialLoading() //게임 에셋들 초기세팅하는 함수
{
Super::StartInitialLoading();
//Tag들 추가 하기 최적의 장소!
FAuraGameplayTags::InitializeNativeGameplayTags();

//할일 : AuraAssetManager를 AssetManager로 설정
}
13 changes: 13 additions & 0 deletions Source/Aura/Private/AuraGameplayTags.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "AuraGameplayTags.h"
#include "GameplayTagsManager.h"

FAuraGameplayTags FAuraGameplayTags::GameplayTags; //전역변수

void FAuraGameplayTags::InitializeNativeGameplayTags()
{
//단순히 태그를 추가
GameplayTags.Attributes_Secondary_Armor = UGameplayTagsManager::Get().AddNativeGameplayTag(FName("Attributes.Secondary.Armor"),FString("Reduces damage taken, improves Block Chance"));
}
22 changes: 22 additions & 0 deletions Source/Aura/Public/AuraAssetManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Engine/AssetManager.h"
#include "AuraAssetManager.generated.h"

/**
*
*/
UCLASS()
class AURA_API UAuraAssetManager : public UAssetManager
{
GENERATED_BODY()

public:
static UAuraAssetManager& Get();

protected:
virtual void StartInitialLoading() override;
};
26 changes: 26 additions & 0 deletions Source/Aura/Public/AuraGameplayTags.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameplayTagContainer.h"

/**
* AuraGameplayTags
*
* 싱글톤, 포함하는 native GETags
*/

struct FAuraGameplayTags
{
public:
static const FAuraGameplayTags& Get(){ return GameplayTags; }
static void InitializeNativeGameplayTags(); //@Setter

FGameplayTag Attributes_Secondary_Armor;

protected:

private:
static FAuraGameplayTags GameplayTags;
};

0 comments on commit 2bc8056

Please sign in to comment.