A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DlgDialogue.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "Templates/SubclassOf.h"
5
7#include "DlgSystemSettings.h"
9
10#include "DlgDialogue.generated.h"
11
12class UDlgNode;
13
14// Custom serialization version for changes made in Dev-Dialogues stream
15struct DLGSYSTEM_API FDlgDialogueObjectVersion
16{
17 enum Type
18 {
19 // Before any version changes were made
20 BeforeCustomVersionWasAdded = 0,
32
33 // -----<new versions can be added above this line>-------------------------------------------------
35 LatestVersion = VersionPlusOne - 1
36 };
37
38 // The GUID for this custom version number
39 const static FGuid GUID;
40
41private:
43};
44
45
46// Structure useful to cache all the names used by a participant
47USTRUCT(BlueprintType)
48struct DLGSYSTEM_API FDlgParticipantClass
49{
50 GENERATED_USTRUCT_BODY()
52public:
53 // The Name of the Participant Used inside this Dialogue
54 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Dialogue|Participant")
55 FName ParticipantName = NAME_None;
56
57 // The Participant Class corresponding for the ParticipantName
58 // This is used to autocomplete and retrieve the Variables from that Class automatically when Using Class based Conditions/Events
59 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Participant", meta = (MustImplement = "DlgDialogueParticipant"))
60 UClass* ParticipantClass = nullptr;
61};
63
69UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
70class DLGSYSTEM_API UDlgDialogue : public UObject
72 GENERATED_BODY()
73public:
74
75 //
76 // Begin UObject Interface.
77 //
78
80 FString GetDesc() override { return TEXT(" DESCRIPTION = ") + GetName(); }
81
88 void PreSave(const class ITargetPlatform* TargetPlatform) override;
89
91 void Serialize(FArchive& Ar) override;
92
97 void PostLoad() override;
98
104 void PostInitProperties() override;
105
107 void PostRename(UObject* OldOuter, FName OldName) override;
108
113 void PostDuplicate(bool bDuplicateForPIE) override;
114
120 void PostEditImport() override;
121
122#if WITH_EDITOR
132 bool Modify(bool bAlwaysMarkDirty = true) override;
133
139 void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
140
145 void PostEditChangeChainProperty(struct FPropertyChangedChainEvent& PropertyChangedEvent) override;
146
154 static void AddReferencedObjects(UObject* InThis, FReferenceCollector& Collector);
155 // End UObject Interface.
156
157 //
158 // Begin own functions
159 //
160
161 // Broadcasts whenever a property of this dialogue changes.
162 DECLARE_EVENT_OneParam(UDlgDialogue, FDialoguePropertyChanged, const FPropertyChangedEvent& /* PropertyChangedEvent */);
163 FDialoguePropertyChanged OnDialoguePropertyChanged;
164
165 // Helper functions to get the names of some properties. Used by the DlgSystemEditor module.
166 static FName GetMemberNameName() { return GET_MEMBER_NAME_CHECKED(UDlgDialogue, Name); }
167 static FName GetMemberNameGUID() { return GET_MEMBER_NAME_CHECKED(UDlgDialogue, GUID); }
168 static FName GetMemberNameParticipantsData() { return GET_MEMBER_NAME_CHECKED(UDlgDialogue, ParticipantsData); }
169 static FName GetMemberNameStartNode() { return GET_MEMBER_NAME_CHECKED(UDlgDialogue, StartNode); }
170 static FName GetMemberNameNodes() { return GET_MEMBER_NAME_CHECKED(UDlgDialogue, Nodes); }
171
172 // Create the basic dialogue graph.
173 void CreateGraph();
174
175 // Clears all nodes from the graph.
176 void ClearGraph();
177
178 // Gets the editor graph of this Dialogue.
179 UEdGraph* GetGraph()
180 {
181 check(DlgGraph);
182 return DlgGraph;
183 }
184 const UEdGraph* GetGraph() const
185 {
186 check(DlgGraph);
187 return DlgGraph;
188 }
189
190 // Useful for initially compiling the Dialogue when we need the extra processing steps done by the compiler.
191 void InitialCompileDialogueNodesFromGraphNodes()
192 {
193 if (bWasCompiledAtLeastOnce)
194 return;
195
196 CompileDialogueNodesFromGraphNodes();
197 bWasCompiledAtLeastOnce = true;
198 }
199
200 // Compiles the dialogue nodes from the graph nodes. Meaning it transforms the graph data -> (into) dialogue data.
201 void CompileDialogueNodesFromGraphNodes();
202
203 // Sets the dialogue editor implementation. This is called in the constructor of the DlgDialogueGraph in the DlgSytemEditor module.
204 static void SetDialogueEditorAccess(const TSharedPtr<IDlgDialogueEditorAccess>& InDialogueEditor)
205 {
206 check(!DialogueEditorAccess.IsValid());
207 check(InDialogueEditor.IsValid());
208 DialogueEditorAccess = InDialogueEditor;
209 }
210
211 // Gets the dialogue editor implementation.
212 static TSharedPtr<IDlgDialogueEditorAccess> GetDialogueEditorAccess() { return DialogueEditorAccess; }
213
214 // Enables/disables the compilation of the dialogues in the editor, use with care. Mainly used for optimization.
215 void EnableCompileDialogue() { bCompileDialogue = true; }
216 void DisableCompileDialogue() { bCompileDialogue = false; }
217#endif
218
219 // Construct and initialize a node within this Dialogue.
220 template<class T>
221 T* ConstructDialogueNode(TSubclassOf<UDlgNode> DialogueNodeClass = T::StaticClass())
222 {
223 // Set flag to be transactional so it registers with undo system
224 T* DialogueNode = NewObject<T>(this, DialogueNodeClass, NAME_None, RF_Transactional);
225 return DialogueNode;
226 }
227
228 //
229 // Dialogue Data
230 //
231
232 // Gets the Dialogue Data Map. It maps Participant Name => Participant Data
233 UFUNCTION(BlueprintPure, Category = "Dialogue")
234 const TMap<FName, FDlgParticipantData>& GetParticipantsData() const { return ParticipantsData; }
236 // Checks if the provided ParticipantName (SpeakerName) is a key in the Dialogue Data Map
237 UFUNCTION(BlueprintPure, Category = "Dialogue")
238 bool HasParticipant(FName ParticipantName) const { return ParticipantsData.Contains(ParticipantName); }
239
240 // Gets the number of participants in the Dialogue Data Map.
241 UFUNCTION(BlueprintPure, Category = "Dialogue")
242 int32 GetParticipantsNum() const { return ParticipantsData.Num(); }
243
244 // Gets all the keys (participant names) of the DlgData Map
245 UFUNCTION(BlueprintPure, Category = "Dialogue")
246 void GetAllParticipantNames(TSet<FName>& OutSet) const
247 {
248 for (const auto& Element : ParticipantsData)
249 {
250 // Key is the ParticipantName
251 OutSet.Add(Element.Key);
252 }
253 }
254
255 UFUNCTION(BlueprintPure, Category = "Dialogue")
256 const TArray<FDlgParticipantClass>& GetAllParticipantClasses() const { return ParticipantsClasses; }
257
259 UFUNCTION(BlueprintPure, Category = "Dialogue")
260 UClass* GetParticipantClass(FName ParticipantName) const
261 {
262 for (const FDlgParticipantClass& Pair : ParticipantsClasses)
263 {
264 if (Pair.ParticipantName == ParticipantName)
266 return Pair.ParticipantClass;
267 }
268 }
269 return nullptr;
270 }
271
273 // Gets the Condition Names that correspond to the provided ParticipantName.
274 UFUNCTION(BlueprintPure, Category = "Dialogue")
275 void GetConditions(FName ParticipantName, TSet<FName>& OutSet) const
276 {
277 if (ParticipantsData.Contains(ParticipantName))
278 {
279 OutSet.Append(ParticipantsData[ParticipantName].Conditions);
280 }
281 }
282
283 // Gets the Event Names that correspond to the provided ParticipantName.
284 UFUNCTION(BlueprintPure, Category = "Dialogue")
285 void GetEvents(FName ParticipantName, TSet<FName>& OutSet) const
286 {
287 if (ParticipantsData.Contains(ParticipantName))
288 {
289 OutSet.Append(ParticipantsData[ParticipantName].Events);
290 }
291 }
293 // Gets the Custom Events UClasses that correspond to the provided ParticipantName.
294 UFUNCTION(BlueprintPure, Category = "Dialogue")
295 void GetCustomEvents(FName ParticipantName, TSet<UClass*>& OutSet) const
296 {
297 if (ParticipantsData.Contains(ParticipantName))
298 {
299 OutSet.Append(ParticipantsData[ParticipantName].CustomEvents);
300 }
301 }
302
303 // Gets the int variable Names that correspond to the provided ParticipantName.
304 UFUNCTION(BlueprintPure, Category = "Dialogue")
305 void GetIntNames(FName ParticipantName, TSet<FName>& OutSet) const
306 {
307 if (ParticipantsData.Contains(ParticipantName))
308 {
309 OutSet.Append(ParticipantsData[ParticipantName].IntVariableNames);
311 }
312
313 // Gets the float variable Names that correspond to the provided ParticipantName.
314 UFUNCTION(BlueprintPure, Category = "Dialogue")
315 void GetFloatNames(FName ParticipantName, TSet<FName>& OutSet) const
316 {
317 if (ParticipantsData.Contains(ParticipantName))
318 {
319 OutSet.Append(ParticipantsData[ParticipantName].FloatVariableNames);
320 }
321 }
322
323 // Gets the bool variable Names that correspond to the provided ParticipantName.
324 UFUNCTION(BlueprintPure, Category = "Dialogue")
325 void GetBoolNames(FName ParticipantName, TSet<FName>& OutSet) const
326 {
327 if (ParticipantsData.Contains(ParticipantName))
328 {
329 OutSet.Append(ParticipantsData[ParticipantName].BoolVariableNames);
330 }
331 }
332
333 // Gets the name variable Names that correspond to the provided ParticipantName.
334 UFUNCTION(BlueprintPure, Category = "Dialogue")
335 void GetNameNames(FName ParticipantName, TSet<FName>& OutSet) const
337 if (ParticipantsData.Contains(ParticipantName))
338 {
339 OutSet.Append(ParticipantsData[ParticipantName].NameVariableNames);
340 }
341 }
342
343
344 // Gets the int variable Names that correspond to the UClass of the provided ParticipantName.
345 UFUNCTION(BlueprintPure, Category = "Dialogue")
346 void GetClassIntNames(FName ParticipantName, TSet<FName>& OutSet) const
347 {
348 if (ParticipantsData.Contains(ParticipantName))
350 OutSet.Append(ParticipantsData[ParticipantName].ClassIntVariableNames);
351 }
352 }
353
354 // Gets the float variable Names that correspond to the UClass of the provided ParticipantName.
355 UFUNCTION(BlueprintPure, Category = "Dialogue")
356 void GetClassFloatNames(FName ParticipantName, TSet<FName>& OutSet) const
357 {
358 if (ParticipantsData.Contains(ParticipantName))
359 {
360 OutSet.Append(ParticipantsData[ParticipantName].ClassFloatVariableNames);
361 }
363
364 // Gets the bool variable Names that correspond to the UClass of the provided ParticipantName.
365 UFUNCTION(BlueprintPure, Category = "Dialogue")
366 void GetClassBoolNames(FName ParticipantName, TSet<FName>& OutSet) const
367 {
368 if (ParticipantsData.Contains(ParticipantName))
369 {
370 OutSet.Append(ParticipantsData[ParticipantName].ClassBoolVariableNames);
371 }
372 }
373
374 // Gets the name variable Names that correspond to the UClass of the provided ParticipantName.
375 UFUNCTION(BlueprintPure, Category = "Dialogue")
376 void GetClassNameNames(FName ParticipantName, TSet<FName>& OutSet) const
377 {
378 if (ParticipantsData.Contains(ParticipantName))
379 {
380 OutSet.Append(ParticipantsData[ParticipantName].ClassNameVariableNames);
381 }
382 }
383
384 // Gets the FText variable Names that correspond to the UClass of the provided ParticipantName.
385 UFUNCTION(BlueprintPure, Category = "Dialogue")
386 void GetClassTextNames(FName ParticipantName, TSet<FName>& OutSet) const
387 {
388 if (ParticipantsData.Contains(ParticipantName))
389 {
390 OutSet.Append(ParticipantsData[ParticipantName].ClassTextVariableNames);
391 }
392 }
393
394 // Gets all the SpeakerStates used inside this dialogue
395 UFUNCTION(BlueprintPure, Category = "Dialogue")
396 void GetAllSpeakerStates(TSet<FName>& OutSet) const
397 {
398 OutSet.Append(AllSpeakerStates);
399 }
400
401 UFUNCTION(BlueprintPure, Category = "Dialogue")
402 int32 GetDialogueVersion() const { return Version; }
403
404 // Gets/extracts the name (without extension) of the dialog from the uasset filename
405 UFUNCTION(BlueprintPure, Category = "Dialogue")
406 FString GetDialogueName() const
407 {
408 // Note: GetPathName() calls this at the end, so this just gets the direct name that we want.
409 // Assumption only true for objects that have the Outer an UPackage.
410 // Otherwise call FPaths::GetBaseFilename(GetPathName())
411 return GetName();
412 }
413
414 // Same as the GetDialogueName only it returns a FName.
415 UFUNCTION(BlueprintPure, Category = "Dialogue")
416 FName GetDialogueFName() const { return GetFName(); }
417
418 // Gets the unique identifier for this dialogue.
419 UFUNCTION(BlueprintPure, Category = "Dialogue|GUID")
420 FGuid GetGUID() const { check(GUID.IsValid()); return GUID; }
421
422 // Regenerate the GUID of this Dialogue
423 void RegenerateGUID() { GUID = FGuid::NewGuid(); }
424
425 UFUNCTION(BlueprintPure, Category = "Dialogue|GUID")
426 bool HasGUID() const { return GUID.IsValid(); }
427
428 // Gets all the nodes
429 UFUNCTION(BlueprintPure, Category = "Dialogue")
430 const TArray<UDlgNode*>& GetNodes() const { return Nodes; }
431
432 // Gets the Start Node as a mutable pointer.
433 UFUNCTION(BlueprintPure, Category = "Dialogue", DisplayName = "Get Start Node")
434 UDlgNode* GetMutableStartNode() const { return StartNode; }
435 const UDlgNode& GetStartNode() const { return *StartNode; }
436
437 UFUNCTION(BlueprintPure, Category = "Dialogue")
438 bool IsValidNodeIndex(int32 NodeIndex) const { return Nodes.IsValidIndex(NodeIndex); }
439
440 UFUNCTION(BlueprintPure, Category = "Dialogue")
441 bool IsValidNodeGUID(const FGuid& NodeGUID) const { return IsValidNodeIndex(GetNodeIndexForGUID(NodeGUID)); }
442
443 // Gets the GUID for the Node at NodeIndex
444 UFUNCTION(BlueprintPure, Category = "Dialogue", DisplayName = "Get Node GUID For Index")
445 FGuid GetNodeGUIDForIndex(int32 NodeIndex) const;
446
447 // Gets the corresponding Node Index for the supplied NodeGUID
448 // Returns -1 (INDEX_NONE) if the Node GUID does not exist.
449 UFUNCTION(BlueprintPure, Category = "Dialogue", DisplayName = "Get Node Index For GUID")
450 int32 GetNodeIndexForGUID(const FGuid& NodeGUID) const;
451
452 // Gets the Node as a mutable pointer.
453 UFUNCTION(BlueprintPure, Category = "Dialogue", DisplayName = "Get Node From Index")
454 UDlgNode* GetMutableNodeFromIndex(int32 NodeIndex) const { return Nodes.IsValidIndex(NodeIndex) ? Nodes[NodeIndex] : nullptr; }
455
456 UFUNCTION(BlueprintPure, Category = "Dialogue|Data", DisplayName = "Get Node From GUID")
457 UDlgNode* GetMutableNodeFromGUID(const FGuid& NodeGUID) const { return GetMutableNodeFromIndex(GetNodeIndexForGUID(NodeGUID)); }
458
459 // Sets a new Start Node. Use with care.
460 void SetStartNode(UDlgNode* InStartNode);
461
462 // NOTE: don't call this if you don't know what you are doing, you most likely need to call
463 // SetStartNode
464 // SetNodes
465 // After this
466 void EmptyNodesGUIDToIndexMap() { NodesGUIDToIndexMap.Empty(); }
468 // Sets the Dialogue Nodes. Use with care.
469 void SetNodes(const TArray<UDlgNode*>& InNodes);
470
471 // Sets the Node at index NodeIndex. Use with care.
472 void SetNode(int32 NodeIndex, UDlgNode* InNode);
473
474 // Is the Node at NodeIndex (if it exists) an end node?
475 bool IsEndNode(int32 NodeIndex) const;
477 // Check if a text file in the same folder with the same name (Name) exists and loads the data from that file.
478 void ImportFromFile();
479
480 // Method to handle when this asset is going to be saved. Compiles the dialogue and saves to the text file.
481 void OnPreAssetSaved();
482
483 // Useful for initially reloading the data from the text file so that the dialogue is always in sync.
484 void InitialSyncWithTextFile()
485 {
486 if (bIsSyncedWithTextFile)
487 {
488 return;
489 }
490
491 ImportFromFile();
492 bIsSyncedWithTextFile = true;
493 }
494
495 // Exports this dialogue data into it's corresponding ".dlg" text file with the same name as this (Name).
496 void ExportToFile() const;
497
498 // Updates the data of some nodes
499 // Fills the DlgData with the updated data
500 // NOTE: this can do a dialogue data -> graph node data update
501 void UpdateAndRefreshData(bool bUpdateTextsNamespacesAndKeys = false);
502
503 // Adds a new node to this dialogue, returns the index location of the added node in the Nodes array.
504 int32 AddNode(UDlgNode* NodeToAdd) { return Nodes.Add(NodeToAdd); }
505
510 FString GetTextFilePathName(bool bAddExtension = true) const;
511 FString GetTextFilePathName(EDlgDialogueTextFormat TextFormat, bool bAddExtension = true) const;
513 // Perform deletion on the text files
514 bool DeleteTextFileForTextFormat(EDlgDialogueTextFormat TextFormat) const;
515 bool DeleteTextFileForExtension(const FString& FileExtension) const;
516 bool DeleteAllTextFiles() const;
517
518 // Is this dialogue located inside the project directory
519 bool IsInProjectDirectory() const;
520
525 static FString GetTextFilePathNameFromAssetPathName(const FString& AssetPathName);
527private:
528 // Adds conditions from the edges of this Node.
529 void AddConditionsDataFromNodeEdges(const UDlgNode* Node, int32 NodeIndex);
530
531 // Gets the map entry - creates it first if it is not yet there
532 FDlgParticipantData& GetParticipantDataEntry(FName ParticipantName, FName FallbackParticipantName, bool bCheckNone, const FString& ContextMessage);
534 // Rebuild & Update and node and its edges
535 void RebuildAndUpdateNode(UDlgNode* Node, const UDlgSystemSettings& Settings, bool bUpdateTextsNamespacesAndKeys);
536
537 void ImportFromFileFormat(EDlgDialogueTextFormat TextFormat);
538 void ExportToFileFormat(EDlgDialogueTextFormat TextFormat) const;
546 void AutoFixGraph();
547
548 // Updates NodesGUIDToIndexMap with Node
549 void UpdateGUIDToIndexMap(const UDlgNode* Node, int32 NodeIndex);
550
551protected:
552 // Used to keep track of the version in text file too, besides being written in the .uasset file.
553 UPROPERTY()
554 int32 Version = FDlgDialogueObjectVersion::LatestVersion;
555
556 // The name of the dialog, only used for reference in the text file, as this must always match the .uasset file name and .dlg file name
557 UPROPERTY(VisibleAnywhere, Category = "Dialogue")
558 FName Name;
559
560 // The Unique identifier for each dialogue. This is used to uniquely identify a Dialogue, instead of it's name or path. Much more safer.
561 UPROPERTY(VisibleAnywhere, Category = "Dialogue")
562 FGuid GUID;
563
564 // All the Participants that require for you to define its UClass otherwise the auto completion/suggestion won't work in case you want to modify/check Class variables.
565 UPROPERTY(EditAnywhere, EditFixedSize, Category = "Dialogue")
566 TArray<FDlgParticipantClass> ParticipantsClasses;
568 // Gathered data about events/conditions for each participant (for bp nodes, suggestions, etc.)
569 UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = "Dialogue", Meta = (DlgNoExport))
570 TMap<FName, FDlgParticipantData> ParticipantsData;
571
572 // All the speaker states used inside this Dialogue.
573 UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = "Dialogue", Meta = (DlgNoExport))
574 TSet<FName> AllSpeakerStates;
575
576 // Root node, Dialogue is started from the first child with satisfied condition (like the SelectorFirst node)
577 // NOTE: Add VisibleAnywhere to make it easier to debug
578 UPROPERTY(Instanced)
579 UDlgNode* StartNode;
580
581 // The new list of all nodes that belong to this Dialogue. Each nodes has children (edges) that have indices that point
582 // to other nodes in this array.
583 // NOTE: Add VisibleAnywhere to make it easier to debug
584 UPROPERTY(AdvancedDisplay, EditFixedSize, Instanced, Meta = (DlgWriteIndex))
585 TArray<UDlgNode*> Nodes;
586
587 // Maps Node GUID => Node Index
588 UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = "Dialogue", DisplayName = "Nodes GUID To Index Map")
589 TMap<FGuid, int32> NodesGUIDToIndexMap;
590
591 // Useful for syncing on the first run with the text file.
592 bool bIsSyncedWithTextFile = false;
593
594#if WITH_EDITORONLY_DATA
595 // EdGraph based representation of the DlgDialogue class
596 UPROPERTY(Meta = (DlgNoExport))
597 UEdGraph* DlgGraph;
598
599 // Ptr to interface to dialogue editor operations. See function SetDialogueEditorAccess for more details.
600 static TSharedPtr<IDlgDialogueEditorAccess> DialogueEditorAccess;
601
602 // Flag used for optimization, used to enable/disable compiling of the dialogue for bulk operations.
603 bool bCompileDialogue = true;
604
605 // Flag indicating if this Dialogue was compiled at least once in the current runtime.
606 bool bWasCompiledAtLeastOnce = false;
607
608 // Used to build the change event and broadcast it to the children
609 int32 BroadcastPropertyNodeIndexChanged = INDEX_NONE;
610#endif
611
612 // Flag that indicates that This Was Loaded was called
613 bool bWasLoaded = false;
EDlgDialogueTextFormat
UENUM()
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
Definition DlgDialogue.h:85
TSet< FName > AllSpeakerStates
UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = "Dialogue", Meta = (DlgNoExport))
TMap< FName, FDlgParticipantData > ParticipantsData
UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = "Dialogue", Meta = (DlgNoExport))
void GetClassFloatNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
const TMap< FName, FDlgParticipantData > & GetParticipantsData() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
UDlgNode * GetMutableNodeFromGUID(const FGuid &NodeGUID) const
UFUNCTION(BlueprintPure, Category = "Dialogue|Data", DisplayName = "Get Node From GUID")
bool IsValidNodeIndex(int32 NodeIndex) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
const TArray< FDlgParticipantClass > & GetAllParticipantClasses() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetAllParticipantNames(TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
const TArray< UDlgNode * > & GetNodes() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
UDlgNode * StartNode
UPROPERTY(Instanced)
void GetClassTextNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetClassBoolNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
UClass * GetParticipantClass(FName ParticipantName) const
EDITOR function, it only works if the participant class is setup in the ParticipantsClasses array.
const UDlgNode & GetStartNode() const
void GetClassIntNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetEvents(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
FGuid GUID
UPROPERTY(VisibleAnywhere, Category = "Dialogue")
void GetBoolNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
bool HasGUID() const
UFUNCTION(BlueprintPure, Category = "Dialogue|GUID")
bool HasParticipant(FName ParticipantName) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetClassNameNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetNameNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
FGuid GetGUID() const
UFUNCTION(BlueprintPure, Category = "Dialogue|GUID")
T * ConstructDialogueNode(TSubclassOf< UDlgNode > DialogueNodeClass=T::StaticClass())
UDlgNode * GetMutableStartNode() const
UFUNCTION(BlueprintPure, Category = "Dialogue", DisplayName = "Get Start Node")
int32 GetParticipantsNum() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetCustomEvents(FName ParticipantName, TSet< UClass * > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
bool IsValidNodeGUID(const FGuid &NodeGUID) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
TMap< FGuid, int32 > NodesGUIDToIndexMap
UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = "Dialogue", DisplayName = "Nodes GUID To Index...
void InitialSyncWithTextFile()
FString GetDialogueName() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
UDlgNode * GetMutableNodeFromIndex(int32 NodeIndex) const
UFUNCTION(BlueprintPure, Category = "Dialogue", DisplayName = "Get Node From Index")
FString GetDesc() override
Definition DlgDialogue.h:94
FName Name
UPROPERTY(VisibleAnywhere, Category = "Dialogue")
void GetConditions(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetFloatNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
TArray< FDlgParticipantClass > ParticipantsClasses
UPROPERTY(EditAnywhere, EditFixedSize, Category = "Dialogue")
void RegenerateGUID()
void GetIntNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
int32 GetDialogueVersion() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
int32 AddNode(UDlgNode *NodeToAdd)
void GetAllSpeakerStates(TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
FName GetDialogueFName() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
TArray< UDlgNode * > Nodes
UPROPERTY(AdvancedDisplay, EditFixedSize, Instanced, Meta = (DlgWriteIndex))
void EmptyNodesGUIDToIndexMap()
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
Definition DlgNode.h:40
UCLASS(Config = Engine, DefaultConfig, meta = (DisplayName = "Dialogue System Settings"))
static const FGuid GUID
Definition DlgDialogue.h:39
USTRUCT(BlueprintType)
Definition DlgDialogue.h:52
UClass * ParticipantClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Participant", meta = (MustImplement ...
Definition DlgDialogue.h:71