UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DialogueWave.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
10#include "Misc/Guid.h"
11#include "Sound/DialogueTypes.h"
13#include "UObject/Object.h"
14
15#include "DialogueWave.generated.h"
16
18class UDialogueVoice;
19class USoundBase;
20class USoundWave;
22
24
26{
27 static ENGINE_API const FString DialogueNamespace;
28 static ENGINE_API const FString DialogueNotesNamespace;
29 static ENGINE_API const FString SubtitleKeySuffix;
30#if WITH_EDITORONLY_DATA
31 static ENGINE_API const FString ActingDirectionKeySuffix;
32 static ENGINE_API const FString PropertyName_AudioFile;
34 static ENGINE_API const FString PropertyName_Speaker;
35 static ENGINE_API const FString PropertyName_Targets;
36 static ENGINE_API const FString PropertyName_GrammaticalGender;
40 static ENGINE_API const FString PropertyName_DialogueContext;
41 static ENGINE_API const FString PropertyName_IsMature;
42#endif //WITH_EDITORONLY_DATA
43};
44
45USTRUCT()
47{
49
51
53 UPROPERTY(EditAnywhere, Category=DialogueContextMapping )
55
57 UPROPERTY(EditAnywhere, Category=DialogueContextMapping, meta = (DisallowedClasses= "/Script/MetasoundEngine.MetaSoundSource, /Script/Engine.SoundSourceBus"))
59
65 UPROPERTY(EditAnywhere, Category=DialogueContextMapping )
66 FString LocalizationKeyFormat;
67
71
73 ENGINE_API FString GetLocalizationKey() const;
74 ENGINE_API FString GetLocalizationKey(const FString& InOwnerDialogueWaveKey) const;
75};
76
77ENGINE_API bool operator==(const FDialogueContextMapping& LHS, const FDialogueContextMapping& RHS);
78ENGINE_API bool operator!=(const FDialogueContextMapping& LHS, const FDialogueContextMapping& RHS);
79
81
82UCLASS(hidecategories=Object, editinlinenew, MinimalAPI, BlueprintType, Meta = (LoadBehavior = "LazyOnDemand"))
84{
86
87
88 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Filter, AssetRegistrySearchable)
89 uint32 bMature:1;
90
92 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Script, meta=(InlineEditConditionToggle))
93 uint32 bOverride_SubtitleOverride : 1;
94
96 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Script)
97 FString SpokenText;
98
100 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Script, meta=(EditCondition="bOverride_SubtitleOverride"))
101 FString SubtitleOverride;
102
103#if WITH_EDITORONLY_DATA
105 UPROPERTY(EditAnywhere, Category=Script)
106 FString VoiceActorDirection;
107#endif // WITH_EDITORONLY_DATA
108
109 /* Mappings between dialogue contexts and associated soundwaves. */
110 UPROPERTY(EditAnywhere, Category=DialogueContexts)
111 TArray<FDialogueContextMapping> ContextMappings;
112
113 UPROPERTY()
114 FGuid LocalizationGUID;
115
116public:
117 //~ Begin UObject Interface.
118 virtual void Serialize( FArchive& Ar ) override;
119 virtual bool IsReadyForFinishDestroy() override;
120 virtual FString GetDesc() override;
121 virtual void GetAssetRegistryTags(FAssetRegistryTagsContext Context) const override;
122 UE_DEPRECATED(5.4, "Implement the version that takes FAssetRegistryTagsContext instead.")
123 virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
124
125 virtual void PostDuplicate(bool bDuplicateForPIE) override;
126 virtual void PostLoad() override;
127
128#if WITH_EDITOR
129 virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) override;
130#endif
131
132 //~ End UObject Interface.
133
134 //~ Begin UDialogueWave Interface.
135 ENGINE_API bool SupportsContext(const FDialogueContext& Context) const;
136 ENGINE_API USoundBase* GetWaveFromContext(const FDialogueContext& Context) const;
137 ENGINE_API USoundBase* GetWaveFromContext(const FDialogueContextMapping& ContextMapping) const;
138 ENGINE_API FText GetLocalizedSpokenText() const;
139 ENGINE_API FText GetLocalizedSpokenText(const FDialogueContext& Context) const;
140 ENGINE_API FText GetLocalizedSpokenText(const FDialogueContextMapping& ContextMapping) const;
141 ENGINE_API FText GetLocalizedSubtitle() const;
142 ENGINE_API FText GetLocalizedSubtitle(const FDialogueContext& Context) const;
143 ENGINE_API FText GetLocalizedSubtitle(const FDialogueContextMapping& ContextMapping) const;
144 ENGINE_API FString GetContextLocalizationKey(const FDialogueContext& Context) const;
145 ENGINE_API FString GetContextLocalizationKey(const FDialogueContextMapping& ContextMapping) const;
146 ENGINE_API FString GetContextRecordedAudioFilename(const FDialogueContext& Context) const;
147 ENGINE_API FString GetContextRecordedAudioFilename(const FDialogueContextMapping& ContextMapping) const;
148 ENGINE_API static FString BuildRecordedAudioFilename(const FString& FormatString, const FGuid& DialogueGuid, const FString& DialogueName, const FString& ContextId, const int32 ContextIndex);
149 //~ End UDialogueWave Interface.
150
152
153protected:
154
155 void UpdateMappingProxy(FDialogueContextMapping& ContextMapping);
156
157private:
158 void CopySoundBasePropertiesToProxy(const USoundBase* InSoundBase, USoundBase* Proxy);
159
160};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ENGINE_API FAutoConsoleVariableRef CVarUseNewSubtitles
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Engine.Build.cs:7
Definition Archive.h:1208
Definition AssetRegistryTagsContext.h:98
Definition IConsoleManager.h:1580
Definition Text.h:385
Definition Array.h:670
Definition DialogueSoundWaveProxy.h:18
Definition DialogueVoice.h:19
Definition DialogueWave.h:84
Definition Object.h:95
Definition SoundBase.h:109
Definition SoundWave.h:417
Definition DialogueWave.h:26
static ENGINE_API const FString DialogueNamespace
Definition DialogueWave.h:27
static ENGINE_API const FString SubtitleKeySuffix
Definition DialogueWave.h:29
static ENGINE_API const FString DialogueNotesNamespace
Definition DialogueWave.h:28
Definition DialogueWave.h:47
Definition DialogueTypes.h:44
Definition Guid.h:109
Definition UnrealType.h:7001
Definition ObjectPtr.h:488