A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DialogueTextArgument_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
7#include "DlgTextArgument.h"
9#include "DlgManager.h"
10
12class IDetailPropertyRow;
14
20{
22
23public:
24 static TSharedRef<IPropertyTypeCustomization> MakeInstance() { return MakeShared<Self>(); }
25
35 void CustomizeHeader(TSharedRef<IPropertyHandle> StructPropertyHandle,
36 FDetailWidgetRow& HeaderRow,
37 IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
38
46 void CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle,
47 IDetailChildrenBuilder& StructBuilder,
48 IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
49
50private:
51 // Called every time the event type is changed
52 void OnArgumentTypeChanged(bool bForceRefresh);
53
54 // Getters for the visibility of some properties
55 EVisibility GetVariableNameVisibility() const
56 {
60 ? EVisibility::Visible : EVisibility::Hidden;
61 }
63 {
64 return ArgumentType == EDlgTextArgumentType::Custom ? EVisibility::Visible : EVisibility::Hidden;
65 }
66
68 TArray<FName> GetAllDialoguesVariableNames() const
69 {
70 return GetDialogueVariableNames(false);
71 }
72
74 TArray<FName> GetCurrentDialogueVariableNames() const
75 {
76 return GetDialogueVariableNames(true);
77 }
78
79 TArray<FName> GetDialogueVariableNames(bool bCurrentOnly) const;
80
81
83 TArray<FName> GetAllDialoguesParticipantNames() const
84 {
85 TArray<FName> OutArray;
87 return OutArray;
88 }
89
95
97 void HandleTextCommitted(const FText& InSearchText, ETextCommit::Type CommitInfo) const
98 {
99 if (Dialogue)
100 {
102 }
103 }
104
105private:
106 // The current Event type of the struct.
108
109 // Cache the some property handles
110 TSharedPtr<IPropertyHandle> StructPropertyHandle;
111 TSharedPtr<IPropertyHandle> ParticipantNamePropertyHandle;
112
113 // Cache the properties
114 TSharedPtr<IPropertyHandle> ArgumentTypePropertyHandle;
115
116 // just some nice utilities
117 TSharedPtr<IPropertyUtilities> PropertyUtils;
118
119 // Cache the rows of the properties, created in CustomizeChildren
120 TSharedPtr<FDialogueTextPropertyPickList_CustomRowHelper> ParticipantNamePropertyRow;
121 TSharedPtr<FDialogueTextPropertyPickList_CustomRowHelper> VariableNamePropertyRow;
122
123 IDetailPropertyRow* CustomTextArgumentPropertyRow = nullptr;
124 TSharedPtr<FDialogueObject_CustomRowHelper> CustomTextArgumentPropertyRow_CustomDisplay;
125
128};
EDlgTextArgumentType
UENUM(BlueprintType)
TSharedPtr< IPropertyHandle > ParticipantNamePropertyHandle
TSharedPtr< FDialogueObject_CustomRowHelper > CustomTextArgumentPropertyRow_CustomDisplay
void HandleTextCommitted(const FText &InSearchText, ETextCommit::Type CommitInfo) const
TArray< FName > GetCurrentDialogueVariableNames() const
TArray< FName > GetCurrentDialogueParticipantNames() const
TArray< FName > GetDialogueVariableNames(bool bCurrentOnly) const
TArray< FName > GetAllDialoguesParticipantNames() const
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > VariableNamePropertyRow
TSharedPtr< IPropertyUtilities > PropertyUtils
static TSharedRef< IPropertyTypeCustomization > MakeInstance()
void CustomizeChildren(TSharedRef< IPropertyHandle > StructPropertyHandle, IDetailChildrenBuilder &StructBuilder, IPropertyTypeCustomizationUtils &StructCustomizationUtils) override
void CustomizeHeader(TSharedRef< IPropertyHandle > StructPropertyHandle, FDetailWidgetRow &HeaderRow, IPropertyTypeCustomizationUtils &StructCustomizationUtils) override
TSharedPtr< IPropertyHandle > ArgumentTypePropertyHandle
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > ParticipantNamePropertyRow
TSharedPtr< IPropertyHandle > StructPropertyHandle
TArray< FName > GetAllDialoguesVariableNames() const
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)