4#include "IDetailPropertyRow.h"
5#include "IDetailChildrenBuilder.h"
12#include "IPropertyUtilities.h"
19#define LOCTEXT_NAMESPACE "DialogueCondition_Details"
25 FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
29 PropertyUtils = StructCustomizationUtils.GetPropertyUtilities();
48 if (!bShowOnlyInnerProperties)
50 HeaderRow.NameContent()
58 TSharedRef<IPropertyHandle> InStructPropertyHandle,
59 IDetailChildrenBuilder& StructBuilder,
60 IPropertyTypeCustomizationUtils& StructCustomizationUtils
63 const bool bHasDialogue =
Dialogue !=
nullptr;
84 FDetailWidgetRow* DetailWidgetRow = &StructBuilder.AddCustomRow(LOCTEXT(
"ParticipantNameSearchKey",
"Participant Name"));
89 .IsEnabled(InStructPropertyHandle->IsEditable())
92 .HasContextCheckbox(bHasDialogue)
93 .IsContextCheckBoxChecked(
true)
102 const TSharedPtr<IPropertyHandle> CallbackNamePropertyHandle =
104 FDetailWidgetRow* DetailWidgetRow = &StructBuilder.AddCustomRow(LOCTEXT(
"CallBackNameSearchKey",
"Variable Name"));
106 CallbackNamePropertyRow = MakeShared<FDialogueTextPropertyPickList_CustomRowHelper>(DetailWidgetRow, CallbackNamePropertyHandle);
109 .IsEnabled(InStructPropertyHandle->IsEditable())
112 .HasContextCheckbox(bHasDialogue)
113 .IsContextCheckBoxChecked(
false)
138 FDetailWidgetRow* DetailWidgetRow = &StructBuilder.AddCustomRow(LOCTEXT(
"ParticipantNameSearchKey",
"Participant Name"));
143 .IsEnabled(InStructPropertyHandle->IsEditable())
146 .HasContextCheckbox(
true)
147 .IsContextCheckBoxChecked(
true)
156 const TSharedPtr<IPropertyHandle> CallbackNamePropertyHandle =
158 FDetailWidgetRow* DetailWidgetRow = &StructBuilder.AddCustomRow(LOCTEXT(
"CallBackNameSearchKey",
"Variable Name"));
163 .IsEnabled(InStructPropertyHandle->IsEditable())
166 .HasContextCheckbox(
true)
167 .IsContextCheckBoxChecked(
false)
177 FDetailWidgetRow* DetailWidgetRow = &StructBuilder.AddCustomRow(LOCTEXT(
"IntValueSearchKey",
"Int Value"));
256 FText CallBackNameDisplayName = LOCTEXT(
"CallBackNameDisplayName",
"Variable Name");
257 FText CallBackNameToolTip = LOCTEXT(
"CallBackNameToolTip",
"The name of the checked variable");
258 FText BoolValueDisplayName = LOCTEXT(
"BoolValueDisplayName",
"Return Value");
259 FText BoolValueToolTip = LOCTEXT(
"BoolValueToolTip",
"SHOULD NOT BE VISIBLE");
261 FText FloatValueToolTip = LOCTEXT(
263 "The float value the VariableName is checked against (depending on the operation).\n"
264 "VariableName <Operation> FloatValue"
266 FText IntValueDisplayName = LOCTEXT(
"IntValueDisplayName",
"Int Value");
267 FText IntValueToolTip = LOCTEXT(
269 "The int value the VariableName is checked against (depending on the operation).\n"
270 "VariableName <Operation> IntValue"
272 FText GUIDDisplayName = LOCTEXT(
"GUIDDisplayName",
"Node GUID");
273 FText GUIDToolTip = LOCTEXT(
275 "The Corresponding GUID of the Node Index. (Set On Compile)"
282 CallBackNameDisplayName = LOCTEXT(
"ConditionEvent_CallBackNameDisplayName",
"Condition Name");
283 CallBackNameToolTip = LOCTEXT(
"ConditionEvent_CallBackNameToolTip",
"Name parameter of the event call the participant gets");
284 BoolValueToolTip = LOCTEXT(
"ConditionEvent_BoolValueToolTip",
"Does the return result of the Event/Condition has this boolean value?");
289 BoolValueToolTip = LOCTEXT(
"ConditionBool_BoolValueToolTip",
"Whether the bool check is expected to be true or false in order to satisfy the condition");
294 BoolValueToolTip = LOCTEXT(
"ConditionBool_BoolValueToolTip",
"Whether the two Name is expected to be equal or not in order to satisfy the condition");
295 BoolValueDisplayName = LOCTEXT(
"BoolValueDisplayName",
"Succeed on Equal");
312 IntValueDisplayName = LOCTEXT(
"ConditionNodeVisited_IntValueDisplayName",
"Node Index");
313 IntValueToolTip = LOCTEXT(
"ConditionNodeVisited_IntValueToolTip",
"Node index of the node we want to check the visited status");
314 BoolValueDisplayName = LOCTEXT(
"ConditionNodeVisited_BoolValueDisplayName",
"Is Node Visited?");
315 BoolValueToolTip = LOCTEXT(
"ConditionNodeVisited_BoolValueToolTip",
"Should the node be visited? True/False.");
324 IntValueDisplayName = LOCTEXT(
"ConditionHasSatisfiedChild_IntValueDisplayName",
"Node Index");
325 IntValueToolTip = LOCTEXT(
"ConditionHasSatisfiedChild_IntValueToolTip",
"Node index of the node we want to check");
326 BoolValueDisplayName = LOCTEXT(
"ConditionHasSatisfiedChild_BoolValueDisplayName",
"Has?");
327 BoolValueToolTip = LOCTEXT(
"ConditionHasSatisfiedChild_BoolValueToolTip",
"Should the node have satisfied child(ren)?");
338 .SetToolTip(CallBackNameToolTip)
378 TArray<FName> Suggestions;
379 TSet<FName> SuggestionSet;
383 bool bReflectionBased =
false;
404 FNYBoolProperty::StaticClass(),
406 GetDefault<UDlgSystemSettings>()->BlacklistedReflectionClasses
414 Suggestions = SuggestionSet.Array();
429 FNYFloatProperty::StaticClass(),
431 GetDefault<UDlgSystemSettings>()->BlacklistedReflectionClasses
453 FNYIntProperty::StaticClass(),
455 GetDefault<UDlgSystemSettings>()->BlacklistedReflectionClasses
477 FNYNameProperty::StaticClass(),
479 GetDefault<UDlgSystemSettings>()->BlacklistedReflectionClasses
509 if (SuggestionSet.Num() > Suggestions.Num())
511 Suggestions = SuggestionSet.Array();
519#undef LOCTEXT_NAMESPACE
static const TCHAR * META_ShowOnlyInnerProperties
#define CREATE_VISIBILITY_CALLBACK(_SelfMethod)
EDlgConditionType
UENUM(BlueprintType)
EDlgCompare
UENUM(BlueprintType)
IDetailPropertyRow * BoolValuePropertyRow
EVisibility GetNameValueVisibility() const
EVisibility GetOperationVisibility() const
EVisibility GetParticipantNameVisibility() const
EVisibility GetCallbackNameVisibility() const
void OnConditionTypeChanged(bool bForceRefresh)
TArray< FName > GetCurrentDialogueCallbackNames() const
TSharedPtr< IPropertyHandle > ConditionTypePropertyHandle
EVisibility GetFloatValueVisibility() const
TSharedPtr< FDialogueEnumTypeWithObject_CustomRowHelper > ConditionTypePropertyRow_CustomDisplay
EVisibility GetGUIDVisibility() const
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > CallbackNamePropertyRow
TArray< FName > GetAllDialoguesOtherVariableNames() const
TSharedPtr< IPropertyUtilities > PropertyUtils
void HandleTextCommitted(const FText &InSearchText, ETextCommit::Type CommitInfo) const
EVisibility GetBoolValueVisibility() const
TSharedPtr< IPropertyHandle > StructPropertyHandle
TSharedPtr< IPropertyHandle > IntValuePropertyHandle
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > OtherVariableNamePropertyRow
IDetailPropertyRow * NameValuePropertyRow
EDlgConditionType ConditionType
TSharedPtr< FDialogueTextPropertyPickList_CustomRowHelper > ParticipantNamePropertyRow
void CustomizeChildren(TSharedRef< IPropertyHandle > StructPropertyHandle, IDetailChildrenBuilder &StructBuilder, IPropertyTypeCustomizationUtils &StructCustomizationUtils) override
TArray< FName > GetAllDialoguesCallbackNames() const
EVisibility GetOtherParticipantNameAndVariableVisibility() const
EVisibility GetCompareTypeVisibility() const
IDetailPropertyRow * OperationPropertyRow
IDetailPropertyRow * ConditionTypePropertyRow
IDetailPropertyRow * LongTermMemoryPropertyRow
IDetailPropertyRow * FloatValuePropertyRow
EVisibility GetLongTermMemoryVisibility() const
IDetailPropertyRow * GUIDPropertyRow
TSharedPtr< IPropertyHandle > CompareTypePropertyHandle
IDetailPropertyRow * CompareTypePropertyRow
TSharedPtr< FDialogueIntTextBox_CustomRowHelper > IntValuePropertyRow
EVisibility GetCustomConditionVisibility() const
void CustomizeHeader(TSharedRef< IPropertyHandle > StructPropertyHandle, FDetailWidgetRow &HeaderRow, IPropertyTypeCustomizationUtils &StructCustomizationUtils) override
TArray< FName > GetCallbackNamesForParticipant(bool bCurrentOnly, bool bOtherValue) const
TArray< FName > GetAllDialoguesParticipantNames() const
void OnCompareTypeChanged(bool bForceRefresh)
IDetailPropertyRow * CustomConditionPropertyRow
TSharedPtr< IPropertyHandle > OtherParticipantNamePropertyHandle
TSharedPtr< IPropertyHandle > ParticipantNamePropertyHandle
TArray< FName > GetCurrentDialogueParticipantNames() const
TSharedPtr< FDialogueObject_CustomRowHelper > CustomConditionPropertyRow_CustomDisplay
TArray< FName > GetCurrentDialogueOtherVariableNames() const
EVisibility GetIntValueVisibility() const
static void SortDefault(TArray< FName > &OutArray)
static void GetVariableNames(const UClass *ParticipantClass, const FNYPropertyClass *PropertyClass, ContainerType &OutContainer, const TArray< UClass * > &BlacklistedClasses)
UCLASS(Blueprintable, BlueprintType, Abstract, EditInlineNew)
const TArray< UDlgNode * > & GetNodes() 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.
void GetBoolNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
void GetNameNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, 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")
void GetIntNames(FName ParticipantName, TSet< FName > &OutSet) const
UFUNCTION(BlueprintPure, Category = "Dialogue")
static void GetAllDialoguesNameNames(FName ParticipantName, TArray< FName > &OutArray)
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
static void GetAllDialoguesBoolNames(FName ParticipantName, TArray< FName > &OutArray)
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
static void GetAllDialoguesIntNames(FName ParticipantName, TArray< FName > &OutArray)
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
static void GetAllDialoguesConditionNames(FName ParticipantName, TArray< FName > &OutArray)
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
static void GetAllDialoguesFloatNames(FName ParticipantName, TArray< FName > &OutArray)
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
static FName GetParticipantNameFromPropertyHandle(const TSharedRef< IPropertyHandle > &ParticipantNamePropertyHandle)
static UDlgDialogue * GetDialogueFromPropertyHandle(const TSharedRef< IPropertyHandle > &PropertyHandle)
static void ResetNumericPropertyLimits(const TSharedPtr< IPropertyHandle > &PropertyHandle)