Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
ConstellationBuffSlotWidget.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UI/UserWidgetBase.h"
7#include "ConstellationBuffSlotWidget.generated.h"
8
9class UImage;
10class UMaterialInstanceDynamic;
11class USituationBase;
12class UTexture2D;
13
20UCLASS()
22{
23 GENERATED_BODY()
24
25public:
26 void SetupSlot(USituationBase* InSituation, UTexture2D* InIcon);
27
28 // 남은 시간 갱신. NormalizedRemaining 은 1(막 걸림) -> 0(만료) 로 줄어든다.
29 // 영구 GE 는 bIsPermanent 가 true 로 들어와 원형 게이지를 가득 채운 채 둔다.
30 void UpdateRemaining(float NormalizedRemaining, float RemainingSeconds, bool bIsPermanent);
31
32public:
33 FORCEINLINE USituationBase* GetBoundSituation() const
34 {
35 return BoundSituation.Get();
36 }
37
38protected:
39 // 툴팁(이름/설명) 구성은 BP 에서 한다.
40 UFUNCTION(BlueprintImplementableEvent, Category = "UI|Constellation")
41 void OnSlotSetup(USituationBase* InSituation);
42
43 // 남은 초를 텍스트로 띄우고 싶을 때 BP 에서 받는다.
44 UFUNCTION(BlueprintImplementableEvent, Category = "UI|Constellation")
45 void OnRemainingUpdated(float RemainingSeconds, bool bIsPermanent);
46
47protected:
48 // SkillSlotWidget 과 같은 방식. 여기 지정한 브러시를 이미지에 먼저 씌운 뒤
49 // 다이나믹 머티리얼을 얻는다. 브러시 리소스가 머티리얼이어야 GetDynamicMaterial 이 성공한다.
50 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|Constellation")
51 FSlateBrush DurationProgressBrush;
52
53 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|Constellation")
54 FName ProgressParameterName = TEXT("Progress");
55
56protected:
57 UPROPERTY(BlueprintReadOnly, Category = "UI|Constellation", meta = (BindWidget))
58 TObjectPtr<UImage> BuffIcon;
59
60 // Progress 스칼라 파라미터를 가진 원형 프로그레스 머티리얼이 물려 있어야 한다.
61 UPROPERTY(BlueprintReadOnly, Category = "UI|Constellation", meta = (BindWidgetOptional))
62 TObjectPtr<UImage> DurationProgressImage;
63
64 UPROPERTY(Transient)
65 TObjectPtr<UMaterialInstanceDynamic> DurationProgressMaterial;
66
67 UPROPERTY(Transient)
68 TWeakObjectPtr<USituationBase> BoundSituation;
69
70private:
71 // 머티리얼 확보에 실패했으면 매 틱 재시도하지 않는다. 로그 스팸을 막는다.
72 uint8 bDurationMaterialUnavailable : 1 = false;
73};
Definition ConstellationBuffSlotWidget.h:22
FORCEINLINE USituationBase * GetBoundSituation() const
Definition ConstellationBuffSlotWidget.h:33
Definition SituationBase.h:31
Definition UserWidgetBase.h:33