A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DlgObject.cpp
Go to the documentation of this file.
1
// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2
#pragma once
3
4
#include "
DlgObject.h
"
5
6
#include "
DlgManager.h
"
7
#include "UObject/Object.h"
8
9
void
UDlgObject::PostInitProperties
()
10
{
11
// We must always set the outer to be something that exists at runtime
12
#if WITH_EDITOR
13
if
(
UEdGraphNode
* GraphNode = Cast<UEdGraphNode>(GetOuter()))
14
{
15
UDlgDialogue::GetDialogueEditorAccess()->SetNewOuterForObjectFromGraphNode(
this
, GraphNode);
16
}
17
#endif
18
19
Super::PostInitProperties();
20
}
21
22
UWorld*
UDlgObject::GetWorld
()
const
23
{
24
if
(HasAnyFlags(RF_ArchetypeObject | RF_ClassDefaultObject))
25
{
26
return
nullptr
;
27
}
28
29
// Get from outer
30
if
(
UObject
* Outer = GetOuter())
31
{
32
if
(UWorld* World = Outer->GetWorld())
33
{
34
return
World;
35
}
36
}
37
38
// Last resort
39
return
UDlgManager::GetDialogueWorld
();
40
}
DlgManager.h
DlgObject.h
UDlgManager::GetDialogueWorld
static UWorld * GetDialogueWorld()
UFUNCTION(BlueprintCallable, Category = "Dialogue|Persistence")
Definition
DlgManager.cpp:586
UDlgObject::GetWorld
UWorld * GetWorld() const override
Definition
DlgObject.cpp:22
UDlgObject::PostInitProperties
void PostInitProperties() override
Definition
DlgObject.cpp:9
UEdGraphNode
UObject
SDKDemo
Plugins
UnrealEngineSDK
VisualScripter
Source
DlgSystem
Private
DlgObject.cpp
Generated
Wed Oct 9 2024 19:52:54
by Doxygen version
1.10.0