Fixed some grammar issues with the variable names that were annoying me.
This commit is contained in:
parent
b7d299f8b1
commit
08b89b9d84
@ -51,7 +51,7 @@ void UComboActionGraph::ClearGraph()
|
|||||||
for (UComboActionGraphNode *Node : this->AllNodes)
|
for (UComboActionGraphNode *Node : this->AllNodes)
|
||||||
{
|
{
|
||||||
Node->ParentNodes.Empty();
|
Node->ParentNodes.Empty();
|
||||||
Node->ChildrenNodes.Empty();
|
Node->ChildNodes.Empty();
|
||||||
Node->Edges.Empty();
|
Node->Edges.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,7 @@ bool UComboActionGraphNode::CanCreateConnection(UComboActionGraphNode *Other, en
|
|||||||
ErrorMessage = FText::FromString("Invalid Other Node!");
|
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 =
|
const FString TextReturn =
|
||||||
FString(Other->GetNodeTitle().ToString()).
|
FString(Other->GetNodeTitle().ToString()).
|
||||||
@ -143,7 +143,7 @@ bool UComboActionGraphNode::ValidateNode(TArray<FText> &ValidationsMessages, con
|
|||||||
{
|
{
|
||||||
bool bResult = true;
|
bool bResult = true;
|
||||||
|
|
||||||
if (this->ParentNodes.Num() == 0 && this->ChildrenNodes.Num() == 0)
|
if (this->ParentNodes.Num() == 0 && this->ChildNodes.Num() == 0)
|
||||||
{
|
{
|
||||||
bResult = false;
|
bResult = false;
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ void UComboActionGraphNode::OnPasted()
|
|||||||
this->NodeGUID = FGuid::NewGuid();
|
this->NodeGUID = FGuid::NewGuid();
|
||||||
|
|
||||||
this->ParentNodes.Empty();
|
this->ParentNodes.Empty();
|
||||||
this->ChildrenNodes.Empty();
|
this->ChildNodes.Empty();
|
||||||
this->Edges.Empty();
|
this->Edges.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ UComboActionGraphNode_ActionNode::UComboActionGraphNode_ActionNode()
|
|||||||
this->AllowedInputClasses.Add(UComboActionGraphNode_StartNode::StaticClass());
|
this->AllowedInputClasses.Add(UComboActionGraphNode_StartNode::StaticClass());
|
||||||
this->AllowedInputClasses.Add(UComboActionGraphNode_ActionNode::StaticClass());
|
this->AllowedInputClasses.Add(UComboActionGraphNode_ActionNode::StaticClass());
|
||||||
|
|
||||||
this->MaxChildrenNodes = -1;
|
this->MaxChildNodes = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UComboActionGraphNode_ActionNode::PreProcessNode(const TScriptInterface<IComboActionGraphManagerInterface> &Manager)
|
void UComboActionGraphNode_ActionNode::PreProcessNode(const TScriptInterface<IComboActionGraphManagerInterface> &Manager)
|
||||||
|
|||||||
@ -45,7 +45,7 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNodeRuntime_Implementation()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes)
|
if (this->MaxChildNodes > -1 && this->ChildNodes.Num() > this->MaxChildNodes)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray<FText> &Validatio
|
|||||||
ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn));
|
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("* ")
|
const FString RichTextReturn = FString("* ")
|
||||||
.Append("<RichTextBlock.Bold>")
|
.Append("<RichTextBlock.Bold>")
|
||||||
@ -121,12 +121,12 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray<FText> &Validatio
|
|||||||
.Append("</>")
|
.Append("</>")
|
||||||
.Append(": Has more than ")
|
.Append(": Has more than ")
|
||||||
.Append("<RichTextBlock.Bold>")
|
.Append("<RichTextBlock.Bold>")
|
||||||
.Append(FString::FromInt(this->MaxChildrenNodes))
|
.Append(FString::FromInt(this->MaxChildNodes))
|
||||||
.Append("</>")
|
.Append("</>")
|
||||||
.Append(" child nodes!");
|
.Append(" child nodes!");
|
||||||
|
|
||||||
const FString TextReturn = FString(this->NodeTitle.ToString())
|
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));
|
ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.");
|
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
|
#endif
|
||||||
|
|
||||||
this->MaxChildrenNodes = -1;
|
this->MaxChildNodes = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WITH_EDITOR
|
#if WITH_EDITOR
|
||||||
@ -37,7 +37,7 @@ bool UComboActionGraphNode_StartNode::ValidateNode(TArray<FText>& ValidationsMes
|
|||||||
{
|
{
|
||||||
bool bResult = Super::ValidateNode(ValidationsMessages, RichFormat);
|
bool bResult = Super::ValidateNode(ValidationsMessages, RichFormat);
|
||||||
|
|
||||||
if (ChildrenNodes.Num() == 0)
|
if (this->ChildNodes.Num() == 0)
|
||||||
{
|
{
|
||||||
bResult = false;
|
bResult = false;
|
||||||
|
|
||||||
|
|||||||
@ -32,13 +32,13 @@ public:
|
|||||||
* Array of parent nodes for the current active node in the combo string.
|
* 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.
|
*❗ Parent nodes are nodes that have a directed edge pointing to the current active node.
|
||||||
*/
|
*/
|
||||||
UPROPERTY(BlueprintReadOnly, Category="Private")
|
UPROPERTY(BlueprintReadOnly, Category = "Private")
|
||||||
TArray<class UComboActionGraphNode*> ParentNodes;
|
TArray<class UComboActionGraphNode *> ParentNodes;
|
||||||
/**
|
/**
|
||||||
* The array of child nodes of the current dialogue node.
|
* The array of child nodes of the current dialogue node.
|
||||||
*/
|
*/
|
||||||
UPROPERTY(BlueprintReadOnly, Category="Private")
|
UPROPERTY(BlueprintReadOnly, Category = "Private")
|
||||||
TArray<class UComboActionGraphNode*> ChildrenNodes;
|
TArray<class UComboActionGraphNode *> ChildNodes;
|
||||||
/**
|
/**
|
||||||
* Map of edges connecting this Node in the Combo Action graph.
|
* 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.
|
*❗ 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.
|
* Can be used to enforce a maximum number of connections for certain types of nodes.
|
||||||
*/
|
*/
|
||||||
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category="Combo Input|Action")
|
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category="Combo Input|Action")
|
||||||
int32 MaxChildrenNodes = -1;
|
int32 MaxChildNodes = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The array of allowed input classes for this Dialogue Node.
|
* 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.
|
* Returns how many Children Nodes this Node allows to have.
|
||||||
*❔ -1 means no limits.
|
*❔ -1 means no limits.
|
||||||
*
|
*
|
||||||
* @return MaxChildrenNodes
|
* @return Max child nodes
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action")
|
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")
|
UFUNCTION(BlueprintCallable, Category = "Combo Input|Action")
|
||||||
class UComboActionGraph *GetGraph() const { return this->Graph; }
|
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<UComboActionGraphNode*> 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<UComboActionGraphNode*> GetParentNodes() const { return ParentNodes; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serves purpose of validating Node before Dialogue gets Started.
|
* Serves purpose of validating Node before Dialogue gets Started.
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void UEdComboActionGraph::RebuildComboActionGraph()
|
|||||||
|
|
||||||
if (ChildNode != nullptr)
|
if (ChildNode != nullptr)
|
||||||
{
|
{
|
||||||
ComboActionGraphNode->ChildrenNodes.Add(ChildNode);
|
ComboActionGraphNode->ChildNodes.Add(ChildNode);
|
||||||
|
|
||||||
ChildNode->ParentNodes.Add(ComboActionGraphNode);
|
ChildNode->ParentNodes.Add(ComboActionGraphNode);
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ void UEdComboActionGraph::Clear()
|
|||||||
{
|
{
|
||||||
UComboActionGraphNode *MounteaDialogueGraphNode = EdNode->ComboActionGraphNode;
|
UComboActionGraphNode *MounteaDialogueGraphNode = EdNode->ComboActionGraphNode;
|
||||||
MounteaDialogueGraphNode->ParentNodes.Reset();
|
MounteaDialogueGraphNode->ParentNodes.Reset();
|
||||||
MounteaDialogueGraphNode->ChildrenNodes.Reset();
|
MounteaDialogueGraphNode->ChildNodes.Reset();
|
||||||
MounteaDialogueGraphNode->Edges.Reset();
|
MounteaDialogueGraphNode->Edges.Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,12 +194,12 @@ void UEdComboActionGraph::SortNodes(UComboActionGraphNode *RootNode)
|
|||||||
return EdNode_LNode->NodePosX < EdNode_RNode->NodePosX;
|
return EdNode_LNode->NodePosX < EdNode_RNode->NodePosX;
|
||||||
};
|
};
|
||||||
|
|
||||||
Node->ChildrenNodes.Sort(Comp);
|
Node->ChildNodes.Sort(Comp);
|
||||||
Node->ParentNodes.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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,11 +113,11 @@ FBox2D UComboActionForceDirectedSolveLayoutStrategy::LayoutOneTree(UComboActionG
|
|||||||
|
|
||||||
UEdComboActionGraphNode *EdNode_ParentNode = this->EdGraph->NodeMap[Node];
|
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.X = EdNode_ChildNode->NodePosX - EdNode_ParentNode->NodePosY;
|
||||||
Diff.Y = EdNode_ChildNode->NodePosY - EdNode_ParentNode->NodePosY;
|
Diff.Y = EdNode_ChildNode->NodePosY - EdNode_ParentNode->NodePosY;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ FBox2D UComboActionGraphLayoutStrategy::GetActualBounds(UComboActionGraphNode *R
|
|||||||
|
|
||||||
Rtn += GetNodeBound(this->EdGraph->NodeMap[Node]);
|
Rtn += GetNodeBound(this->EdGraph->NodeMap[Node]);
|
||||||
|
|
||||||
for (UComboActionGraphNode *ChildNode : Node->ChildrenNodes)
|
for (UComboActionGraphNode *ChildNode : Node->ChildNodes)
|
||||||
{
|
{
|
||||||
NextLevelNodes.Add(ChildNode);
|
NextLevelNodes.Add(ChildNode);
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ void UComboActionGraphLayoutStrategy::RandomLayoutOneTree(UComboActionGraphNode
|
|||||||
EdNode_Node->NodePosX = UKismetMathLibrary::RandomFloatInRange(Bound.Min.X, Bound.Max.X);
|
EdNode_Node->NodePosX = UKismetMathLibrary::RandomFloatInRange(Bound.Min.X, Bound.Max.X);
|
||||||
EdNode_Node->NodePosY = UKismetMathLibrary::RandomFloatInRange(Bound.Min.Y, Bound.Max.Y);
|
EdNode_Node->NodePosY = UKismetMathLibrary::RandomFloatInRange(Bound.Min.Y, Bound.Max.Y);
|
||||||
|
|
||||||
for (UComboActionGraphNode *ChildNode : Node->ChildrenNodes)
|
for (UComboActionGraphNode *ChildNode : Node->ChildNodes)
|
||||||
{
|
{
|
||||||
NextLevelNodes.Add(ChildNode);
|
NextLevelNodes.Add(ChildNode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,13 +66,13 @@ void UComboActionTreeSolveLayoutStrategy::InitPass(UComboActionGraphNode *RootNo
|
|||||||
UEdComboActionGraphNode *EdNode_RootNode = this->EdGraph->NodeMap[RootNode];
|
UEdComboActionGraphNode *EdNode_RootNode = this->EdGraph->NodeMap[RootNode];
|
||||||
|
|
||||||
FVector2D ChildAnchor(FVector2D(0.0f, this->GetNodeHeight(EdNode_RootNode) + this->OptimalDistance + Anchor.Y));
|
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];
|
UEdComboActionGraphNode *EdNode_ChildNode = this->EdGraph->NodeMap[Child];
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
UComboActionGraphNode *PreChild = RootNode->ChildrenNodes[i - 1];
|
UComboActionGraphNode *PreChild = RootNode->ChildNodes[i - 1];
|
||||||
UEdComboActionGraphNode *EdNode_PreChildNode = this->EdGraph->NodeMap[PreChild];
|
UEdComboActionGraphNode *EdNode_PreChildNode = this->EdGraph->NodeMap[PreChild];
|
||||||
ChildAnchor.X += this->OptimalDistance + this->GetNodeWidth(EdNode_PreChildNode) / 2;
|
ChildAnchor.X += this->OptimalDistance + this->GetNodeWidth(EdNode_PreChildNode) / 2;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ void UComboActionTreeSolveLayoutStrategy::InitPass(UComboActionGraphNode *RootNo
|
|||||||
float NodeWidth = this->GetNodeWidth(EdNode_RootNode);
|
float NodeWidth = this->GetNodeWidth(EdNode_RootNode);
|
||||||
|
|
||||||
EdNode_RootNode->NodePosY = Anchor.Y;
|
EdNode_RootNode->NodePosY = Anchor.Y;
|
||||||
if (RootNode->ChildrenNodes.Num() == 0)
|
if (RootNode->ChildNodes.Num() == 0)
|
||||||
{
|
{
|
||||||
EdNode_RootNode->NodePosX = Anchor.X - NodeWidth / 2;
|
EdNode_RootNode->NodePosX = Anchor.X - NodeWidth / 2;
|
||||||
}
|
}
|
||||||
@ -96,9 +96,9 @@ void UComboActionTreeSolveLayoutStrategy::InitPass(UComboActionGraphNode *RootNo
|
|||||||
bool UComboActionTreeSolveLayoutStrategy::ResolveConflictPass(UComboActionGraphNode *Node)
|
bool UComboActionTreeSolveLayoutStrategy::ResolveConflictPass(UComboActionGraphNode *Node)
|
||||||
{
|
{
|
||||||
bool HasConflict = false;
|
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))
|
if (this->ResolveConflictPass(Child))
|
||||||
{
|
{
|
||||||
HasConflict = true;
|
HasConflict = true;
|
||||||
@ -107,7 +107,7 @@ bool UComboActionTreeSolveLayoutStrategy::ResolveConflictPass(UComboActionGraphN
|
|||||||
|
|
||||||
for (const UComboActionGraphNode *ParentNode : Node->ParentNodes)
|
for (const UComboActionGraphNode *ParentNode : Node->ParentNodes)
|
||||||
{
|
{
|
||||||
for (UComboActionGraphNode *LeftSibling : ParentNode->ChildrenNodes)
|
for (UComboActionGraphNode *LeftSibling : ParentNode->ChildNodes)
|
||||||
{
|
{
|
||||||
if (LeftSibling == Node)
|
if (LeftSibling == Node)
|
||||||
{
|
{
|
||||||
@ -183,7 +183,7 @@ void UComboActionTreeSolveLayoutStrategy::GetLeftContour(UComboActionGraphNode *
|
|||||||
Contour[Level] = EdNode_Node;
|
Contour[Level] = EdNode_Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UComboActionGraphNode *Child : RootNode->ChildrenNodes)
|
for (UComboActionGraphNode *Child : RootNode->ChildNodes)
|
||||||
{
|
{
|
||||||
this->GetLeftContour(Child, Level + 1, Contour);
|
this->GetLeftContour(Child, Level + 1, Contour);
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ void UComboActionTreeSolveLayoutStrategy::GetRightContour(UComboActionGraphNode
|
|||||||
Contour[Level] = EdNode_Node;
|
Contour[Level] = EdNode_Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UComboActionGraphNode *Child : RootNode->ChildrenNodes)
|
for (UComboActionGraphNode *Child : RootNode->ChildNodes)
|
||||||
{
|
{
|
||||||
this->GetRightContour(Child, Level + 1, Contour);
|
this->GetRightContour(Child, Level + 1, Contour);
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ void UComboActionTreeSolveLayoutStrategy::ShiftSubTree(UComboActionGraphNode *Ro
|
|||||||
EdNode_Node->NodePosX += Offset.X;
|
EdNode_Node->NodePosX += Offset.X;
|
||||||
EdNode_Node->NodePosY += Offset.Y;
|
EdNode_Node->NodePosY += Offset.Y;
|
||||||
|
|
||||||
for (UComboActionGraphNode *Child : RootNode->ChildrenNodes)
|
for (UComboActionGraphNode *Child : RootNode->ChildNodes)
|
||||||
{
|
{
|
||||||
if (Child->ParentNodes[0] == RootNode)
|
if (Child->ParentNodes[0] == RootNode)
|
||||||
{
|
{
|
||||||
@ -225,17 +225,17 @@ void UComboActionTreeSolveLayoutStrategy::ShiftSubTree(UComboActionGraphNode *Ro
|
|||||||
void UComboActionTreeSolveLayoutStrategy::UpdateParentNodePosition(UComboActionGraphNode *RootNode)
|
void UComboActionTreeSolveLayoutStrategy::UpdateParentNodePosition(UComboActionGraphNode *RootNode)
|
||||||
{
|
{
|
||||||
UEdComboActionGraphNode *EdNode_ParentNode = this->EdGraph->NodeMap[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 *FirstChild = this->EdGraph->NodeMap[RootNode->ChildNodes[0]];
|
||||||
UEdComboActionGraphNode *LastChild = this->EdGraph->NodeMap[RootNode->ChildrenNodes.Last()];
|
UEdComboActionGraphNode *LastChild = this->EdGraph->NodeMap[RootNode->ChildNodes.Last()];
|
||||||
float LeftBound = FirstChild->NodePosX;
|
float LeftBound = FirstChild->NodePosX;
|
||||||
float RightBound = LastChild->NodePosX + this->GetNodeWidth(LastChild);
|
float RightBound = LastChild->NodePosX + this->GetNodeWidth(LastChild);
|
||||||
EdNode_ParentNode->NodePosX = (LeftBound + RightBound) / 2 - this->GetNodeWidth(EdNode_ParentNode) / 2;
|
EdNode_ParentNode->NodePosX = (LeftBound + RightBound) / 2 - this->GetNodeWidth(EdNode_ParentNode) / 2;
|
||||||
}
|
}
|
||||||
else
|
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;
|
EdNode_ParentNode->NodePosX = MidChild->NodePosX + this->GetNodeWidth(MidChild) / 2 - this->GetNodeWidth(EdNode_ParentNode) / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user