A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DialogueEvent_Details.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "IPropertyTypeCustomization.h"
5#include "Layout/Visibility.h"
6#include "IDetailPropertyRow.h"
7
8#include "DlgEvent.h"
9#include "DlgManager.h"
11
15
21{
23
24public:
25 static TSharedRef<IPropertyTypeCustomization> MakeInstance() { return MakeShared<Self>(); }
26
36 void CustomizeHeader(TSharedRef<IPropertyHandle> StructPropertyHandle,
37 FDetailWidgetRow& HeaderRow,
38 IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
39
47 void CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle,
48 IDetailChildrenBuilder& StructBuilder,
49 IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
50
51private:
52 // Called every time the event type is changed
53 void OnEventTypeChanged(bool bForceRefresh);
54
55 // Getters for the visibility of some properties
56 EVisibility GetEventNameVisibility() const
57 {
59 ? EVisibility::Visible : EVisibility::Hidden;
60 }
61
62 EVisibility GetIntValueVisibility() const
63 {
66 ? EVisibility::Visible : EVisibility::Hidden;
67 }
68
69 EVisibility GetFloatValueVisibility() const
70 {
73 ? EVisibility::Visible : EVisibility::Hidden;
74 }
75
76 EVisibility GetNameValueVisibility() const
77 {
80 ? EVisibility::Visible : EVisibility::Hidden;
81 }
82
83 EVisibility GetBoolDeltaVisibility() const
84 {
89 ? EVisibility::Visible : EVisibility::Hidden;
90 }
91
92 EVisibility GetBoolValueVisibility() const
93 {
96 ? EVisibility::Visible : EVisibility::Hidden;
97 }
98
99 EVisibility GetCustomEventVisibility() const
100 {
101 return EventType == EDlgEventType::Custom ? EVisibility::Visible : EVisibility::Hidden;
102 }
103
104 // Gets all the event name suggestions depending on EventType from all Dialogues.
105 TArray<FName> GetAllDialoguesEventNames() const;
106
107 // Gets all the event name suggestions depending on EventType from the current Dialogue
108 TArray<FName> GetCurrentDialogueEventNames() const;
109
110 // Gets the ParticipantNames from all Dialogues.
112 {
113 TArray<FName> OutArray;
115 return OutArray;
116 }
117
118 // Gets the current Dialogue Participant Names.
123
124 // Handler for when text in the editable text box changed
125 void HandleTextCommitted(const FText& InSearchText, ETextCommit::Type CommitInfo) const
126 {
127 if (Dialogue)
128 {
130 }
131 }
132
133private:
134 // The current Event type of the struct.
136
137 // Cache the some property handles
138 TSharedPtr<IPropertyHandle> StructPropertyHandle;
139 TSharedPtr<IPropertyHandle> ParticipantNamePropertyHandle;
140
141 // Cache the properties
142 TSharedPtr<IPropertyHandle> EventTypePropertyHandle;
143
144 // just some nice utilities
145 TSharedPtr<IPropertyUtilities> PropertyUtils;
146
147 // Cache the rows of the properties, created in CustomizeChildren
148 TSharedPtr<FDialogueTextPropertyPickList_CustomRowHelper> ParticipantNamePropertyRow;
149 TSharedPtr<FDialogueTextPropertyPickList_CustomRowHelper> EventNamePropertyRow;
150 IDetailPropertyRow* IntValuePropertyRow = nullptr;
151 IDetailPropertyRow* FloatValuePropertyRow = nullptr;
152 IDetailPropertyRow* NameValuePropertyRow = nullptr;
153 IDetailPropertyRow* BoolDeltaPropertyRow = nullptr;
154 IDetailPropertyRow* BoolValuePropertyRow = nullptr;
155
156 IDetailPropertyRow* CustomEventPropertyRow = nullptr;
157 TSharedPtr<FDialogueObject_CustomRowHelper> CustomEventPropertyRow_CustomDisplay;
158
159 IDetailPropertyRow* EventTypePropertyRow = nullptr;
160 TSharedPtr<FDialogueEnumTypeWithObject_CustomRowHelper> EventTypePropertyRow_CustomDisplay;
161
162 // Hold a reference to dialogue we are displaying.
164};
EDlgEventType
UENUM(BlueprintType)
Definition DlgEvent.h:16
@ ModifyClassFloatVariable
TSharedPtr< FDialogueEnumTypeWithObject_CustomRowHelper > EventTypePropertyRow_CustomDisplay
EVisibility GetBoolDeltaVisibility() const
void HandleTextCommitted(const FText &InSearchText, ETextCommit::Type CommitInfo) const
TArray< FName > GetAllDialoguesParticipantNames() const
void CustomizeHeader(TSharedRef< IPropertyHandle > StructPropertyHandle, FDetailWidgetRow &HeaderRow, IPropertyTypeCustomizationUtils &StructCustomizationUtils) override
static TSharedRef< IPropertyTypeCustomization > MakeInstance()
IDetailPropertyRow * IntValuePropertyRow
EVisibility GetCustomEventVisibility() const
TArray< FName > GetCurrentDialogueParticipantNames() const
TSharedPtr< IPropertyHandle > EventTypePropertyHandle
TArray< FName > GetAllDialoguesEventNames() const
EVisibility GetBoolValueVisibility() const
void CustomizeChildren(TSharedRef< IPropertyHandle > StructPropertyHandle, IDetailChildrenBuilder &StructBuilder, IPropertyTypeCustomizationUtils &StructCustomizationUtils) override
EVisibility GetNameValueVisibility() const
EVisibility GetIntValueVisibility() const
void OnEventTypeChanged(bool bForceRefresh)
IDetailPropertyRow * BoolDeltaPropertyRow
TArray< FName > GetCurrentDialogueEventNames() const
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > ParticipantNamePropertyRow
IDetailPropertyRow * BoolValuePropertyRow
TSharedPtr< IPropertyHandle > StructPropertyHandle
IDetailPropertyRow * NameValuePropertyRow
EVisibility GetEventNameVisibility() const
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > EventNamePropertyRow
TSharedPtr< FDialogueObject_CustomRowHelper > CustomEventPropertyRow_CustomDisplay
IDetailPropertyRow * EventTypePropertyRow
IDetailPropertyRow * CustomEventPropertyRow
IDetailPropertyRow * FloatValuePropertyRow
TSharedPtr< IPropertyHandle > ParticipantNamePropertyHandle
EVisibility GetFloatValueVisibility() const
TSharedPtr< IPropertyUtilities > PropertyUtils
FDialogueEvent_Details Self
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
Definition DlgDialogue.h:85
void UpdateAndRefreshData(bool bUpdateTextsNamespacesAndKeys=false)
static void GetAllDialoguesParticipantNames(TArray< FName > &OutArray)
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
static TArray< FName > GetDialogueSortedParticipantNames(UDlgDialogue *Dialogue)