6#include "DlgNode_Speech.generated.h"
15UCLASS(BlueprintType, ClassGroup =
"Dialogue")
22 FString GetDesc()
override
26 return TEXT(
"Virtual Parent Node. Acts like a fake parent (proxy) to other child nodes. (aka makes it get the grandchildren)\nOn revaluate children, it does not get the direct children but the children of the first satisfied direct child node (grandchildren).\nIt should have at least one satisified child otherwise the Dialogue is terminated.");
29 return TEXT(
"Normal dialogue node - someone says something.");
38 void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
override;
45 bool HandleNodeEnter(
UDlgContext& Context, TSet<const UDlgNode*> NodesEnteredWithThisStep)
override;
46 bool ReevaluateChildren(
UDlgContext& Context, TSet<const UDlgNode*> AlreadyEvaluated)
override;
47 void GetAssociatedParticipants(TArray<FName>& OutArray)
const override;
49 void UpdateTextsValuesFromDefaultsAndRemappings(
const UDlgSystemSettings& Settings,
bool bEdges,
bool bUpdateGraphNode =
true)
override;
50 void UpdateTextsNamespacesAndKeys(
const UDlgSystemSettings& Settings,
bool bEdges,
bool bUpdateGraphNode =
true)
override;
51 void RebuildConstructedText(
const UDlgContext& Context)
override;
52 void RebuildTextArguments(
bool bEdges,
bool bUpdateGraphNode =
true)
override
54 Super::RebuildTextArguments(bEdges, bUpdateGraphNode);
58 const TArray<FDlgTextArgument>& GetTextArguments()
const override {
return TextArguments; };
61 const FText& GetNodeText()
const override
63 if (TextArguments.Num() > 0 && !ConstructedText.IsEmpty())
65 return ConstructedText;
69 const FText& GetNodeUnformattedText()
const override {
return Text; }
70 UDlgNodeData* GetNodeData()
const override {
return NodeData; }
74 USoundBase* GetNodeVoiceSoundBase()
const override {
return VoiceSoundWave; }
75 UDialogueWave* GetNodeVoiceDialogueWave()
const override {
return VoiceDialogueWave; }
76 UObject* GetNodeGenericData()
const override {
return GenericData; }
78 void AddAllSpeakerStatesIntoSet(TSet<FName>& OutStates)
const override { OutStates.Add(
SpeakerState); }
81 FString GetNodeTypeString()
const override {
return bIsVirtualParent ? TEXT(
"Virtual Parent") : TEXT(
"Speech"); }
89 UFUNCTION(BlueprintPure, Category =
"Dialogue|Node")
90 virtual
bool IsVirtualParent()
const {
return bIsVirtualParent; }
93 virtual void SetIsVirtualParent(
bool bValue) { bIsVirtualParent = bValue; }
96 virtual void SetNodeText(
const FText& InText)
99 RebuildTextArguments(
false);
103 void SetSpeakerState(FName InSpeakerState) {
SpeakerState = InSpeakerState; }
104 void SetVoiceSoundBase(USoundBase* InVoiceSoundBase) { VoiceSoundWave = InVoiceSoundBase; }
105 void SetVoiceDialogueWave(UDialogueWave* InVoiceDialogueWave) { VoiceDialogueWave = InVoiceDialogueWave; }
106 void SetGenericData(
UObject* InGenericData) { GenericData = InGenericData; }
109 static FName GetMemberNameText() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, Text); }
110 static FName GetMemberNameTextArguments() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, TextArguments); }
111 static FName GetMemberNameNodeData() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, NodeData); }
112 static FName GetMemberNameVoiceSoundWave() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, VoiceSoundWave); }
113 static FName GetMemberNameVoiceDialogueWave() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, VoiceDialogueWave); }
114 static FName GetMemberNameGenericData() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, GenericData); }
116 static FName GetMemberNameIsVirtualParent() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, bIsVirtualParent); }
117 static FName GetMemberNameVirtualParentFireDirectChildEnterEvents() {
return GET_MEMBER_NAME_CHECKED(
UDlgNode_Speech, bVirtualParentFireDirectChildEnterEvents); }
126 UPROPERTY(EditAnywhere, Category =
"Dialogue|Node")
127 bool bIsVirtualParent = false;
130 UPROPERTY(EditAnywhere, Category = "
Dialogue|Node")
131 bool bVirtualParentFireDirectChildEnterEvents = true;
135 UPROPERTY(EditAnywhere, Category = "
Dialogue|Node", Meta = (MultiLine = true))
139 UPROPERTY(EditAnywhere, EditFixedSize, Category = "
Dialogue|Node")
143 UPROPERTY(EditAnywhere, Category = "
Dialogue|Node")
149 UPROPERTY(EditAnywhere, Instanced, Category = "
Dialogue|Node")
154 UPROPERTY(EditAnywhere, Category = "
Dialogue|Node", Meta = (DlgSaveOnlyReference))
155 USoundBase* VoiceSoundWave =
nullptr;
159 UPROPERTY(EditAnywhere, Category = "
Dialogue|Node", Meta = (DlgSaveOnlyReference))
160 UDialogueWave* VoiceDialogueWave =
nullptr;
164 UPROPERTY(EditAnywhere, Category = "
Dialogue|Node", Meta = (DlgSaveOnlyReference))
165 UObject* GenericData =
nullptr;
168 FText ConstructedText;
170 int32 VirtualParentFirstSatisfiedDirectChildIndex = INDEX_NONE;
UCLASS(BlueprintType, ClassGroup = "Dialogue")
static FName GetMemberNameIsVirtualParent()
TArray< FDlgTextArgument > TextArguments
UPROPERTY(EditAnywhere, EditFixedSize, Category = "Dialogue|Node")
static FName GetMemberNameVoiceDialogueWave()
FName SpeakerState
UPROPERTY(EditAnywhere, Category = "Dialogue|Node")
virtual bool IsVirtualParent() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
const FText & GetNodeText() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
void SetSpeakerState(FName InSpeakerState)
static FName GetMemberNameNodeData()
FName GetSpeakerState() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
FText Text
UPROPERTY(EditAnywhere, Category = "Dialogue|Node", Meta = (MultiLine = true))
void AddAllSpeakerStatesIntoSet(TSet< FName > &OutStates) const override
virtual void SetIsVirtualParent(bool bValue)
void SetVoiceDialogueWave(UDialogueWave *InVoiceDialogueWave)
void SetGenericData(UObject *InGenericData)
UObject * GetNodeGenericData() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UDialogueWave * GetNodeVoiceDialogueWave() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
USoundBase * GetNodeVoiceSoundBase() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
void SetNodeData(UDlgNodeData *InNodeData)
static FName GetMemberNameVirtualParentFireDirectChildEnterEvents()
static FName GetMemberNameTextArguments()
void SetVoiceSoundBase(USoundBase *InVoiceSoundBase)
static FName GetMemberNameSpeakerState()
void RebuildTextArguments(bool bEdges, bool bUpdateGraphNode=true) override
static FName GetMemberNameText()
FString GetDesc() override
static FName GetMemberNameVoiceSoundWave()
const TArray< FDlgTextArgument > & GetTextArguments() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UDlgNodeData * GetNodeData() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
void RebuildTextArgumentsFromPreview(const FText &Preview) override
virtual void SetNodeText(const FText &InText)
const FText & GetNodeUnformattedText() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
static FName GetMemberNameGenericData()
UCLASS(Blueprintable, BlueprintType, Abstract, EditInlineNew)
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
virtual bool HandleNodeEnter(UDlgContext &Context, TSet< const UDlgNode * > NodesEnteredWithThisStep)
virtual void GetAssociatedParticipants(TArray< FName > &OutArray) const
virtual void RebuildTextArguments(bool bEdges, bool bUpdateGraphNode=true)
virtual void RebuildConstructedText(const UDlgContext &Context)
virtual void UpdateTextsNamespacesAndKeys(const UDlgSystemSettings &Settings, bool bEdges, bool bUpdateGraphNode=true)
virtual void UpdateTextsValuesFromDefaultsAndRemappings(const UDlgSystemSettings &Settings, bool bEdges, bool bUpdateGraphNode=true)
virtual bool ReevaluateChildren(UDlgContext &Context, TSet< const UDlgNode * > AlreadyEvaluated)
UCLASS(Config = Engine, DefaultConfig, meta = (DisplayName = "Dialogue System Settings"))
static void UpdateTextArgumentArray(const FText &Text, TArray< FDlgTextArgument > &InOutArgumentArray)