diff --git a/Source/ComboInput/Private/ComboActionGraph.cpp b/Source/ComboInput/Private/ComboActionGraph.cpp index c55f37d..8776d6a 100644 --- a/Source/ComboInput/Private/ComboActionGraph.cpp +++ b/Source/ComboInput/Private/ComboActionGraph.cpp @@ -26,109 +26,34 @@ UComboActionGraph::UComboActionGraph() #endif } -TArray UComboActionGraph::GetGraphDecorators() const -{ - TArray TempReturn; - TArray Return; - - for (const FComboActionDecorator &Itr : this->GraphDecorators) - { - if (Itr.DecoratorType != nullptr) - { - TempReturn.AddUnique(Itr); - } - } - - /* TODO: Cleanup duplicates - for (auto Itr : TempReturn) - { - - } - */ - - Return = TempReturn; - return Return; -} - -TArray UComboActionGraph::GetAllDecorators() const -{ - TArray TempReturn; - TArray Return; - - for (const UComboActionGraphNode *Itr : this->AllNodes) - { - if (Itr && Itr->GetNodeDecorators().Num() > 0) - { - TempReturn.Append(Itr->NodeDecorators); - } - } - - TempReturn.Append(this->GetGraphDecorators()); - - return TempReturn; -} - bool UComboActionGraph::CanStartDialogueGraph() const { - bool bSatisfied = true; - if (this->AllNodes.Num() == 0) { return false; } - for (const auto& Itr : this->AllNodes) + for (const UComboActionGraphNode *Itr : this->AllNodes) { - if (!Itr) - { - return false; - } - - if (Itr->ValidateNodeRuntime() == false) + if (!Itr || !Itr->ValidateNodeRuntime()) { return false; } } - const TArray &Decorators = this->GetAllDecorators(); - - if (Decorators.Num() == 0) - { - return bSatisfied; - } - - TArray DecoratorValidations; - for (const FComboActionDecorator &Itr : Decorators) - { - if (Itr.ValidateDecorator(DecoratorValidations) == false) bSatisfied = false; - } - - if (DecoratorValidations.Num() > 0) - { - for(auto Itr : DecoratorValidations) - { - UE_LOG(LogComboActionGraph, Error, TEXT("%s"), *Itr.ToString()); - } - } - return bSatisfied; + return true; } void UComboActionGraph::CreateGraph() { #if WITH_EDITOR - // We already have existing Graph - if (this->EdGraph != nullptr) + // We already have an existing graph or start node + if (this->EdGraph != nullptr || this->StartNode != nullptr) { return; } - // We already have existing Start Node - if (this->StartNode != nullptr) - { - return; - } - - this->StartNode = ConstructDialogueNode(); + this->StartNode = this->ConstructActionNode(); if (this->StartNode != nullptr ) { this->StartNode->Graph = this; @@ -168,115 +93,10 @@ void UComboActionGraph::PostInitProperties() } #if WITH_EDITOR -bool UComboActionGraph::ValidateGraph(TArray& ValidationErrors, bool RichTextFormat) +bool UComboActionGraph::ValidateGraph(TArray &ValidationErrors, bool RichTextFormat) { bool bReturnValue = true; - // GRAPH DECORATORS VALIDATION - { - TArray UsedNodeDecorators; - for (int i = 0; i < this->GraphDecorators.Num(); i++) - { - const FComboActionDecorator &Decorator = this->GraphDecorators[i]; - if (Decorator.DecoratorType) - { - UsedNodeDecorators.Add(Decorator.DecoratorType); - } - else - { - const FString RichTextReturn = - FString("* ") - .Append( TEXT("Dialogue Graph")) - .Append(": has ") - .Append(TEXT("invalid Node Decorator at Index: ")) - .Append(FString::FromInt(i)) - .Append("."); - - const FString TextReturn = - this->GetName() - .Append(": has ") - .Append(TEXT("INVALID Node Decorator at Index: ")) - .Append(FString::FromInt(i)) - .Append("."); - - ValidationErrors.Add(FText::FromString(RichTextFormat ? RichTextReturn : TextReturn)); - - bReturnValue = false; - } - } - - TMap DuplicatedDecoratorsMap; - for (const auto& Itr : UsedNodeDecorators) - { - int32 ClassAppearance = 1; - for (const auto& Itr2 : UsedNodeDecorators) - { - if (Itr != Itr2 && Itr->GetClass() == Itr2->GetClass()) - { - auto A = Itr->GetClass()->GetName(); - ClassAppearance++; - } - } - - if (ClassAppearance > 1 && DuplicatedDecoratorsMap.Contains(Itr->GetClass()) == false) - { - DuplicatedDecoratorsMap.Add(Itr->GetClass(), ClassAppearance); - } - } - - if (DuplicatedDecoratorsMap.Num() > 0) - { - for (const TTuple &Itr : DuplicatedDecoratorsMap) - { - bReturnValue = false; - - const FString RichTextReturn = - FString("* ") - .Append(TEXT("Dialogue Graph")) - .Append(": has Node Decorator ") - .Append("") - .Append(Itr.Key->GetName().LeftChop(2)) - .Append(" ") - .Append(FString::FromInt(Itr.Value)) - .Append("x times! Please, avoid duplicates!"); - - const FString TextReturn = - FString(TEXT("Dialogue Graph: has Node Decorator ")) - .Append( Itr.Key->GetName().LeftChop(2)) - .Append(" ") - .Append(FString::FromInt(Itr.Value)) - .Append("x times! Please, avoid duplicates!"); - - ValidationErrors.Add(FText::FromString(RichTextFormat ? RichTextReturn : TextReturn)); - } - } - } - - // GRAPH DECORATORS VALIDATION - for (const FComboActionDecorator &Itr : this->GraphDecorators) - { - TArray DecoratorErrors; - if (!Itr.ValidateDecorator(DecoratorErrors)) - { - for (auto Error : DecoratorErrors) - { - const FString ErrorTextRich = - FString("* ") - .Append(TEXT("Dialogue Graph: ")) - .Append(FString(Error.ToString())); - - const FString ErrorTextSimple = - this->GetName() - .Append(": ") - .Append(FString(Error.ToString())); - - ValidationErrors.Add(FText::FromString(RichTextFormat ? ErrorTextRich : ErrorTextSimple)); - - bReturnValue = false; - } - } - } - if (this->StartNode == nullptr) { const FString RichTextReturn = diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp index 8dc70cd..0cb3559 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp @@ -3,6 +3,8 @@ #include "Nodes/ComboActionGraphNode.h" #include "ComboActionGraph.h" +#include "ComboInputAssets.h" +#include "ComboInputTriggers.h" #include "Data/ComboActionContext.h" #include "Decorators/ComboActionDecoratorBase.h" @@ -15,28 +17,27 @@ DEFINE_LOG_CATEGORY(LogComboActionGraphNode); UComboActionGraphNode::UComboActionGraphNode() { - NodeGUID = FGuid::NewGuid(); - bInheritGraphDecorators = true; + this->NodeGUID = FGuid::NewGuid(); #if WITH_EDITORONLY_DATA - CompatibleGraphType = UComboActionGraph::StaticClass(); + this->CompatibleGraphType = UComboActionGraph::StaticClass(); - BackgroundColor = FLinearColor::Black; + this->BackgroundColor = FLinearColor::Black; - bAllowInputNodes = true; - bAllowOutputNodes = true; + this->bAllowInputNodes = true; + this->bAllowOutputNodes = true; - bAllowCopy = true; - bAllowCut = true; - bAllowDelete = true; - bAllowPaste = true; - bAllowManualCreate = true; + this->bAllowCopy = true; + this->bAllowCut = true; + this->bAllowDelete = true; + this->bAllowPaste = true; + this->bAllowManualCreate = true; - NodeTypeName = LOCTEXT("ComboActionGraphNode_InternalName", "ComboActionGraphNode"); - NodeTooltipText = LOCTEXT("ComboActionGraphNode_Tooltip", "Combo action graph base node. Child nodes provide more information."); + this->NodeTypeName = LOCTEXT("ComboActionGraphNode_InternalName", "ComboActionGraphNode"); + this->NodeTooltipText = LOCTEXT("ComboActionGraphNode_Tooltip", "Combo action graph base node. Child nodes provide more information."); #endif - bAutoStarts = false; + this->bAutoStarts = false; } void UComboActionGraphNode::SetNewWorld(UWorld *NewWorld) @@ -83,63 +84,6 @@ void UComboActionGraphNode::ProcessNode(const TScriptInterfaceGetDialogueNodeStartedEventHandle().Broadcast(Context); } -TArray UComboActionGraphNode::GetNodeDecorators() const -{ - TArray TempReturn; - TArray Return; - - for (auto Itr : NodeDecorators) - { - if (Itr.DecoratorType != nullptr) - { - TempReturn.AddUnique(Itr); - } - } - - /* TODO: Cleanup duplicates - for (auto Itr : TempReturn) - { - - } - */ - - Return = TempReturn; - return Return; -} - -bool UComboActionGraphNode::CanStartNode() const -{ - return this->EvaluateDecorators(); -} - -bool UComboActionGraphNode::EvaluateDecorators() const -{ - if (this->GetGraph() == nullptr) - { - UE_LOG(LogComboActionGraphNode, Error, TEXT("[EvaluateDecorators] Graph is null (invalid)!")) - return false; - } - - bool bSatisfied = true; - TArray AllDecorators; - if (this->bInheritGraphDecorators) - { - // Add those Decorators rather than asking Graph to evaluate, because Nodes might introduce specific context - AllDecorators.Append(GetGraph()->GetGraphDecorators()); - } - - AllDecorators.Append(GetNodeDecorators()); - - if (AllDecorators.Num() == 0) return bSatisfied; - - for (auto Itr : AllDecorators) - { - if (Itr.EvaluateDecorator() == false) bSatisfied = false; - } - - return bSatisfied; -} - void UComboActionGraphNode::SetNodeIndex(const int32 NewIndex) { check(NewIndex>INDEX_NONE); @@ -213,6 +157,7 @@ bool UComboActionGraphNode::CanCreateConnection(UComboActionGraphNode *Other, en bool UComboActionGraphNode::ValidateNode(TArray &ValidationsMessages, const bool RichFormat) { bool bResult = true; + if (this->ParentNodes.Num() == 0 && this->ChildrenNodes.Num() == 0) { bResult = false; @@ -240,155 +185,32 @@ bool UComboActionGraphNode::ValidateNode(TArray &ValidationsMessages, con .Append("") .Append(this->NodeTitle.ToString()) .Append("") - .Append(": This Node requires Inputs, however, none are found!"); + .Append(": This node requires inputs, however none are found!"); const FString TextReturn = FString(this->NodeTitle.ToString()) - .Append(": This Node requires Inputs, however, none are found!"); + .Append(": This node requires inputs, however none are found!"); ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); } - - // DECORATORS VALIDATION - { - TArray UsedNodeDecorators; - for (int i = 0; i < this->NodeDecorators.Num(); i++) - { - if (this->NodeDecorators.IsValidIndex(i) && this->NodeDecorators[i].DecoratorType && !UsedNodeDecorators.Contains(this->NodeDecorators[i].DecoratorType)) - { - UsedNodeDecorators.Add(NodeDecorators[i].DecoratorType); - } - else - { - const FString RichTextReturn = - FString("* ") - .Append( TEXT("")) - .Append(GetNodeTitle().ToString()) - .Append(TEXT("")) - .Append(": has ") - .Append(TEXT("invalid Node Decorator at Index: ")) - .Append(FString::FromInt(i)) - .Append("."); - - FString TextReturn = FString(GetNodeTitle().ToString()) - .Append(": has ") - .Append(TEXT("INVALID Node Decorator at Index: ")) - .Append(FString::FromInt(i)) - .Append("."); - - ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - - bResult = false; - } - } - - TMap DuplicatedDecoratorsMap; - for (const UComboActionDecoratorBase *Itr : UsedNodeDecorators) - { - int32 ClassAppearance = 1; - for (const UComboActionDecoratorBase *Itr2 : UsedNodeDecorators) - { - if (Itr != Itr2 && Itr->GetClass() == Itr2->GetClass()) - { - auto A = Itr->GetClass()->GetName(); - ClassAppearance++; - } - } - - if (ClassAppearance > 1 && DuplicatedDecoratorsMap.Contains(Itr->GetClass()) == false) - { - DuplicatedDecoratorsMap.Add(Itr->GetClass(), ClassAppearance); - } - } - - if (DuplicatedDecoratorsMap.Num() > 0) - { - for (const TTuple &Itr : DuplicatedDecoratorsMap) - { - bResult = false; - - const FString RichTextReturn = - FString("* ") - .Append("") - .Append(this->NodeTitle.ToString()) - .Append("") - .Append(": has Node Decorator ") - .Append("") - .Append(Itr.Key->GetName().LeftChop(2)) - .Append(" ") - .Append(FString::FromInt(Itr.Value)) - .Append("x times! Please, avoid duplicates!"); - - const FString TextReturn = - FString(this->NodeTitle.ToString()) - .Append(this->NodeTitle.ToString()) - .Append(": has Node Decorator ") - .Append(Itr.Key->GetName().LeftChop(2)) - .Append(" ") - .Append(FString::FromInt(Itr.Value)) - .Append("x times! Please, avoid duplicates!"); - - ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - } - } - - for (const FComboActionDecorator &Itr : this->GetNodeDecorators()) - { - TArray DecoratorErrors; - if (!Itr.ValidateDecorator(DecoratorErrors)) - { - for (auto Error : DecoratorErrors) - { - const FString ErrorTextRich = - FString("* ") - .Append("") - .Append(this->NodeTitle.ToString()) - .Append(": ") - .Append(FString(Error.ToString())); - - const FString ErrorTextSimple = - FString(this->GetClass()->GetDisplayNameText().ToString()) - .Append(": ") - .Append(FString(Error.ToString())); - - ValidationsMessages.Add(FText::FromString(RichFormat ? ErrorTextRich : ErrorTextSimple)); - - bResult = false; - } - } - } - } return bResult; } void UComboActionGraphNode::OnPasted() { - NodeGUID = FGuid::NewGuid(); + this->NodeGUID = FGuid::NewGuid(); - ParentNodes.Empty(); - ChildrenNodes.Empty(); - Edges.Empty(); + this->ParentNodes.Empty(); + this->ChildrenNodes.Empty(); + this->Edges.Empty(); } FText UComboActionGraphNode::GetDefaultTooltipBody() const { - const FText InheritsValue = this->bInheritGraphDecorators ? LOCTEXT("True","Yes") : LOCTEXT("False","No"); - const FText Inherits = FText::Format(LOCTEXT("UComboActionGraphNode_InheritsTooltip", "Inherits Graph Decorators: {0}"), InheritsValue); - - FText ImplementsNumber; - if (this->NodeDecorators.Num() == 0) - { - ImplementsNumber = LOCTEXT("None", "-"); - } - else - { - ImplementsNumber = FText::FromString(FString::FromInt(this->NodeDecorators.Num())); - } - - const FText Implements = FText::Format(LOCTEXT("UComboActionGraphNode_ImplementsTooltip", "Implements Decorators: {0}"), ImplementsNumber); - - return FText::Format(LOCTEXT("UComboActionGraphNode_BaseTooltip", "{0}\n\n{1}\n{2}"), this->NodeTypeName, Inherits, Implements); + //const FText Inherits = FText::Format(LOCTEXT("UComboActionGraphNode_InheritsTooltip", "Inherits Graph Decorators: {0}"), InheritsValue); + //const FText Implements = FText::Format(LOCTEXT("UComboActionGraphNode_ImplementsTooltip", "Implements Decorators: {0}"), ImplementsNumber); + return FText::Format(LOCTEXT("UComboActionGraphNode_BaseTooltip", "{0}\n\n{1}\n{2}"), this->NodeTypeName, this->NodeTypeName, this->NodeTypeName); } #endif diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp index ef30909..97d47bf 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp @@ -25,25 +25,12 @@ UComboActionGraphNode_ActionNode::UComboActionGraphNode_ActionNode() this->AllowedInputClasses.Add(UComboActionGraphNode_ActionNode::StaticClass()); this->bAutoStarts = false; - this->bUseGameplayTags = false; this->MaxChildrenNodes = 1; } void UComboActionGraphNode_ActionNode::PreProcessNode(const TScriptInterface &Manager) { - if (!bUseGameplayTags) - { - // Switch Active Participant to Player - if (Manager.GetInterface()) - { - //if (const auto TempContext = Manager->GetDialogueContext()) - //{ - // TempContext->UpdateActiveDialogueParticipant(TempContext->GetDialoguePlayerParticipant()); - //} - } - } - Super::PreProcessNode(Manager); } diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp index 3e34182..2923e76 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp @@ -1,10 +1,7 @@ // ©2023 Batty Bovine Productions, LLC. All Rights Reserved. - #include "Nodes/ComboActionGraphNode_ActionNodeBase.h" -//#include "Helpers/ComboActionSystemBFC.h" - #define LOCTEXT_NAMESPACE "ComboActionGraphNode_ActionNodeBase" @@ -20,86 +17,34 @@ UComboActionGraphNode_ActionNodeBase::UComboActionGraphNode_ActionNodeBase() #endif this->bAutoStarts = false; - this->bUseGameplayTags = true; } void UComboActionGraphNode_ActionNodeBase::ProcessNode(const TScriptInterface &Manager) { - if (Manager) - { - //if (UComboActionContext *Context = Manager->GetDialogueContext()) - //{ - // this->GetWorld()->GetTimerManager().ClearTimer(Manager->GetDialogueRowTimerHandle()); - - // const FDialogueRow DialogueRow = UComboActionSystemBFC::GetDialogueRow(Context->ActiveNode); - // if (UComboActionSystemBFC::IsDialogueRowValid(DialogueRow) && DialogueRow.DialogueRowData.Array().IsValidIndex(Context->GetActiveDialogueRowDataIndex())) - // { - // Context->UpdateActiveDialogueRow(DialogueRow); - // Context->UpdateActiveDialogueRowDataIndex(Context->ActiveDialogueRowDataIndex); - // Manager->GetDialogueContextUpdatedEventHande().Broadcast(Context); - // } - //} - } - Super::ProcessNode(Manager); } void UComboActionGraphNode_ActionNodeBase::PreProcessNode(const TScriptInterface &Manager) { - if (this->bUseGameplayTags) - { - // Switch Participants based on Tags - if (Manager.GetInterface()) - { - //if (const auto TempContext = Manager->GetDialogueContext()) - //{ - // const TScriptInterface BestMatchingParticipant = UComboActionSystemBFC::FindBestMatchingParticipant(Manager.GetObject(), TempContext); - // - // TempContext->UpdateActiveDialogueParticipant(BestMatchingParticipant); - //} - } - } - Super::PreProcessNode(Manager); } -UDataTable *UComboActionGraphNode_ActionNodeBase::GetDataTable() const -{ - return this->DataTable; -} - bool UComboActionGraphNode_ActionNodeBase::ValidateNodeRuntime_Implementation() const { - if (this->DataTable == nullptr) + if (!this->ComboInput) { return false; } - //if (this->RowName.IsNone()) - //{ - // return false; - //} + if (this->TriggerEvent == EComboActionTriggerEvent::None) + { + return false; + } if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes) { return false; } - - //const FString Context; - //const FDialogueRow *SelectedRow = DataTable->FindRow(RowName, Context); - - //if (SelectedRow == nullptr) - //{ - // return false; - //} - - //if (SelectedRow) - //{ - // if (SelectedRow->DialogueRowData.Num() == 0) - // { - // return false; - // } - //} return true; } @@ -110,41 +55,41 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray &Validatio { bool bResult = Super::ValidateNode(ValidationsMessages, RichFormat); - //if (DataTable == nullptr) - //{ - // bResult = false; + if (!this->ComboInput) + { + bResult = false; - // const FString RichTextReturn = - // FString("* "). - // Append(""). - // Append(NodeTitle.ToString()). - // Append(""). - // Append(": Does not contain any Dialogue Data Table!"); + const FString RichTextReturn = + FString("* "). + Append(""). + Append(NodeTitle.ToString()). + Append(""). + Append(": Does not reference a valid combo input!"); - // const FString TextReturn = - // FString(NodeTitle.ToString()). - // Append(": Does not contain any Dialogue Data Table!"); - // - // ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - //} + const FString TextReturn = + FString(NodeTitle.ToString()). + Append(": Does not reference a valid combo input!"); - //if (this->RowName.IsNone()) - //{ - // bResult = false; + ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); + } - // const FString RichTextReturn = - // FString("* "). - // Append(""). - // Append(NodeTitle.ToString()). - // Append(""). - // Append(": Does not contain valid Dialogue Row!"); + if (this->TriggerEvent == EComboActionTriggerEvent::None) + { + bResult = false; - // const FString TextReturn = - // FString(NodeTitle.ToString()). - // Append(": Does not contain valid Dialogue Row!"); - // - // ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - //} + const FString RichTextReturn = + FString("* "). + Append(""). + Append(NodeTitle.ToString()). + Append(""). + Append(": Does not reference a valid trigger event!"); + + const FString TextReturn = + FString(NodeTitle.ToString()). + Append(": Does not reference a valid trigger event!"); + + ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); + } if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes) { @@ -156,55 +101,13 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray &Validatio .Append("") .Append(FString::FromInt(this->MaxChildrenNodes)) .Append("") - .Append(" Children Nodes!"); + .Append(" child nodes!"); const FString TextReturn = FString(this->NodeTitle.ToString()) - .Append(": Has more than ").Append(FString::FromInt(MaxChildrenNodes)).Append(" Children Nodes!"); + .Append(": Has more than ").Append(FString::FromInt(this->MaxChildrenNodes)).Append(" child nodes!"); ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); } - - //const FString Context; - //const FDialogueRow* SelectedRow = DataTable!=nullptr ? DataTable->FindRow(RowName, Context) : nullptr; - - //if (SelectedRow == nullptr) - //{ - // bResult = false; - - // const FString RichTextReturn = - // FString("* "). - // Append(""). - // Append(NodeTitle.ToString()). - // Append(""). - // Append(": Invalid Selected Row!"); - - // const FString TextReturn = - // FString(NodeTitle.ToString()). - // Append(": Invalid Selected Row!"); - // - // ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - //} - - //if (SelectedRow) - //{ - // if (SelectedRow->DialogueRowData.Num() == 0) - // { - // bResult = false; - - // const FString RichTextReturn = - // FString("* "). - // Append(""). - // Append(NodeTitle.ToString()). - // Append(""). - // Append(": Invalid Selected Row! No Dialogue Data Rows inside!"); - - // const FString TextReturn = - // FString(NodeTitle.ToString()). - // Append(": Invalid Selected Row! No Dialogue Data Rows inside!"); - // - // ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - // } - //} return bResult; } @@ -213,14 +116,13 @@ void UComboActionGraphNode_ActionNodeBase::PostEditChangeProperty(FPropertyChang { Super::PostEditChangeProperty(PropertyChangedEvent); - if (PropertyChangedEvent.GetPropertyName() == GET_MEMBER_NAME_CHECKED(UComboActionGraphNode_ActionNodeBase, DataTable)) + if (PropertyChangedEvent.GetPropertyName() == GET_MEMBER_NAME_CHECKED(UComboActionGraphNode_ActionNodeBase, ComboInput)) { - this->RowName = FName(""); this->Preview.Empty(); this->PreviewsUpdated.ExecuteIfBound(); } - if (PropertyChangedEvent.GetPropertyName() == GET_MEMBER_NAME_CHECKED(UComboActionGraphNode_ActionNodeBase, RowName)) + if (PropertyChangedEvent.GetPropertyName() == GET_MEMBER_NAME_CHECKED(UComboActionGraphNode_ActionNodeBase, TriggerEvent)) { this->UpdatePreviews(); this->PreviewsUpdated.ExecuteIfBound(); @@ -252,18 +154,6 @@ TArray UComboActionGraphNode_ActionNodeBase::GetPreviews() const return ReturnValues; } -void UComboActionGraphNode_ActionNodeBase::UpdatePreviews() -{ - if (!this->DataTable) - { - this->Preview.Empty(); - } - - this->Preview.Empty(); - - this->Preview = this->GetPreviews(); -} - #endif #undef LOCTEXT_NAMESPACE diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp index a1449ae..15564b7 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp @@ -56,23 +56,6 @@ bool UComboActionGraphNode_StartNode::ValidateNode(TArray& ValidationsMes ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); } - if (ChildrenNodes.Num() > 1) - { - bResult = false; - - const FString RichTextReturn = - FString("* ") - .Append("") - .Append(this->NodeTitle.ToString()) - .Append("") - .Append(": Has more than 1 child node."); - - const FString TextReturn = FString(this->NodeTitle.ToString()) - .Append(": Has more than 1 child node."); - - ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); - } - return bResult; } diff --git a/Source/ComboInput/Public/ComboActionGraph.h b/Source/ComboInput/Public/ComboActionGraph.h index 7fba9f7..bb046a2 100644 --- a/Source/ComboInput/Public/ComboActionGraph.h +++ b/Source/ComboInput/Public/ComboActionGraph.h @@ -30,15 +30,6 @@ public: #pragma region Variables protected: - - /** - * The list of decorators for the dialogue graph. - * Decorators are used to add extra functionality or behavior to the nodes in the graph. - * This array should contain an instance of each decorator used in the graph. - * The order of the decorators in this array determines the order in which they will be applied to the nodes. - */ - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Combo Input|Action", NoClear, meta=(NoResetToDefault)) - TArray GraphDecorators; /** * A set of gameplay tags associated with this dialogue graph. */ @@ -109,20 +100,6 @@ public: */ UFUNCTION(BlueprintCallable, Category="Combo Input|Action") UComboActionGraphNode *GetStartNode() const { return this->StartNode; } - /** - * Returns the array of decorators that are associated with this graph. - * - * @return The array of decorators. - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - TArray GetGraphDecorators() const; - /** - * Returns the array of decorators that are associated with this graph and its nodes. - * - * @return The array of decorators. - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - TArray GetAllDecorators() const; /** * Determines whether the dialogue graph can be started. * @@ -160,12 +137,12 @@ public: // Construct and initialize a node within this Dialogue. template - T* ConstructDialogueNode(TSubclassOf DialogueNodeClass = T::StaticClass()) + T* ConstructActionNode(TSubclassOf DialogueNodeClass = T::StaticClass()) { // Set flag to be transactional so it registers with undo system - T *DialogueNode = NewObject(this, DialogueNodeClass, NAME_None, EObjectFlags::RF_Transactional); - DialogueNode->OnCreatedInEditor(); - return DialogueNode; + T *ActionNode = NewObject(this, DialogueNodeClass, NAME_None, EObjectFlags::RF_Transactional); + ActionNode->OnCreatedInEditor(); + return ActionNode; } #endif diff --git a/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h b/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h index 2a9a9a0..ec3d9b9 100644 --- a/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h +++ b/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" + #include "Decorators/ComboActionDecoratorBase.h" #include "ComboActionGraphNode.generated.h" @@ -100,21 +101,6 @@ public: */ UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category="Combo Input|Action") int32 MaxChildrenNodes = -1; - /** - * Indicates whether this node inherits the decorators from its parent Graph. - *❗ If true, the decorators of the parent Graph will be inherited and applied to this node during processing. - *❔ This flag can be used to control the inheritance of decorators for nodes in the dialogue graph. - */ - UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Combo Input|Action") - uint8 bInheritGraphDecorators : 1; - - /** - * A list of Decorators that can help out with enhancing the Dialogue flow. - * Those Decorators are instanced and exist only as "triggers". - * Could be used to start audio, play animation or do some logic behind the curtains, like triggering Cutscene etc. - */ - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Combo Input|Action", NoClear, meta=(NoResetToDefault)) - TArray NodeDecorators; #pragma endregion @@ -140,31 +126,6 @@ public: virtual void PreProcessNode(const TScriptInterface &Manager){} virtual void ProcessNode(const TScriptInterface &Manager); - /** - * Gets the decorators for this Dialogue Graph Node. - *❔ Returns only Valid decorators! - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - TArray GetNodeDecorators() const; - /** - * Returns true if the node can be started. - *❗ The implementation of this function is up to the subclass. - *❔ Can be used to validate if a node can be started before attempting to start it. - *❔ This can be further enhanced by Decorators. - * @return True if the node can be started, false otherwise. - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - virtual bool CanStartNode() const; - virtual bool EvaluateDecorators() const; - /** - * Returns whether this node inherits decorators from the dialogue graph. - * If this is set to true, this node will receive all decorators assigned to the graph. - * If it's set to false, the node will only have its own decorators. - * - * @return Whether this node inherits decorators from the graph. - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - bool DoesInheritDecorators() const { return bInheritGraphDecorators; } /** * Returns how many Children Nodes this Node allows to have. *❔ -1 means no limits. @@ -388,7 +349,7 @@ public: virtual void OnPasted(); // Generates default Tooltip body text used for all Nodes - UFUNCTION(BlueprintPure, BlueprintCallable, Category = "Combo Input|Action", meta=(DevelopmentOnly=true)) + UFUNCTION(BlueprintPure, Category="Combo Input|Action", meta=(DevelopmentOnly=true)) FText GetDefaultTooltipBody() const; virtual void OnCreatedInEditor() {}; diff --git a/Source/ComboInput/Public/Nodes/ComboActionGraphNode_ActionNodeBase.h b/Source/ComboInput/Public/Nodes/ComboActionGraphNode_ActionNodeBase.h index 30828e8..200316a 100644 --- a/Source/ComboInput/Public/Nodes/ComboActionGraphNode_ActionNodeBase.h +++ b/Source/ComboInput/Public/Nodes/ComboActionGraphNode_ActionNodeBase.h @@ -4,8 +4,8 @@ #include "CoreMinimal.h" +#include "ComboInputTriggers.h" #include "Engine/DataTable.h" -//#include "Helpers/ComboActionGraphHelpers.h" #include "Nodes/ComboActionGraphNode.h" #include "UObject/Object.h" @@ -28,15 +28,6 @@ public: virtual void ProcessNode(const TScriptInterface &Manager) override; virtual void PreProcessNode(const TScriptInterface &Manager) override; - /** - * Returns the Dialogue Data Table for this graph node. - * ❗ Might be null - * - * @return The Dialogue Data Table for this graph node. - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - virtual UDataTable *GetDataTable() const; - /** * Returns the Dialogue Data Row name. * ❗ Might be invalid @@ -44,7 +35,10 @@ public: * @return The Dialogue Data Row name. */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - virtual FName GetRowName() const { return RowName; } + class UComboInputAsset *GetComboInput() const { return this->ComboInput; } + + UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Combo Input|Action") + enum EComboActionTriggerEvent GetTriggerEvent() const { return this->TriggerEvent; } virtual bool ValidateNodeRuntime_Implementation() const override; @@ -63,43 +57,18 @@ public: #endif protected: - - /** - * The data table containing the dialogue rows. - * ❗ Strongly suggested to use 'DialogueRow' based Data Tables - */ - UPROPERTY(SaveGame, Category="Combo Input|Action", EditAnywhere, BlueprintReadOnly, meta=(DisplayThumbnail=false, NoResetToDefault)) - UDataTable *DataTable; + /** Name of row in the table that we want */ + UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Combo Input|Action") + TObjectPtr ComboInput; /** Name of row in the table that we want */ - UPROPERTY(SaveGame, Category="Combo Input|Action", EditAnywhere, BlueprintReadOnly, meta=(GetOptions ="GetRowNames", NoResetToDefault, EditCondition="DataTable!=nullptr")) - FName RowName; - - /** - * Flag defining how the Participant is searched for. - * Default: False - * - * If True: - * * Participant will be found by its Gameplay Tag, compared to Dialogue Row Data. - * * ❗Only exact match is considered success - * * ❗ First found is used, so use unique Tags when working with multiple Participants (Player01, Player02, NPC.Andrew etc.) - * - * If False: - * * Participant will be found using Node Type - * * Lead Node will use NPC - * * Answer Node will use Player - * * ❗ This system will be deprecated - * - * ❗ New feature in version 1.0.5.X. - * ❔ Each unique dialogue Participant should be using different Tag, if generic, then use something like `Dialogue.NPC` - */ - UPROPERTY(SaveGame, Category="Combo Input|Action", EditAnywhere, BlueprintReadOnly, meta=(NoResetToDefault)) - uint8 bUseGameplayTags : 1; + UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Combo Input|Action"/*, meta=(EditCondition="ComboInput != nullptr")*/) + EComboActionTriggerEvent TriggerEvent = EComboActionTriggerEvent::Activated; #if WITH_EDITOR - virtual bool ValidateNode(TArray& ValidationsMessages, const bool RichFormat) override; - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; + virtual bool ValidateNode(TArray &ValidationMessages, const bool RichFormat) override; + virtual void PostEditChangeProperty(FPropertyChangedEvent &PropertyChangedEvent) override; virtual FText GetDescription_Implementation() const override; public: @@ -108,19 +77,6 @@ public: #if WITH_EDITORONLY_DATA public: - virtual void UpdatePreviews(); + virtual void UpdatePreviews() { this->Preview = this->GetPreviews(); } #endif - -private: - - UFUNCTION() - TArray GetRowNames() const - { - if (DataTable) - { - return DataTable->GetRowNames(); - } - - return TArray(); - } }; diff --git a/Source/ComboInputEditor/Private/ComboActionGraphSchema.cpp b/Source/ComboInputEditor/Private/ComboActionGraphSchema.cpp index 140bbf3..73d2396 100644 --- a/Source/ComboInputEditor/Private/ComboActionGraphSchema.cpp +++ b/Source/ComboInputEditor/Private/ComboActionGraphSchema.cpp @@ -21,28 +21,28 @@ UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewNode::PerformAction(U { UEdGraphNode *ResultNode = nullptr; - if (NodeTemplate != nullptr) + if (this->NodeTemplate != nullptr) { const FScopedTransaction Transaction(LOCTEXT("ComboActionGraphEditorNewNode", "Combo Action Graph Editor: New Node")); ParentGraph->Modify(); if (FromPin != nullptr) FromPin->Modify(); - NodeTemplate->Rename(nullptr, ParentGraph); - ParentGraph->AddNode(NodeTemplate, true, bSelectNewNode); + this->NodeTemplate->Rename(nullptr, ParentGraph); + ParentGraph->AddNode(this->NodeTemplate, true, bSelectNewNode); - NodeTemplate->CreateNewGuid(); - NodeTemplate->PostPlacedNewNode(); - NodeTemplate->AllocateDefaultPins(); - NodeTemplate->AutowireNewNode(FromPin); + this->NodeTemplate->CreateNewGuid(); + this->NodeTemplate->PostPlacedNewNode(); + this->NodeTemplate->AllocateDefaultPins(); + this->NodeTemplate->AutowireNewNode(FromPin); - NodeTemplate->NodePosX = Location.X; - NodeTemplate->NodePosY = Location.Y; + this->NodeTemplate->NodePosX = Location.X; + this->NodeTemplate->NodePosY = Location.Y; - NodeTemplate->ComboActionGraphNode->SetFlags(EObjectFlags::RF_Transactional); - NodeTemplate->SetFlags(EObjectFlags::RF_Transactional); + this->NodeTemplate->ComboActionGraphNode->SetFlags(EObjectFlags::RF_Transactional); + this->NodeTemplate->SetFlags(EObjectFlags::RF_Transactional); - ResultNode = NodeTemplate; + ResultNode = this->NodeTemplate; } return ResultNode; @@ -51,35 +51,35 @@ UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewNode::PerformAction(U void FAssetSchemaAction_ComboActionGraphSchema_NewNode::AddReferencedObjects(FReferenceCollector &Collector) { FEdGraphSchemaAction::AddReferencedObjects(Collector); - Collector.AddReferencedObject(NodeTemplate); + Collector.AddReferencedObject(this->NodeTemplate); } UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewEdge::PerformAction(UEdGraph *ParentGraph, UEdGraphPin *FromPin, const FVector2D Location, bool bSelectNewNode) { UEdGraphNode *ResultNode = nullptr; - if (NodeTemplate != nullptr) + if (this->NodeTemplate != nullptr) { const FScopedTransaction Transaction(LOCTEXT("ComboActionGraphEditorNewEdge", "Combo Action Graph Editor: New Edge")); ParentGraph->Modify(); if (FromPin != nullptr) FromPin->Modify(); - NodeTemplate->Rename(nullptr, ParentGraph); - ParentGraph->AddNode(NodeTemplate, true, bSelectNewNode); + this->NodeTemplate->Rename(nullptr, ParentGraph); + ParentGraph->AddNode(this->NodeTemplate, true, bSelectNewNode); - NodeTemplate->CreateNewGuid(); - NodeTemplate->PostPlacedNewNode(); - NodeTemplate->AllocateDefaultPins(); - NodeTemplate->AutowireNewNode(FromPin); + this->NodeTemplate->CreateNewGuid(); + this->NodeTemplate->PostPlacedNewNode(); + this->NodeTemplate->AllocateDefaultPins(); + this->NodeTemplate->AutowireNewNode(FromPin); - NodeTemplate->NodePosX = Location.X; - NodeTemplate->NodePosY = Location.Y; + this->NodeTemplate->NodePosX = Location.X; + this->NodeTemplate->NodePosY = Location.Y; - NodeTemplate->ComboActionGraphEdge->SetFlags(EObjectFlags::RF_Transactional); - NodeTemplate->SetFlags(EObjectFlags::RF_Transactional); + this->NodeTemplate->ComboActionGraphEdge->SetFlags(EObjectFlags::RF_Transactional); + this->NodeTemplate->SetFlags(EObjectFlags::RF_Transactional); - ResultNode = NodeTemplate; + ResultNode = this->NodeTemplate; } return ResultNode; @@ -88,7 +88,7 @@ UEdGraphNode *FAssetSchemaAction_ComboActionGraphSchema_NewEdge::PerformAction(U void FAssetSchemaAction_ComboActionGraphSchema_NewEdge::AddReferencedObjects(FReferenceCollector &Collector) { FEdGraphSchemaAction::AddReferencedObjects(Collector); - Collector.AddReferencedObject(NodeTemplate); + Collector.AddReferencedObject(this->NodeTemplate); } diff --git a/Source/ComboInputEditor/Private/Ed/EdComboActionGraphNode.cpp b/Source/ComboInputEditor/Private/Ed/EdComboActionGraphNode.cpp index fe64a2b..8db7e1f 100644 --- a/Source/ComboInputEditor/Private/Ed/EdComboActionGraphNode.cpp +++ b/Source/ComboInputEditor/Private/Ed/EdComboActionGraphNode.cpp @@ -158,7 +158,7 @@ FText UEdComboActionGraphNode::GetTooltipText() const return this->ComboActionGraphNode->GetNodeTooltipText(); } - return NSLOCTEXT("UEdComboActionGraphNode", "DefaultToolTip", "Mountea Dialogue Node"); + return NSLOCTEXT("UEdComboActionGraphNode", "DefaultToolTip", "Combo Action Node"); } FSlateIcon UEdComboActionGraphNode::GetIconAndTint(FLinearColor& OutColor) const diff --git a/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp b/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp index 30a1f91..c6b173d 100644 --- a/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp +++ b/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp @@ -2,26 +2,27 @@ #include "SEdComboActionGraphNode.h" +#include "ComboActionGraph.h" +#include "ComboInputAssets.h" #include "ComboInputEditor.h" +#include "GraphEditorSettings.h" +#include "SCommentBubble.h" +#include "SGraphPin.h" +#include "SlateOptMacros.h" -#include "Nodes/ComboActionGraphNode.h" -#include "Helpers/ComboActionGraphColors.h" +#include "Blueprint/UserWidget.h" #include "Ed/SEdComboActionGraphNodeIndex.h" #include "Ed/EdComboActionGraphNode.h" -#include "Widgets/Text/SInlineEditableTextBlock.h" -#include "SCommentBubble.h" -#include "SlateOptMacros.h" -#include "SGraphPin.h" -#include "GraphEditorSettings.h" -#include "Blueprint/UserWidget.h" -#include "ComboActionGraph.h" +#include "Helpers/ComboActionGraphColors.h" +#include "Nodes/ComboActionGraphNode_ActionNodeBase.h" #include "Settings/ComboActionGraphEditorSettings.h" #include "Widgets/Layout/SGridPanel.h" #include "Widgets/Layout/SScaleBox.h" - +#include "Widgets/Text/SInlineEditableTextBlock.h" #define LOCTEXT_NAMESPACE "EdComboActionGraph" + #pragma region Pin class SComboActionGraphPin : public SGraphPin @@ -34,12 +35,12 @@ public: { this->SetCursor(EMouseCursor::Default); - bShowLabel = true; + this->bShowLabel = true; - GraphPinObj = InPin; - check(GraphPinObj != nullptr); + this->GraphPinObj = InPin; + check(this->GraphPinObj != nullptr); - const UEdGraphSchema *Schema = GraphPinObj->GetSchema(); + const UEdGraphSchema *Schema = this->GraphPinObj->GetSchema(); check(Schema); // Pins Out/In Border @@ -111,8 +112,8 @@ void SEdComboActionGraphNode::OnMouseEnter(const FGeometry& MyGeometry, const FP { //bIsHovered = true; - SetToolTipText(GetTooltipText()); - OnVisualizeTooltip(GetToolTip()->AsWidget()); + this->SetToolTipText(GetTooltipText()); + this->OnVisualizeTooltip(GetToolTip()->AsWidget()); SGraphNode::OnMouseEnter(MyGeometry, MouseEvent); } @@ -121,8 +122,8 @@ void SEdComboActionGraphNode::OnMouseLeave(const FPointerEvent& MouseEvent) { //bIsHovered = false; - SetToolTipText(FText::GetEmpty()); - OnToolTipClosing(); + this->SetToolTipText(FText::GetEmpty()); + this->OnToolTipClosing(); SGraphNode::OnMouseLeave(MouseEvent); } @@ -142,16 +143,16 @@ void SEdComboActionGraphNode::UpdateGraphNode() const FSlateColor DefaultFontColor = ComboActionGraphColors::TextColors::Normal; - InputPins.Empty(); - OutputPins.Empty(); + this->InputPins.Empty(); + this->OutputPins.Empty(); // Reset variables that are going to be exposed, in case we are refreshing an already setup node. - RightNodeBox.Reset(); - LeftNodeBox.Reset(); - OutputPinBox.Reset(); + this->RightNodeBox.Reset(); + this->LeftNodeBox.Reset(); + this->OutputPinBox.Reset(); TSharedPtr ErrorText; - TSharedPtr NodeTitle = SNew(SNodeTitle, GraphNode); + TSharedPtr NodeTitle = SNew(SNodeTitle, this->GraphNode); TSharedPtr StackBox; TSharedPtr UniformBox; @@ -166,8 +167,8 @@ void SEdComboActionGraphNode::UpdateGraphNode() [ SNew(SOverlay) +SOverlay::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SBox) .WidthOverride(CircleBrush->ImageSize.X) @@ -175,15 +176,15 @@ void SEdComboActionGraphNode::UpdateGraphNode() ] +SOverlay::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SBorder) .BorderImage(CircleBrush) .BorderBackgroundColor(FLinearColor::Gray) .Padding(FMargin(4.0f)) - .VAlign(VAlign_Center) - .HAlign(HAlign_Center) + .HAlign(EHorizontalAlignment::HAlign_Center) + .VAlign(EVerticalAlignment::VAlign_Center) [ SNew(STextBlock) .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) @@ -194,8 +195,8 @@ void SEdComboActionGraphNode::UpdateGraphNode() ]; this->GetOrAddSlot(ENodeZone::Center) - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SBox) [ @@ -210,22 +211,22 @@ void SEdComboActionGraphNode::UpdateGraphNode() // Adding some colours so its not so boring + SOverlay::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ // INNER STYLE SNew(SBorder) .BorderImage(this, &SEdComboActionGraphNode::GetNodeTypeBrush) - .HAlign(HAlign_Fill) - .VAlign(VAlign_Center) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Center) .Visibility(EVisibility::SelfHitTestInvisible) .BorderBackgroundColor(this, &SEdComboActionGraphNode::GetBorderFrontColor) ] // Pins and node details + SOverlay::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SVerticalBox) @@ -236,7 +237,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() SNew(SBox) .MinDesiredHeight(NodePadding.Top) [ - SAssignNew(LeftNodeBox, SVerticalBox) + SAssignNew(this->LeftNodeBox, SVerticalBox) ] ] @@ -249,89 +250,17 @@ void SEdComboActionGraphNode::UpdateGraphNode() + SVerticalBox::Slot() .Padding(FMargin(NodePadding.Left, 0.0f, NodePadding.Right, 0.0f)) - .VAlign(VAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SVerticalBox) - -#pragma region Stack - - + SVerticalBox::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) - [ - SNew(SBox) - .MinDesiredWidth(FOptionalSize(145.f)) - .Visibility(this, &SEdComboActionGraphNode::GetStackVisibility) - [ - SNew(SVerticalBox) -#pragma region InheritanceOnly - + SVerticalBox::Slot() - .VAlign(VAlign_Fill) - [ - SNew(SBorder) - .BorderImage(this, &SEdComboActionGraphNode::GetTextNodeTypeBrush) - .BorderBackgroundColor(this, &SEdComboActionGraphNode::GetDecoratorsBackgroundColor) - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) - .Visibility(this, &SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Stack) - [ - SNew(SVerticalBox) - + SVerticalBox::Slot() - [ - SNew(SHorizontalBox) - + SHorizontalBox::Slot() - .Padding(FMargin(4.0f, 0.f, 4.0f, 0.f)) - .HAlign(HAlign_Fill) - [ - SNew(STextBlock) - .Text(this, &SEdComboActionGraphNode::GetDecoratorsInheritanceText) - .Justification(ETextJustify::Center) - ] - ] - ] - ] -#pragma endregion - -#pragma region ImplementsOnly - + SVerticalBox::Slot() - .VAlign(VAlign_Fill) - [ - SNew(SBorder) - .BorderImage(this, &SEdComboActionGraphNode::GetTextNodeTypeBrush) - .BorderBackgroundColor(this, &SEdComboActionGraphNode::GetDecoratorsBackgroundColor) - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) - .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Stack) - [ - SNew(SVerticalBox) - + SVerticalBox::Slot() - [ - SNew(SHorizontalBox) - + SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .Padding(FMargin(4.0f, 0.f, 4.0f, 0.f)) - [ - SNew(STextBlock) - .Text(this, &SEdComboActionGraphNode::GetDecoratorsText) - .Justification(ETextJustify::Center) - ] - ] - ] - ] -#pragma endregion - ] - ] - -#pragma endregion - + SVerticalBox::Slot() .AutoHeight() [ SAssignNew(NodeBody, SBorder) .BorderImage(this, &SEdComboActionGraphNode::GetTextNodeTypeBrush) .BorderBackgroundColor(this, &SEdComboActionGraphNode::GetNodeTitleBackgroundColor) - .HAlign(HAlign_Fill) - .VAlign(VAlign_Center) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Center) .Visibility(EVisibility::SelfHitTestInvisible) [ SNew(SBox) @@ -344,8 +273,8 @@ void SEdComboActionGraphNode::UpdateGraphNode() [ SNew(SOverlay) + SOverlay::Slot() - .HAlign(HAlign_Center) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Center) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SVerticalBox) #pragma region NameSlot @@ -377,7 +306,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() [ SNew(SVerticalBox) + SVerticalBox::Slot() - .HAlign(HAlign_Center) + .HAlign(EHorizontalAlignment::HAlign_Center) .AutoHeight() [ SAssignNew(InlineEditableText, SInlineEditableTextBlock) @@ -406,11 +335,11 @@ void SEdComboActionGraphNode::UpdateGraphNode() ] #pragma region Unified + SVerticalBox::Slot() - .VAlign(VAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::GetUnifiedVisibility) - .HAlign(HAlign_Fill) + .Visibility(this, &SEdComboActionGraphNode::GetResponseStackVisibility) + .HAlign(EHorizontalAlignment::HAlign_Fill) [ SNew(SVerticalBox) + SVerticalBox::Slot() @@ -423,236 +352,183 @@ void SEdComboActionGraphNode::UpdateGraphNode() ] ] -#pragma region InheritanceOnly - // INHERITS ONLY +#pragma region ResponseStack + // RESPONSE STACK + SVerticalBox::Slot() .AutoHeight() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) - .Padding(FMargin(8.0f, 0.f, 8.0f, 0.f)) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) + .Padding(FMargin(8.0f, 0.0f, 8.0f, 0.0f)) [ SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Unified) - .MaxDesiredWidth(FOptionalSize(130.f)) - .HAlign(HAlign_Fill) + .Visibility(EVisibility::Visible) + .MaxDesiredWidth(FOptionalSize(130.0f)) + .HAlign(EHorizontalAlignment::HAlign_Fill) [ - SNew(SGridPanel) + SNew(SHorizontalBox) .Visibility(EVisibility::HitTestInvisible) - .FillColumn(0, 2.f) - .FillColumn(1, 1.f) #pragma region Title - + SGridPanel::Slot(0,0) - .HAlign(HAlign_Fill) + + SHorizontalBox::Slot() + .HAlign(EHorizontalAlignment::HAlign_Center) [ SNew(STextBlock) - .Text(LOCTEXT("A", "DECORATORS")) + .Text(LOCTEXT("A", "Info:")) .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) .ColorAndOpacity(DefaultFontColor) ] -#pragma endregion - -#pragma region Inherits - + SGridPanel::Slot(0,1) - .HAlign(HAlign_Fill) - .Padding(UnifiedRowsPadding) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Unified) - .HAlign(HAlign_Left) - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SHorizontalBox) - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Center) - [ - SNew(SScaleBox) - .HAlign(HAlign_Left) - .VAlign(VAlign_Center) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SBox) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(6.f)) - .MaxDesiredWidth(FOptionalSize(6.f)) - [ - SNew(SImage) - .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) - ] - ] - ] - - +SHorizontalBox::Slot() - [ - SNew(SSpacer) - .Size(FVector2D(1.f, 0.f)) - ] - - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .AutoWidth() - [ - SNew(STextBlock) - .Text(LOCTEXT("B", "inherits")) - .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) - .Justification(ETextJustify::Left) - .ColorAndOpacity(DefaultFontColor) - ] - ] - ] - ] - + SGridPanel::Slot(1,1) - .HAlign(HAlign_Right) - .VAlign(VAlign_Center) - .Padding(UnifiedRowsPadding) - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - .HAlign(HAlign_Center) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Unified) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(12.f)) - .MaxDesiredWidth(FOptionalSize(12.f)) - [ - SNew(SImage) - .Image(this, &SEdComboActionGraphNode::GetInheritsImageBrush) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetInheritsImageTint) - ] - ] - ] -#pragma endregion ] - ] -#pragma endregion - -#pragma region ImplementsOnly - // IMPLEMENTS ONLY - + SVerticalBox::Slot() - + SVerticalBox::Slot() - .AutoHeight() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) - .Padding(FMargin(8.0f, 0.f, 8.0f, 0.f)) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) - .MaxDesiredWidth(FOptionalSize(130.f)) - .HAlign(HAlign_Fill) - [ - SNew(SGridPanel) - .Visibility(EVisibility::HitTestInvisible) - .FillColumn(0, 2.f) - .FillColumn(1, 1.f) +#pragma endregion #pragma region Title - + SGridPanel::Slot(0,0) - .HAlign(HAlign_Fill) - [ - SNew(STextBlock) - .Text(LOCTEXT("A", "DECORATORS")) - .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) - .ColorAndOpacity(DefaultFontColor) - ] -#pragma endregion + [ + SNew(SVerticalBox) + .Visibility(EVisibility::HitTestInvisible) -#pragma region Implements - + SGridPanel::Slot(0,1) - .HAlign(HAlign_Fill) - .Padding(UnifiedRowsPadding) + + SVerticalBox::Slot() + .HAlign(EHorizontalAlignment::HAlign_Left) [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) - .HAlign(HAlign_Left) - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SHorizontalBox) - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Center) - [ - SNew(SScaleBox) - .HAlign(HAlign_Left) - .VAlign(VAlign_Center) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SBox) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(6.f)) - .MaxDesiredWidth(FOptionalSize(6.f)) - [ - SNew(SImage) - .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetBulletPointsImagePointColor) - ] - ] - ] - - +SHorizontalBox::Slot() - [ - SNew(SSpacer) - .Size(FVector2D(1.f, 0.f)) - ] - - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .AutoWidth() - [ - SNew(STextBlock) - .Text(LOCTEXT("C", "implements")) - .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) - .Justification(ETextJustify::Left) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) - ] - ] - ] - ] - + SGridPanel::Slot(1,1) - .HAlign(HAlign_Right) - .VAlign(VAlign_Center) - .Padding(UnifiedRowsPadding) - [ - SNew(SOverlay) - +SOverlay::Slot() - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - .HAlign(HAlign_Center) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(12.f)) - .MaxDesiredWidth(FOptionalSize(12.f)) - .WidthOverride(12.f) - ] - ] - - +SOverlay::Slot() - .HAlign(HAlign_Center) - [ SNew(STextBlock) - .Text(this, &SEdComboActionGraphNode::GetNumberOfDecorators) - .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) - .Justification(ETextJustify::Center) - ] + .Text(this, &SEdComboActionGraphNode::GetComboInputName) + .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) + .ColorAndOpacity(DefaultFontColor) ] -#pragma endregion + + + SVerticalBox::Slot() + .HAlign(EHorizontalAlignment::HAlign_Left) + [ + SNew(STextBlock) + .Text(this, &SEdComboActionGraphNode::GetComboInputTriggerActionName) + .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) + .ColorAndOpacity(DefaultFontColor) + ] +#pragma endregion ] ] #pragma endregion +//#pragma region ImplementsOnly +// // IMPLEMENTS ONLY +// + SVerticalBox::Slot() +// + SVerticalBox::Slot() +// .AutoHeight() +// .HAlign(HAlign_Fill) +// .VAlign(VAlign_Fill) +// .Padding(FMargin(8.0f, 0.f, 8.0f, 0.f)) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) +// .MaxDesiredWidth(FOptionalSize(130.f)) +// .HAlign(HAlign_Fill) +// [ +// SNew(SGridPanel) +// .Visibility(EVisibility::HitTestInvisible) +// .FillColumn(0, 2.f) +// .FillColumn(1, 1.f) +//#pragma region Title +// + SGridPanel::Slot(0,0) +// .HAlign(HAlign_Fill) +// [ +// SNew(STextBlock) +// .Text(LOCTEXT("A", "DECORATORS")) +// .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) +// .ColorAndOpacity(DefaultFontColor) +// ] +//#pragma endregion +// +//#pragma region Implements +// + SGridPanel::Slot(0,1) +// .HAlign(HAlign_Fill) +// .Padding(UnifiedRowsPadding) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) +// .HAlign(HAlign_Left) +// [ +// SNew(SScaleBox) +// .Stretch(EStretch::ScaleToFit) +// [ +// SNew(SHorizontalBox) +// +SHorizontalBox::Slot() +// .HAlign(HAlign_Fill) +// .VAlign(VAlign_Center) +// [ +// SNew(SScaleBox) +// .HAlign(HAlign_Left) +// .VAlign(VAlign_Center) +// .Stretch(EStretch::ScaleToFit) +// [ +// SNew(SBox) +// .MaxAspectRatio(FOptionalSize(1)) +// .MaxDesiredHeight(FOptionalSize(6.f)) +// .MaxDesiredWidth(FOptionalSize(6.f)) +// [ +// SNew(SImage) +// .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetBulletPointsImagePointColor) +// ] +// ] +// ] +// +// +SHorizontalBox::Slot() +// [ +// SNew(SSpacer) +// .Size(FVector2D(1.f, 0.f)) +// ] +// +// +SHorizontalBox::Slot() +// .HAlign(HAlign_Fill) +// .AutoWidth() +// [ +// SNew(STextBlock) +// .Text(LOCTEXT("C", "implements")) +// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) +// .Justification(ETextJustify::Left) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) +// ] +// ] +// ] +// ] +// + SGridPanel::Slot(1,1) +// .HAlign(HAlign_Right) +// .VAlign(VAlign_Center) +// .Padding(UnifiedRowsPadding) +// [ +// SNew(SOverlay) +// +SOverlay::Slot() +// [ +// SNew(SScaleBox) +// .Stretch(EStretch::ScaleToFit) +// .HAlign(HAlign_Center) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) +// .MaxAspectRatio(FOptionalSize(1)) +// .MaxDesiredHeight(FOptionalSize(12.f)) +// .MaxDesiredWidth(FOptionalSize(12.f)) +// .WidthOverride(12.f) +// ] +// ] +// +// +SOverlay::Slot() +// .HAlign(HAlign_Center) +// [ +// SNew(STextBlock) +// .Text(this, &SEdComboActionGraphNode::GetNumberOfDecorators) +// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) +// .Justification(ETextJustify::Center) +// ] +// ] +//#pragma endregion +// ] +// ] +//#pragma endregion + #pragma region Both // BOTH + SVerticalBox::Slot() .AutoHeight() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) .Padding(FMargin(8.0f, 0.f, 8.0f, 0.f)) [ SNew(SBox) @@ -664,183 +540,183 @@ void SEdComboActionGraphNode::UpdateGraphNode() .Visibility(EVisibility::HitTestInvisible) .FillColumn(0, 2.f) .FillColumn(1, 1.f) -#pragma region Title - + SGridPanel::Slot(0,0) - .HAlign(HAlign_Fill) - [ - SNew(STextBlock) - .Text(LOCTEXT("A", "DECORATORS")) - .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) - .ColorAndOpacity(DefaultFontColor) - ] -#pragma endregion +//#pragma region Title +// + SGridPanel::Slot(0,0) +// .HAlign(HAlign_Fill) +// [ +// SNew(STextBlock) +// .Text(LOCTEXT("A", "DECORATORS")) +// .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) +// .ColorAndOpacity(DefaultFontColor) +// ] +//#pragma endregion -#pragma region Inherits - + SGridPanel::Slot(0,1) - .HAlign(HAlign_Fill) - .Padding(UnifiedRowsPadding) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) - .HAlign(HAlign_Left) - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SHorizontalBox) - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Center) - [ - SNew(SScaleBox) - .HAlign(HAlign_Left) - .VAlign(VAlign_Center) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SBox) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(6.f)) - .MaxDesiredWidth(FOptionalSize(6.f)) - [ - SNew(SImage) - .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) - ] - ] - ] +//#pragma region Inherits +// + SGridPanel::Slot(0,1) +// .HAlign(HAlign_Fill) +// .Padding(UnifiedRowsPadding) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) +// .HAlign(HAlign_Left) +// [ +// SNew(SScaleBox) +// .Stretch(EStretch::ScaleToFit) +// [ +// SNew(SHorizontalBox) +// +SHorizontalBox::Slot() +// .HAlign(HAlign_Fill) +// .VAlign(VAlign_Center) +// [ +// SNew(SScaleBox) +// .HAlign(HAlign_Left) +// .VAlign(VAlign_Center) +// .Stretch(EStretch::ScaleToFit) +// [ +// SNew(SBox) +// .MaxAspectRatio(FOptionalSize(1)) +// .MaxDesiredHeight(FOptionalSize(6.f)) +// .MaxDesiredWidth(FOptionalSize(6.f)) +// [ +// SNew(SImage) +// .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) +// ] +// ] +// ] +// +// +SHorizontalBox::Slot() +// [ +// SNew(SSpacer) +// .Size(FVector2D(1.f, 0.f)) +// ] +// +// +SHorizontalBox::Slot() +// .HAlign(HAlign_Fill) +// .AutoWidth() +// [ +// SNew(STextBlock) +// .Text(LOCTEXT("B", "inherits")) +// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) +// .Justification(ETextJustify::Left) +// .ColorAndOpacity(DefaultFontColor) +// ] +// ] +// ] +// ] +// + SGridPanel::Slot(1,1) +// .HAlign(HAlign_Right) +// .VAlign(VAlign_Center) +// .Padding(UnifiedRowsPadding) +// [ +// SNew(SScaleBox) +// .Stretch(EStretch::ScaleToFit) +// .HAlign(HAlign_Center) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) +// .MaxAspectRatio(FOptionalSize(1)) +// .MaxDesiredHeight(FOptionalSize(12.f)) +// .MaxDesiredWidth(FOptionalSize(12.f)) +// [ +// SNew(SImage) +// .Image(this, &SEdComboActionGraphNode::GetInheritsImageBrush) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetInheritsImageTint) +// ] +// ] +// ] +//#pragma endregion - +SHorizontalBox::Slot() - [ - SNew(SSpacer) - .Size(FVector2D(1.f, 0.f)) - ] - - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .AutoWidth() - [ - SNew(STextBlock) - .Text(LOCTEXT("B", "inherits")) - .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) - .Justification(ETextJustify::Left) - .ColorAndOpacity(DefaultFontColor) - ] - ] - ] - ] - + SGridPanel::Slot(1,1) - .HAlign(HAlign_Right) - .VAlign(VAlign_Center) - .Padding(UnifiedRowsPadding) - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - .HAlign(HAlign_Center) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(12.f)) - .MaxDesiredWidth(FOptionalSize(12.f)) - [ - SNew(SImage) - .Image(this, &SEdComboActionGraphNode::GetInheritsImageBrush) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetInheritsImageTint) - ] - ] - ] -#pragma endregion - -#pragma region Implements - + SGridPanel::Slot(0,2) - .HAlign(HAlign_Fill) - .Padding(UnifiedRowsPadding) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) - .HAlign(HAlign_Left) - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SHorizontalBox) - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Center) - [ - SNew(SScaleBox) - .HAlign(HAlign_Left) - .VAlign(VAlign_Center) - .Stretch(EStretch::ScaleToFit) - [ - SNew(SBox) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(6.f)) - .MaxDesiredWidth(FOptionalSize(6.f)) - [ - SNew(SImage) - .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetBulletPointsImagePointColor) - ] - ] - ] - - +SHorizontalBox::Slot() - [ - SNew(SSpacer) - .Size(FVector2D(1.f, 0.f)) - ] - - +SHorizontalBox::Slot() - .HAlign(HAlign_Fill) - .AutoWidth() - [ - SNew(STextBlock) - .Text(LOCTEXT("C", "implements")) - .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) - .Justification(ETextJustify::Left) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) - ] - ] - ] - ] - + SGridPanel::Slot(1,2) - .HAlign(HAlign_Right) - .VAlign(VAlign_Center) - .Padding(UnifiedRowsPadding) - [ - SNew(SOverlay) - +SOverlay::Slot() - [ - SNew(SScaleBox) - .Stretch(EStretch::ScaleToFit) - .HAlign(HAlign_Center) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) - .MaxAspectRatio(FOptionalSize(1)) - .MaxDesiredHeight(FOptionalSize(12.f)) - .MaxDesiredWidth(FOptionalSize(12.f)) - .WidthOverride(12.f) - ] - ] - - +SOverlay::Slot() - .HAlign(HAlign_Center) - [ - SNew(STextBlock) - .Text(this, &SEdComboActionGraphNode::GetNumberOfDecorators) - .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) - .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) - .Justification(ETextJustify::Center) - ] - ] -#pragma endregion +//#pragma region Implements +// + SGridPanel::Slot(0,2) +// .HAlign(HAlign_Fill) +// .Padding(UnifiedRowsPadding) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) +// .HAlign(HAlign_Left) +// [ +// SNew(SScaleBox) +// .Stretch(EStretch::ScaleToFit) +// [ +// SNew(SHorizontalBox) +// +SHorizontalBox::Slot() +// .HAlign(HAlign_Fill) +// .VAlign(VAlign_Center) +// [ +// SNew(SScaleBox) +// .HAlign(HAlign_Left) +// .VAlign(VAlign_Center) +// .Stretch(EStretch::ScaleToFit) +// [ +// SNew(SBox) +// .MaxAspectRatio(FOptionalSize(1)) +// .MaxDesiredHeight(FOptionalSize(6.f)) +// .MaxDesiredWidth(FOptionalSize(6.f)) +// [ +// SNew(SImage) +// .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetBulletPointsImagePointColor) +// ] +// ] +// ] +// +// +SHorizontalBox::Slot() +// [ +// SNew(SSpacer) +// .Size(FVector2D(1.f, 0.f)) +// ] +// +// +SHorizontalBox::Slot() +// .HAlign(HAlign_Fill) +// .AutoWidth() +// [ +// SNew(STextBlock) +// .Text(LOCTEXT("C", "implements")) +// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) +// .Justification(ETextJustify::Left) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) +// ] +// ] +// ] +// ] +// + SGridPanel::Slot(1,2) +// .HAlign(HAlign_Right) +// .VAlign(VAlign_Center) +// .Padding(UnifiedRowsPadding) +// [ +// SNew(SOverlay) +// +SOverlay::Slot() +// [ +// SNew(SScaleBox) +// .Stretch(EStretch::ScaleToFit) +// .HAlign(HAlign_Center) +// [ +// SNew(SBox) +// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) +// .MaxAspectRatio(FOptionalSize(1)) +// .MaxDesiredHeight(FOptionalSize(12.f)) +// .MaxDesiredWidth(FOptionalSize(12.f)) +// .WidthOverride(12.f) +// ] +// ] +// +// +SOverlay::Slot() +// .HAlign(HAlign_Center) +// [ +// SNew(STextBlock) +// .Text(this, &SEdComboActionGraphNode::GetNumberOfDecorators) +// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) +// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) +// .Justification(ETextJustify::Center) +// ] +// ] +//#pragma endregion ] ] #pragma endregion + SVerticalBox::Slot() - .HAlign(HAlign_Center) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Center) + .VAlign(EVerticalAlignment::VAlign_Fill) [ SNew(SSpacer) .Size(FVector2D(0.f, 2.5f)) @@ -867,14 +743,14 @@ void SEdComboActionGraphNode::UpdateGraphNode() SNew(SBox) .MinDesiredHeight(NodePadding.Bottom) [ - SAssignNew(RightNodeBox, SVerticalBox) + SAssignNew(this->RightNodeBox, SVerticalBox) + SVerticalBox::Slot() - .HAlign(HAlign_Fill) - .VAlign(VAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Fill) + .VAlign(EVerticalAlignment::VAlign_Fill) .Padding(20.0f, 0.0f) .FillHeight(1.0f) [ - SAssignNew(OutputPinBox, SHorizontalBox) + SAssignNew(this->OutputPinBox, SHorizontalBox) ] ] ] @@ -888,7 +764,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() const FSlateColor CommentColor = GetDefault()->DefaultCommentNodeTitleColor; SAssignNew(CommentBubble, SCommentBubble) - .GraphNode(GraphNode) + .GraphNode(this->GraphNode) .Text(this, &SGraphNode::GetNodeComment) .OnTextCommitted(this, &SGraphNode::OnCommentTextCommitted) .ColorAndOpacity(CommentColor) @@ -902,7 +778,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() .SlotOffset(TAttribute(CommentBubble.Get(), &SCommentBubble::GetOffset)) .SlotSize(TAttribute(CommentBubble.Get(), &SCommentBubble::GetSize)) .AllowScaling(TAttribute(CommentBubble.Get(), &SCommentBubble::IsScalingAllowed)) - .VAlign(VAlign_Top) + .VAlign(EVerticalAlignment::VAlign_Top) [ CommentBubble.ToSharedRef() ]; @@ -914,7 +790,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() void SEdComboActionGraphNode::CreatePinWidgets() { - UEdComboActionGraphNode *StateNode = CastChecked(GraphNode); + UEdComboActionGraphNode *StateNode = CastChecked(this->GraphNode); for (int32 PinIdx = 0; PinIdx < StateNode->Pins.Num(); PinIdx++) { @@ -941,7 +817,7 @@ void SEdComboActionGraphNode::AddPin(const TSharedRef& PinToAdd) if (PinToAdd->GetDirection() == EEdGraphPinDirection::EGPD_Input) { - LeftNodeBox->AddSlot() + this->LeftNodeBox->AddSlot() .HAlign(HAlign_Fill) .VAlign(VAlign_Fill) .FillHeight(1.0f) @@ -949,19 +825,19 @@ void SEdComboActionGraphNode::AddPin(const TSharedRef& PinToAdd) [ PinToAdd ]; - InputPins.Add(PinToAdd); + this->InputPins.Add(PinToAdd); } else // Direction == EEdGraphPinDirection::EGPD_Output - { - OutputPinBox->AddSlot() + { + this->OutputPinBox->AddSlot() .HAlign(HAlign_Fill) .VAlign(VAlign_Fill) .FillWidth(1.0f) [ PinToAdd ]; - OutputPins.Add(PinToAdd); - } + this->OutputPins.Add(PinToAdd); + } } bool SEdComboActionGraphNode::IsNameReadOnly() const @@ -983,7 +859,7 @@ void SEdComboActionGraphNode::OnNameTextCommitted(const FText& InText, ETextComm SGraphNode::OnNameTextCommited(InText, CommitInfo); - UEdComboActionGraphNode *MyNode = CastChecked(GraphNode); + UEdComboActionGraphNode *MyNode = CastChecked(this->GraphNode); if (MyNode != nullptr && MyNode->ComboActionGraphNode != nullptr) { @@ -998,9 +874,9 @@ void SEdComboActionGraphNode::OnNameTextCommitted(const FText& InText, ETextComm const FSlateBrush *SEdComboActionGraphNode::GetNodeTypeBrush() const { FComboInputEditorModule &ComboInputEditorModule = FComboInputEditorModule::Get(); - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - switch (GraphEditorSettings->GetNodeType()) + switch (this->GraphEditorSettings->GetNodeType()) { case EComboActionNodeType::SoftCorners: return ComboInputEditorModule.GetComboInputEditorStyleSet()->GetBrush("MDSStyleSet.Node.SoftEdges"); @@ -1015,9 +891,9 @@ const FSlateBrush *SEdComboActionGraphNode::GetNodeTypeBrush() const const FSlateBrush *SEdComboActionGraphNode::GetTextNodeTypeBrush() const { FComboInputEditorModule &ComboInputEditorModule = FComboInputEditorModule::Get(); - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - switch (GraphEditorSettings->GetNodeType()) + switch (this->GraphEditorSettings->GetNodeType()) { case EComboActionNodeType::SoftCorners: return ComboInputEditorModule.GetComboInputEditorStyleSet()->GetBrush("MDSStyleSet.Node.TextSoftEdges"); @@ -1037,9 +913,9 @@ FSlateColor SEdComboActionGraphNode::GetBorderBackgroundColor() const FSlateColor SEdComboActionGraphNode::GetBorderFrontColor() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - switch (GraphEditorSettings->GetNodeTheme()) + switch (this->GraphEditorSettings->GetNodeTheme()) { case EComboActionNodeTheme::DarkTheme: return ComboActionGraphColors::Overlay::DarkTheme; @@ -1063,9 +939,9 @@ FSlateColor SEdComboActionGraphNode::GetDecoratorsBackgroundColor() const FSlateColor SEdComboActionGraphNode::GetPinsDockColor() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - switch (GraphEditorSettings->GetNodeTheme()) + switch (this->GraphEditorSettings->GetNodeTheme()) { case EComboActionNodeTheme::DarkTheme: return ComboActionGraphColors::PinsDock::DarkTheme; @@ -1087,36 +963,6 @@ const FSlateBrush*SEdComboActionGraphNode::GetNameIcon() const return FAppStyle::GetBrush(TEXT("BTEditor.Graph.BTNode.Icon")); } -const FSlateBrush*SEdComboActionGraphNode::GetInheritsImageBrush() const -{ - FComboInputEditorModule &ComboInputEditorModule = FComboInputEditorModule::Get(); - - bool bHasDecorators = false; - if (const UEdComboActionGraphNode *EdParentNode = Cast(this->GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - bHasDecorators = EdParentNode->ComboActionGraphNode->DoesInheritDecorators() ; - } - } - - return ComboInputEditorModule.GetComboInputEditorStyleSet()->GetBrush( bHasDecorators ? "MDSStyleSet.Icon.OK" : "MDSStyleSet.Icon.Error" ); -} - -FSlateColor SEdComboActionGraphNode::GetInheritsImageTint() const -{ - bool bHasDecorators = false; - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - bHasDecorators = EdParentNode->ComboActionGraphNode->DoesInheritDecorators() ; - } - } - - return bHasDecorators ? FSlateColor(FLinearColor::Green) : FSlateColor(FLinearColor::Red); -} - const FSlateBrush*SEdComboActionGraphNode::GetBulletPointImageBrush() const { FComboInputEditorModule &ComboInputEditorModule = FComboInputEditorModule::Get(); @@ -1148,7 +994,7 @@ FText SEdComboActionGraphNode::GetIndexText() const EVisibility SEdComboActionGraphNode::GetIndexSlotVisibility() const { - if (IsHovered()) + if (this->IsHovered()) { return EVisibility::SelfHitTestInvisible; } @@ -1158,7 +1004,7 @@ EVisibility SEdComboActionGraphNode::GetIndexSlotVisibility() const FVector2D SEdComboActionGraphNode::GetIndexSlotOffset() const { - if (IsHovered()) + if (this->IsHovered()) { return FVector2D(-20.f); } @@ -1168,7 +1014,7 @@ FVector2D SEdComboActionGraphNode::GetIndexSlotOffset() const FVector2D SEdComboActionGraphNode::GetIndexSlotSize() const { - if (IsHovered()) + if (this->IsHovered()) { return FVector2D(24.f); } @@ -1186,55 +1032,11 @@ FSlateColor SEdComboActionGraphNode::GetOverlayWidgetBackgroundColor(bool bArg) return bArg ? ComboActionGraphColors::IndexBorder::HoveredState : ComboActionGraphColors::IndexBorder::NormalState; } -bool SEdComboActionGraphNode::HasGraphDecorators() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode && EdParentNode->ComboActionGraphNode->Graph) - { - for (const auto& Itr : EdParentNode->ComboActionGraphNode->Graph->GetGraphDecorators()) - { - if (Itr.DecoratorType != nullptr) - { - return true; - } - } - } - } - - return false; -} - -bool SEdComboActionGraphNode::HasNodeDecorators() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - if (EdParentNode->ComboActionGraphNode->GetNodeDecorators().Num() > 0) - { - bool bAllValid = true; - - for (const auto& Itr : EdParentNode->ComboActionGraphNode->GetNodeDecorators()) - { - if (Itr.DecoratorType == nullptr) - { - bAllValid = false; - } - } - return bAllValid; - } - } - } - - return false; -} - EVisibility SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - if (GraphEditorSettings->ShowDetailedInfo_NumDecorators() && !GraphEditorSettings->ShowDetailedInfo_InheritsDecorators()) + if (this->GraphEditorSettings->ShowDetailedInfo_NumDecorators() && !this->GraphEditorSettings->ShowDetailedInfo_InheritsDecorators()) { return EVisibility::SelfHitTestInvisible; //return HasGraphDecorators() ? EVisibility::Visible : EVisibility::Collapsed; } @@ -1242,58 +1044,13 @@ EVisibility SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified() const return EVisibility::Collapsed; } -FText SEdComboActionGraphNode::GetDecoratorsText() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - FString Number = FString::FromInt(EdParentNode->ComboActionGraphNode->GetNodeDecorators().Num()); - FString ReturnText = FString(TEXT("DECORATORS: ")); - return FText::FromString( ReturnText.Append(Number) ); - } - } - return FText::FromString("DECORATORS: none"); -} - -FText SEdComboActionGraphNode::GetNumberOfDecorators() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - const int32 Number = EdParentNode->ComboActionGraphNode->GetNodeDecorators().Num(); - if (Number <= 0) return FText::FromString(TEXT("-")); - if (Number > 9) return FText::FromString(TEXT("9+")); - - return FText::FromString(FString::FromInt(Number)); - } - } - return FText::FromString("-"); -} - -EVisibility SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Unified() const -{ - if (GraphEditorSettings) - { - if (GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Unified) - { - if (GraphEditorSettings->ShowDetailedInfo_InheritsDecorators() && !GraphEditorSettings->ShowDetailedInfo_NumDecorators()) - { - return EVisibility::SelfHitTestInvisible; //return HasGraphDecorators() ? EVisibility::Visible : EVisibility::Collapsed; - } - } - } - return EVisibility::Collapsed; -} - EVisibility SEdComboActionGraphNode::ShowImplementsOnlySlot_Stack() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - if (GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Stack) + if (this->GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Stack) { - if (GraphEditorSettings->ShowDetailedInfo_NumDecorators()) + if (this->GraphEditorSettings->ShowDetailedInfo_NumDecorators()) { return EVisibility::SelfHitTestInvisible; //return HasGraphDecorators() ? EVisibility::Visible : EVisibility::Collapsed; } @@ -1304,11 +1061,11 @@ EVisibility SEdComboActionGraphNode::ShowImplementsOnlySlot_Stack() const EVisibility SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Stack() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - if (GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Stack) + if (this->GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Stack) { - if (GraphEditorSettings->ShowDetailedInfo_InheritsDecorators()) + if (this->GraphEditorSettings->ShowDetailedInfo_InheritsDecorators()) { return EVisibility::SelfHitTestInvisible; //return HasGraphDecorators() ? EVisibility::Visible : EVisibility::Collapsed; } @@ -1319,11 +1076,11 @@ EVisibility SEdComboActionGraphNode::ShowInheritsDecoratorsSlot_Stack() const EVisibility SEdComboActionGraphNode::ShowAllDecorators() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - if (GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Unified) + if (this->GraphEditorSettings->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Unified) { - if (GraphEditorSettings->ShowDetailedInfo_InheritsDecorators() && GraphEditorSettings->ShowDetailedInfo_NumDecorators()) + if (this->GraphEditorSettings->ShowDetailedInfo_InheritsDecorators() && this->GraphEditorSettings->ShowDetailedInfo_NumDecorators()) { return EVisibility::SelfHitTestInvisible; //return HasGraphDecorators() ? EVisibility::Visible : EVisibility::Collapsed; } @@ -1334,9 +1091,9 @@ EVisibility SEdComboActionGraphNode::ShowAllDecorators() const EVisibility SEdComboActionGraphNode::ShowDecoratorsBottomPadding() const { - if (GraphEditorSettings) + if (this->GraphEditorSettings) { - if (GraphEditorSettings->ShowDetailedInfo_InheritsDecorators() || GraphEditorSettings->ShowDetailedInfo_NumDecorators()) + if (this->GraphEditorSettings->ShowDetailedInfo_InheritsDecorators() || this->GraphEditorSettings->ShowDetailedInfo_NumDecorators()) { return EVisibility::SelfHitTestInvisible; } @@ -1344,61 +1101,14 @@ EVisibility SEdComboActionGraphNode::ShowDecoratorsBottomPadding() const return EVisibility::Collapsed; } -FSlateColor SEdComboActionGraphNode::GetImplementsRowColor() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - if (EdParentNode->ComboActionGraphNode->GetNodeDecorators().Num() > 0) - { - return ComboActionGraphColors::TextColors::Normal; - } - - return ComboActionGraphColors::TextColors::Disabled; - } - } - return ComboActionGraphColors::TextColors::Normal; -} - -FSlateColor SEdComboActionGraphNode::GetBulletPointsImagePointColor() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - if (EdParentNode->ComboActionGraphNode->GetNodeDecorators().Num() > 0) - { - return ComboActionGraphColors::BulletPointsColors::Normal; - } - - return ComboActionGraphColors::BulletPointsColors::Disabled; - } - } - return ComboActionGraphColors::BulletPointsColors::Normal; -} - -FText SEdComboActionGraphNode::GetDecoratorsInheritanceText() const -{ - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) - { - if (EdParentNode->ComboActionGraphNode) - { - FString Result = EdParentNode->ComboActionGraphNode->DoesInheritDecorators() ? TEXT("yes") : TEXT("no") ; - return FText::FromString( FString(TEXT("INHERITS: ")).Append(Result) ); - } - } - return FText::FromString("invalid"); -} - EComboActionDecoratorsInfoStyle SEdComboActionGraphNode::GetDecoratorsStyle() const { if (this->GraphEditorSettings) { - return GraphEditorSettings->GetDecoratorsStyle(); + return this->GraphEditorSettings->GetDecoratorsStyle(); } - if (const auto TempSettings = GetMutableDefault()) + if (const UComboActionGraphEditorSettings *TempSettings = GetMutableDefault()) { return TempSettings->GetDecoratorsStyle(); } @@ -1406,45 +1116,56 @@ EComboActionDecoratorsInfoStyle SEdComboActionGraphNode::GetDecoratorsStyle() co return EComboActionDecoratorsInfoStyle::Stack; } -EVisibility SEdComboActionGraphNode::GetStackVisibility() const +EVisibility SEdComboActionGraphNode::GetResponseStackVisibility() const { - if (this->GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Stack) + if (const UEdComboActionGraphNode *EdParentNode = Cast(this->GraphNode)) { - if (GraphEditorSettings) + if (const UComboActionGraphNode_ActionNodeBase *ActionNode = Cast(EdParentNode->ComboActionGraphNode)) { - if (GraphEditorSettings->ShowDetailedInfo_InheritsDecorators() || GraphEditorSettings->ShowDetailedInfo_NumDecorators()) - { - return EVisibility::SelfHitTestInvisible; - } - return EVisibility::Collapsed; + return EVisibility::SelfHitTestInvisible; } - - const auto TempSettings = GetMutableDefault(); - if (TempSettings) return GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Stack ? EVisibility::SelfHitTestInvisible : EVisibility::Collapsed; - { - if (TempSettings->ShowDetailedInfo_InheritsDecorators() || TempSettings->ShowDetailedInfo_NumDecorators()) - { - return EVisibility::SelfHitTestInvisible; - } - return EVisibility::Collapsed; - } - } return EVisibility::Collapsed; } -EVisibility SEdComboActionGraphNode::GetUnifiedVisibility() const -{ - return GetDecoratorsStyle() == EComboActionDecoratorsInfoStyle::Unified ? EVisibility::SelfHitTestInvisible : EVisibility::Collapsed; -} - FText SEdComboActionGraphNode::GetTooltipText() const { - if (const UEdComboActionGraphNode *EdParentNode = Cast(GraphNode)) + if (const UEdComboActionGraphNode *EdParentNode = Cast(this->GraphNode)) { return EdParentNode->GetTooltipText(); } return LOCTEXT("SEdComboActionGraphNode_Tooltip", "invalid node selected"); } +FText SEdComboActionGraphNode::GetComboInputName() const +{ + if (const UEdComboActionGraphNode *EdParentNode = Cast(this->GraphNode)) + { + if (const UComboActionGraphNode_ActionNodeBase *ActionNode = Cast(EdParentNode->ComboActionGraphNode)) + { + if (UComboInputAsset *ComboInput = ActionNode->GetComboInput()) + { + return FText::FromName(ComboInput->ComboInputName); + } + return LOCTEXT("SEdComboActionGraphNode_ComboInputNull", "No Combo Input set"); + } + } + return LOCTEXT("SEdComboActionGraphNode_ComboInputNameNotSet", "unset"); +} + +FText SEdComboActionGraphNode::GetComboInputTriggerActionName() const +{ + if (const UEdComboActionGraphNode *EdParentNode = Cast(this->GraphNode)) + { + if (const UComboActionGraphNode_ActionNodeBase *ActionNode = Cast(EdParentNode->ComboActionGraphNode)) + { + const FString &EnumNameString = StaticEnum()->GetNameByValue((uint8)ActionNode->GetTriggerEvent()).ToString(); + FString EnumType, EnumValueName; + EnumNameString.Split("::", &EnumType, &EnumValueName); + return FText::FromString(EnumValueName); + } + } + return LOCTEXT("SEdComboActionGraphNode_TriggerActionNameNotSet", "unset"); +} + #undef LOCTEXT_NAMESPACE diff --git a/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.h b/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.h index b2e9e7e..b5a215e 100644 --- a/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.h +++ b/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.h @@ -41,9 +41,6 @@ public: virtual const FSlateBrush *GetNameIcon() const; - virtual const FSlateBrush *GetInheritsImageBrush() const; - virtual FSlateColor GetInheritsImageTint() const; - const FSlateBrush *GetBulletPointImageBrush() const; virtual FText GetIndexOverlayTooltipText() const; @@ -54,30 +51,21 @@ public: virtual void OnIndexHoverStateChanged(bool bArg) const; virtual FSlateColor GetOverlayWidgetBackgroundColor(bool bArg) const; - - bool HasGraphDecorators() const; - bool HasNodeDecorators() const; - - virtual FText GetDecoratorsText() const; - virtual FText GetNumberOfDecorators() const; - virtual FText GetDecoratorsInheritanceText() const; EVisibility ShowImplementsOnlySlot_Unified() const; - EVisibility ShowInheritsDecoratorsSlot_Unified() const; EVisibility ShowImplementsOnlySlot_Stack() const; EVisibility ShowInheritsDecoratorsSlot_Stack() const; EVisibility ShowAllDecorators() const; EVisibility ShowDecoratorsBottomPadding() const; - - FSlateColor GetImplementsRowColor() const; - FSlateColor GetBulletPointsImagePointColor() const; virtual EComboActionDecoratorsInfoStyle GetDecoratorsStyle() const; - EVisibility GetStackVisibility() const; - EVisibility GetUnifiedVisibility() const; + EVisibility GetResponseStackVisibility() const; FText GetTooltipText() const; + FText GetComboInputName() const; + FText GetComboInputTriggerActionName() const; + protected: TSharedPtr NodeBody; TSharedPtr OutputPinBox; diff --git a/Source/ComboInputEditor/Private/Helpers/ComboActionEditorBFC.h b/Source/ComboInputEditor/Private/Helpers/ComboActionEditorBFC.h index e08b777..ee7ee7b 100644 --- a/Source/ComboInputEditor/Private/Helpers/ComboActionEditorBFC.h +++ b/Source/ComboInputEditor/Private/Helpers/ComboActionEditorBFC.h @@ -4,6 +4,7 @@ #include "CoreMinimal.h" +#include "ComboInputAssets.h" #include "Ed/EdComboActionGraphNode.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "Nodes/ComboActionGraphNode.h" @@ -26,7 +27,10 @@ public: #if WITH_EDITOR static FText GetNodeTitle(UComboActionGraphNode *Node) { - if (!Node) return FText::FromString("Invalid Node"); + if (!Node) + { + return FText::FromString("Invalid Node"); + } const UComboActionGraphEditorSettings *Settings = GetDefault(); if (Settings) @@ -35,12 +39,9 @@ public: { if (const UComboActionGraphNode_ActionNodeBase *DialogueNodeBase = Cast(Node)) { - if (DialogueNodeBase->GetDataTable()) + if (const UComboInputAsset *ComboInput = DialogueNodeBase->GetComboInput()) { - FString ReturnString; - DialogueNodeBase->GetRowName().ToString(ReturnString); - - return FText::FromString(ReturnString); + return FText::FromString(ComboInput->GetName()); } } diff --git a/Source/ComboInputEditor/Private/Search/ComboActionSearchFilter.h b/Source/ComboInputEditor/Private/Search/ComboActionSearchFilter.h index aee8b64..4f1f6e1 100644 --- a/Source/ComboInputEditor/Private/Search/ComboActionSearchFilter.h +++ b/Source/ComboInputEditor/Private/Search/ComboActionSearchFilter.h @@ -8,21 +8,18 @@ struct FComboActionSearchFilter public: bool IsEmptyFilter() const { - return SearchString.IsEmpty() - && bIncludeNodeTitle == false - && bIncludeNodeType == false - && bIncludeNodeDecoratorsTypes == false - && bIncludeNodeData == true - && bIncludeNodeGUID == false; + return this->SearchString.IsEmpty() + && this->bIncludeNodeTitle == false + && this->bIncludeNodeType == false + && this->bIncludeNodeData == true + && this->bIncludeNodeGUID == false; } -public: // Search term that the search items must match FString SearchString; bool bIncludeNodeTitle = true; bool bIncludeNodeType = true; - bool bIncludeNodeDecoratorsTypes = true; bool bIncludeNodeData = true; bool bIncludeNodeGUID = false; }; diff --git a/Source/ComboInputEditor/Private/Search/ComboActionSearchManager.cpp b/Source/ComboInputEditor/Private/Search/ComboActionSearchManager.cpp index 6058f8d..2ca961b 100644 --- a/Source/ComboInputEditor/Private/Search/ComboActionSearchManager.cpp +++ b/Source/ComboInputEditor/Private/Search/ComboActionSearchManager.cpp @@ -3,6 +3,7 @@ #include "ComboActionSearchManager.h" #include "ComboActionGraph.h" +#include "ComboInputAssets.h" #include "AssetRegistry/AssetRegistryModule.h" #include "Ed/EdComboActionGraph.h" @@ -73,34 +74,17 @@ bool FComboActionSearchManager::QueryGraphNode(const FComboActionSearchFilter &S } } - // Search by Decorators - if (SearchFilter.bIncludeNodeDecoratorsTypes) - { - const TArray &NodeDecorators = Node->GetNodeDecorators(); - for (int32 Index = 0, Num = NodeDecorators.Num(); Index < Num; Index++) - { - bContainsSearchString = this->QueryNodeDecorators( - SearchFilter, - NodeDecorators[Index], - TreeGraphNode, - Index, - TEXT("DecoratorType") - ) - || bContainsSearchString; - } - } - // Search by Node Data if (SearchFilter.bIncludeNodeData) { if (const UComboActionGraphNode_ActionNodeBase *ActionNodeBase = Cast(Node)) { - if (ActionNodeBase->GetRowName().ToString().Contains(SearchFilter.SearchString)) + if (ActionNodeBase->GetComboInput()->GetName().Contains(SearchFilter.SearchString)) { bContainsSearchString = true; this->MakeChildTextNode( TreeGraphNode, - FText::FromName(FName(Node->NodeTypeName.ToString() )), + FText::FromName(FName(Node->NodeTypeName.ToString())), LOCTEXT("NodeDataRowKey", "Node Data"), TEXT("Node Data") ); diff --git a/Source/ComboInputEditor/Private/Search/SComboActionSearch.cpp b/Source/ComboInputEditor/Private/Search/SComboActionSearch.cpp index e6154db..1e05517 100644 --- a/Source/ComboInputEditor/Private/Search/SComboActionSearch.cpp +++ b/Source/ComboInputEditor/Private/Search/SComboActionSearch.cpp @@ -339,26 +339,6 @@ TSharedRef SComboActionSearch::FillFilterEntries() EUserInterfaceActionType::ToggleButton ); MenuBuilder.AddMenuEntry - ( - LOCTEXT("IncludeNodeDecoratorsTypes", "Include Node Decorators"), - LOCTEXT("IncludeNodeDecoratorsTypes_ToolTip", "Include Node Decorators Types (by name) in the search result"), - FSlateIcon(), - FUIAction( - FExecuteAction::CreateLambda([this]() - { - this->CurrentFilter.bIncludeNodeDecoratorsTypes = !this->CurrentFilter.bIncludeNodeDecoratorsTypes; - this->MakeSearchQuery(this->CurrentFilter); - }), - FCanExecuteAction(), - FIsActionChecked::CreateLambda([this]() -> bool - { - return this->CurrentFilter.bIncludeNodeDecoratorsTypes; - }) - ), - NAME_None, - EUserInterfaceActionType::ToggleButton - ); - MenuBuilder.AddMenuEntry ( LOCTEXT("IncludeNodeData", "Include Node Data Row"), LOCTEXT("IncludeNodeDecoratorsTypes_ToolTip", "Include Node Data Row in the search result"),