From 08b89b9d84a4511614452836ab2ea4891fa770cc Mon Sep 17 00:00:00 2001 From: Jamie Greunbaum Date: Sat, 7 Oct 2023 18:58:26 -0400 Subject: [PATCH] Fixed some grammar issues with the variable names that were annoying me. --- .../ComboInput/Private/ComboActionGraph.cpp | 2 +- .../Private/Nodes/ComboActionGraphNode.cpp | 6 ++-- .../Nodes/ComboActionGraphNode_ActionNode.cpp | 2 +- .../ComboActionGraphNode_ActionNodeBase.cpp | 8 ++--- .../Nodes/ComboActionGraphNode_StartNode.cpp | 4 +-- .../Public/Nodes/ComboActionGraphNode.h | 31 +++++-------------- .../Private/Ed/EdComboActionGraph.cpp | 10 +++--- ...ActionForceDirectedSolveLayoutStrategy.cpp | 6 ++-- .../Layout/ComboActionGraphLayoutStrategy.cpp | 4 +-- .../ComboActionTreeSolveLayoutStrategy.cpp | 28 ++++++++--------- 10 files changed, 42 insertions(+), 59 deletions(-) diff --git a/Source/ComboInput/Private/ComboActionGraph.cpp b/Source/ComboInput/Private/ComboActionGraph.cpp index 2d25b60..31959ec 100644 --- a/Source/ComboInput/Private/ComboActionGraph.cpp +++ b/Source/ComboInput/Private/ComboActionGraph.cpp @@ -51,7 +51,7 @@ void UComboActionGraph::ClearGraph() for (UComboActionGraphNode *Node : this->AllNodes) { Node->ParentNodes.Empty(); - Node->ChildrenNodes.Empty(); + Node->ChildNodes.Empty(); Node->Edges.Empty(); } diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp index a8b665f..ab7dca4 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode.cpp @@ -104,7 +104,7 @@ bool UComboActionGraphNode::CanCreateConnection(UComboActionGraphNode *Other, en ErrorMessage = FText::FromString("Invalid Other Node!"); } - if (Other->GetMaxChildNodes() > -1 && Other->ChildrenNodes.Num() >= Other->GetMaxChildNodes()) + if (Other->GetMaxChildNodes() > -1 && Other->ChildNodes.Num() >= Other->GetMaxChildNodes()) { const FString TextReturn = FString(Other->GetNodeTitle().ToString()). @@ -143,7 +143,7 @@ bool UComboActionGraphNode::ValidateNode(TArray &ValidationsMessages, con { bool bResult = true; - if (this->ParentNodes.Num() == 0 && this->ChildrenNodes.Num() == 0) + if (this->ParentNodes.Num() == 0 && this->ChildNodes.Num() == 0) { bResult = false; @@ -187,7 +187,7 @@ void UComboActionGraphNode::OnPasted() this->NodeGUID = FGuid::NewGuid(); this->ParentNodes.Empty(); - this->ChildrenNodes.Empty(); + this->ChildNodes.Empty(); this->Edges.Empty(); } diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp index 8e6f231..849576a 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNode.cpp @@ -19,7 +19,7 @@ UComboActionGraphNode_ActionNode::UComboActionGraphNode_ActionNode() this->AllowedInputClasses.Add(UComboActionGraphNode_StartNode::StaticClass()); this->AllowedInputClasses.Add(UComboActionGraphNode_ActionNode::StaticClass()); - this->MaxChildrenNodes = -1; + this->MaxChildNodes = -1; } void UComboActionGraphNode_ActionNode::PreProcessNode(const TScriptInterface &Manager) diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp index b55a545..db6f0a6 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_ActionNodeBase.cpp @@ -45,7 +45,7 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNodeRuntime_Implementation() return false; } - if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes) + if (this->MaxChildNodes > -1 && this->ChildNodes.Num() > this->MaxChildNodes) { return false; } @@ -113,7 +113,7 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray &Validatio ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); } - if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes) + if (this->MaxChildNodes > -1 && this->ChildNodes.Num() > this->MaxChildNodes) { const FString RichTextReturn = FString("* ") .Append("") @@ -121,12 +121,12 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray &Validatio .Append("") .Append(": Has more than ") .Append("") - .Append(FString::FromInt(this->MaxChildrenNodes)) + .Append(FString::FromInt(this->MaxChildNodes)) .Append("") .Append(" child nodes!"); const FString TextReturn = FString(this->NodeTitle.ToString()) - .Append(": Has more than ").Append(FString::FromInt(this->MaxChildrenNodes)).Append(" child nodes!"); + .Append(": Has more than ").Append(FString::FromInt(this->MaxChildNodes)).Append(" child nodes!"); ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn)); } diff --git a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp index c5c462e..c238946 100644 --- a/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp +++ b/Source/ComboInput/Private/Nodes/ComboActionGraphNode_StartNode.cpp @@ -23,7 +23,7 @@ UComboActionGraphNode_StartNode::UComboActionGraphNode_StartNode() this->NodeTooltipText = LOCTEXT("ComboActionGraphNode_CompleteTooltip", "* This Node will be added to the graph automatically.\n* This Node cannot be created manually.\n* This Node cannot be deleted.\n* Does not implement any logic."); #endif - this->MaxChildrenNodes = -1; + this->MaxChildNodes = -1; } #if WITH_EDITOR @@ -37,7 +37,7 @@ bool UComboActionGraphNode_StartNode::ValidateNode(TArray& ValidationsMes { bool bResult = Super::ValidateNode(ValidationsMessages, RichFormat); - if (ChildrenNodes.Num() == 0) + if (this->ChildNodes.Num() == 0) { bResult = false; diff --git a/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h b/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h index fa4cd43..19c1935 100644 --- a/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h +++ b/Source/ComboInput/Public/Nodes/ComboActionGraphNode.h @@ -32,13 +32,13 @@ public: * Array of parent nodes for the current active node in the combo string. *❗ Parent nodes are nodes that have a directed edge pointing to the current active node. */ - UPROPERTY(BlueprintReadOnly, Category="Private") - TArray ParentNodes; + UPROPERTY(BlueprintReadOnly, Category = "Private") + TArray ParentNodes; /** * The array of child nodes of the current dialogue node. */ - UPROPERTY(BlueprintReadOnly, Category="Private") - TArray ChildrenNodes; + UPROPERTY(BlueprintReadOnly, Category = "Private") + TArray ChildNodes; /** * Map of edges connecting this Node in the Combo Action graph. *❗ The key of the map is the source node, and the value is the edge connecting it to its target node. @@ -94,7 +94,7 @@ public: * Can be used to enforce a maximum number of connections for certain types of nodes. */ UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category="Combo Input|Action") - int32 MaxChildrenNodes = -1; + int32 MaxChildNodes = -1; /** * The array of allowed input classes for this Dialogue Node. @@ -126,10 +126,10 @@ public: * Returns how many Children Nodes this Node allows to have. *❔ -1 means no limits. * - * @return MaxChildrenNodes + * @return Max child nodes */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - int32 GetMaxChildNodes() const { return MaxChildrenNodes; } + int32 GetMaxChildNodes() const { return this->MaxChildNodes; } /** @@ -163,23 +163,6 @@ public: UFUNCTION(BlueprintCallable, Category = "Combo Input|Action") class UComboActionGraph *GetGraph() const { return this->Graph; } - - /** - * Gets children Nodes this one has, - *❗ Might be empty - * - * @return Amount of children Nodes - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - FORCEINLINE TArray GetChildrenNodes() const { return ChildrenNodes; } - /** - * Gets how many parent Nodes point to this one - *❗ Might be empty - * - * @return Amount of how parent Nodes - */ - UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action") - FORCEINLINE TArray GetParentNodes() const { return ParentNodes; } /** * Serves purpose of validating Node before Dialogue gets Started. diff --git a/Source/ComboInputEditor/Private/Ed/EdComboActionGraph.cpp b/Source/ComboInputEditor/Private/Ed/EdComboActionGraph.cpp index 66a4d98..c887585 100644 --- a/Source/ComboInputEditor/Private/Ed/EdComboActionGraph.cpp +++ b/Source/ComboInputEditor/Private/Ed/EdComboActionGraph.cpp @@ -63,7 +63,7 @@ void UEdComboActionGraph::RebuildComboActionGraph() if (ChildNode != nullptr) { - ComboActionGraphNode->ChildrenNodes.Add(ChildNode); + ComboActionGraphNode->ChildNodes.Add(ChildNode); ChildNode->ParentNodes.Add(ComboActionGraphNode); } @@ -168,7 +168,7 @@ void UEdComboActionGraph::Clear() { UComboActionGraphNode *MounteaDialogueGraphNode = EdNode->ComboActionGraphNode; MounteaDialogueGraphNode->ParentNodes.Reset(); - MounteaDialogueGraphNode->ChildrenNodes.Reset(); + MounteaDialogueGraphNode->ChildNodes.Reset(); MounteaDialogueGraphNode->Edges.Reset(); } } @@ -194,12 +194,12 @@ void UEdComboActionGraph::SortNodes(UComboActionGraphNode *RootNode) return EdNode_LNode->NodePosX < EdNode_RNode->NodePosX; }; - Node->ChildrenNodes.Sort(Comp); + Node->ChildNodes.Sort(Comp); Node->ParentNodes.Sort(Comp); - for (int j = 0; j < Node->ChildrenNodes.Num(); ++j) + for (int j = 0; j < Node->ChildNodes.Num(); ++j) { - NextLevelNodes.Add(Node->ChildrenNodes[j]); + NextLevelNodes.Add(Node->ChildNodes[j]); } } diff --git a/Source/ComboInputEditor/Private/Layout/ComboActionForceDirectedSolveLayoutStrategy.cpp b/Source/ComboInputEditor/Private/Layout/ComboActionForceDirectedSolveLayoutStrategy.cpp index 7597b61..862d4eb 100644 --- a/Source/ComboInputEditor/Private/Layout/ComboActionForceDirectedSolveLayoutStrategy.cpp +++ b/Source/ComboInputEditor/Private/Layout/ComboActionForceDirectedSolveLayoutStrategy.cpp @@ -113,11 +113,11 @@ FBox2D UComboActionForceDirectedSolveLayoutStrategy::LayoutOneTree(UComboActionG UEdComboActionGraphNode *EdNode_ParentNode = this->EdGraph->NodeMap[Node]; - for (int32 j = 0; j < Node->ChildrenNodes.Num(); j++) + for (int32 j = 0; j < Node->ChildNodes.Num(); j++) { - NextLevelNodes.Add(Node->ChildrenNodes[j]); + NextLevelNodes.Add(Node->ChildNodes[j]); - UEdComboActionGraphNode *EdNode_ChildNode = this->EdGraph->NodeMap[Node->ChildrenNodes[j]]; + UEdComboActionGraphNode *EdNode_ChildNode = this->EdGraph->NodeMap[Node->ChildNodes[j]]; Diff.X = EdNode_ChildNode->NodePosX - EdNode_ParentNode->NodePosY; Diff.Y = EdNode_ChildNode->NodePosY - EdNode_ParentNode->NodePosY; diff --git a/Source/ComboInputEditor/Private/Layout/ComboActionGraphLayoutStrategy.cpp b/Source/ComboInputEditor/Private/Layout/ComboActionGraphLayoutStrategy.cpp index 26f882f..79719a4 100644 --- a/Source/ComboInputEditor/Private/Layout/ComboActionGraphLayoutStrategy.cpp +++ b/Source/ComboInputEditor/Private/Layout/ComboActionGraphLayoutStrategy.cpp @@ -52,7 +52,7 @@ FBox2D UComboActionGraphLayoutStrategy::GetActualBounds(UComboActionGraphNode *R Rtn += GetNodeBound(this->EdGraph->NodeMap[Node]); - for (UComboActionGraphNode *ChildNode : Node->ChildrenNodes) + for (UComboActionGraphNode *ChildNode : Node->ChildNodes) { NextLevelNodes.Add(ChildNode); } @@ -82,7 +82,7 @@ void UComboActionGraphLayoutStrategy::RandomLayoutOneTree(UComboActionGraphNode EdNode_Node->NodePosX = UKismetMathLibrary::RandomFloatInRange(Bound.Min.X, Bound.Max.X); EdNode_Node->NodePosY = UKismetMathLibrary::RandomFloatInRange(Bound.Min.Y, Bound.Max.Y); - for (UComboActionGraphNode *ChildNode : Node->ChildrenNodes) + for (UComboActionGraphNode *ChildNode : Node->ChildNodes) { NextLevelNodes.Add(ChildNode); } diff --git a/Source/ComboInputEditor/Private/Layout/ComboActionTreeSolveLayoutStrategy.cpp b/Source/ComboInputEditor/Private/Layout/ComboActionTreeSolveLayoutStrategy.cpp index aded740..6b01895 100644 --- a/Source/ComboInputEditor/Private/Layout/ComboActionTreeSolveLayoutStrategy.cpp +++ b/Source/ComboInputEditor/Private/Layout/ComboActionTreeSolveLayoutStrategy.cpp @@ -66,13 +66,13 @@ void UComboActionTreeSolveLayoutStrategy::InitPass(UComboActionGraphNode *RootNo UEdComboActionGraphNode *EdNode_RootNode = this->EdGraph->NodeMap[RootNode]; FVector2D ChildAnchor(FVector2D(0.0f, this->GetNodeHeight(EdNode_RootNode) + this->OptimalDistance + Anchor.Y)); - for (int32 i = 0; i < RootNode->ChildrenNodes.Num(); i++) + for (int32 i = 0; i < RootNode->ChildNodes.Num(); i++) { - UComboActionGraphNode *Child = RootNode->ChildrenNodes[i]; + UComboActionGraphNode *Child = RootNode->ChildNodes[i]; UEdComboActionGraphNode *EdNode_ChildNode = this->EdGraph->NodeMap[Child]; if (i > 0) { - UComboActionGraphNode *PreChild = RootNode->ChildrenNodes[i - 1]; + UComboActionGraphNode *PreChild = RootNode->ChildNodes[i - 1]; UEdComboActionGraphNode *EdNode_PreChildNode = this->EdGraph->NodeMap[PreChild]; ChildAnchor.X += this->OptimalDistance + this->GetNodeWidth(EdNode_PreChildNode) / 2; } @@ -83,7 +83,7 @@ void UComboActionTreeSolveLayoutStrategy::InitPass(UComboActionGraphNode *RootNo float NodeWidth = this->GetNodeWidth(EdNode_RootNode); EdNode_RootNode->NodePosY = Anchor.Y; - if (RootNode->ChildrenNodes.Num() == 0) + if (RootNode->ChildNodes.Num() == 0) { EdNode_RootNode->NodePosX = Anchor.X - NodeWidth / 2; } @@ -96,9 +96,9 @@ void UComboActionTreeSolveLayoutStrategy::InitPass(UComboActionGraphNode *RootNo bool UComboActionTreeSolveLayoutStrategy::ResolveConflictPass(UComboActionGraphNode *Node) { bool HasConflict = false; - for (int32 i = 0; i < Node->ChildrenNodes.Num(); ++i) + for (int32 i = 0; i < Node->ChildNodes.Num(); ++i) { - UComboActionGraphNode *Child = Node->ChildrenNodes[i]; + UComboActionGraphNode *Child = Node->ChildNodes[i]; if (this->ResolveConflictPass(Child)) { HasConflict = true; @@ -107,7 +107,7 @@ bool UComboActionTreeSolveLayoutStrategy::ResolveConflictPass(UComboActionGraphN for (const UComboActionGraphNode *ParentNode : Node->ParentNodes) { - for (UComboActionGraphNode *LeftSibling : ParentNode->ChildrenNodes) + for (UComboActionGraphNode *LeftSibling : ParentNode->ChildNodes) { if (LeftSibling == Node) { @@ -183,7 +183,7 @@ void UComboActionTreeSolveLayoutStrategy::GetLeftContour(UComboActionGraphNode * Contour[Level] = EdNode_Node; } - for (UComboActionGraphNode *Child : RootNode->ChildrenNodes) + for (UComboActionGraphNode *Child : RootNode->ChildNodes) { this->GetLeftContour(Child, Level + 1, Contour); } @@ -201,7 +201,7 @@ void UComboActionTreeSolveLayoutStrategy::GetRightContour(UComboActionGraphNode Contour[Level] = EdNode_Node; } - for (UComboActionGraphNode *Child : RootNode->ChildrenNodes) + for (UComboActionGraphNode *Child : RootNode->ChildNodes) { this->GetRightContour(Child, Level + 1, Contour); } @@ -213,7 +213,7 @@ void UComboActionTreeSolveLayoutStrategy::ShiftSubTree(UComboActionGraphNode *Ro EdNode_Node->NodePosX += Offset.X; EdNode_Node->NodePosY += Offset.Y; - for (UComboActionGraphNode *Child : RootNode->ChildrenNodes) + for (UComboActionGraphNode *Child : RootNode->ChildNodes) { if (Child->ParentNodes[0] == RootNode) { @@ -225,17 +225,17 @@ void UComboActionTreeSolveLayoutStrategy::ShiftSubTree(UComboActionGraphNode *Ro void UComboActionTreeSolveLayoutStrategy::UpdateParentNodePosition(UComboActionGraphNode *RootNode) { UEdComboActionGraphNode *EdNode_ParentNode = this->EdGraph->NodeMap[RootNode]; - if (RootNode->ChildrenNodes.Num() % 2 == 0) + if (RootNode->ChildNodes.Num() % 2 == 0) { - UEdComboActionGraphNode *FirstChild = this->EdGraph->NodeMap[RootNode->ChildrenNodes[0]]; - UEdComboActionGraphNode *LastChild = this->EdGraph->NodeMap[RootNode->ChildrenNodes.Last()]; + UEdComboActionGraphNode *FirstChild = this->EdGraph->NodeMap[RootNode->ChildNodes[0]]; + UEdComboActionGraphNode *LastChild = this->EdGraph->NodeMap[RootNode->ChildNodes.Last()]; float LeftBound = FirstChild->NodePosX; float RightBound = LastChild->NodePosX + this->GetNodeWidth(LastChild); EdNode_ParentNode->NodePosX = (LeftBound + RightBound) / 2 - this->GetNodeWidth(EdNode_ParentNode) / 2; } else { - UEdComboActionGraphNode *MidChild = this->EdGraph->NodeMap[RootNode->ChildrenNodes[RootNode->ChildrenNodes.Num() / 2]]; + UEdComboActionGraphNode *MidChild = this->EdGraph->NodeMap[RootNode->ChildNodes[RootNode->ChildNodes.Num() / 2]]; EdNode_ParentNode->NodePosX = MidChild->NodePosX + this->GetNodeWidth(MidChild) / 2 - this->GetNodeWidth(EdNode_ParentNode) / 2; } }