A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DialogueBlueprintUtilities.h
Go to the documentation of this file.
1
// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2
#pragma once
3
4
#include "CoreMinimal.h"
5
#include "Kismet2/BlueprintEditorUtils.h"
6
7
#include "
DlgDialogueParticipant.h
"
8
#include "
DlgManager.h
"
9
10
class
FDialogueBlueprintUtilities
11
{
12
public
:
13
// Gets the blueprint for the provided Node
14
static
UBlueprint*
GetBlueprintForGraphNode
(
const
UK2Node
* Node)
15
{
16
if
(!IsValid(Node))
17
{
18
return
nullptr
;
19
}
20
21
// NOTE we can't call Node->GetBlueprint() because this is called in strange places ;)
22
if
(
const
UEdGraph
* Graph = Cast<UEdGraph>(Node->GetOuter()))
23
{
24
return
FBlueprintEditorUtils::FindBlueprintForGraph(Graph);
25
}
26
27
return
nullptr
;
28
}
29
30
// Checks if the Blueprint for the Node is loaded or not.
31
static
bool
IsBlueprintLoadedForGraphNode
(
const
UK2Node
* Node)
32
{
33
if
(UBlueprint* Blueprint =
GetBlueprintForGraphNode
(Node))
34
{
35
return
!Blueprint->HasAnyFlags(RF_NeedLoad | RF_NeedPostLoad);
36
}
37
return
false
;
38
}
39
44
static
FName
GetParticipantNameFromNode
(
const
UK2Node
* Node)
45
{
46
if
(
const
UBlueprint* Blueprint =
GetBlueprintForGraphNode
(Node))
47
{
48
if
(
UDlgManager::DoesObjectImplementDialogueParticipantInterface
(Blueprint))
49
{
50
return
IDlgDialogueParticipant::Execute_GetParticipantName(Blueprint->GeneratedClass->GetDefaultObject());
51
}
52
}
53
54
return
NAME_None;
55
}
56
};
DlgDialogueParticipant.h
DlgManager.h
FDialogueBlueprintUtilities
Definition
DialogueBlueprintUtilities.h:11
FDialogueBlueprintUtilities::GetParticipantNameFromNode
static FName GetParticipantNameFromNode(const UK2Node *Node)
Definition
DialogueBlueprintUtilities.h:44
FDialogueBlueprintUtilities::GetBlueprintForGraphNode
static UBlueprint * GetBlueprintForGraphNode(const UK2Node *Node)
Definition
DialogueBlueprintUtilities.h:14
FDialogueBlueprintUtilities::IsBlueprintLoadedForGraphNode
static bool IsBlueprintLoadedForGraphNode(const UK2Node *Node)
Definition
DialogueBlueprintUtilities.h:31
UDlgManager::DoesObjectImplementDialogueParticipantInterface
static bool DoesObjectImplementDialogueParticipantInterface(const UObject *Object)
UFUNCTION(BlueprintPure, Category = "Dialogue|Helper")
Definition
DlgManager.cpp:410
UEdGraph
UK2Node
SDKDemo
Plugins
UnrealEngineSDK
VisualScripter
Source
DlgSystemEditor
Private
BlueprintNodes
DialogueBlueprintUtilities.h
Generated
Wed Oct 9 2024 19:52:54
by Doxygen version
1.10.0