feat: connection lines
This commit is contained in:
BIN
Content/UI/WBP_SkillTree.uasset
(Stored with Git LFS)
BIN
Content/UI/WBP_SkillTree.uasset
(Stored with Git LFS)
Binary file not shown.
@@ -257,9 +257,6 @@ int32 USkillTreeConnectionsWidget::NativePaint(
|
||||
TArray<FSkillNodeInfo> NodeInfoList;
|
||||
BuildNodeInfoList(NodeInfoList);
|
||||
|
||||
// Get this widget's absolute position to convert coordinates
|
||||
FVector2D ConnectionsWidgetAbsolutePosition = AllottedGeometry.GetAbsolutePosition();
|
||||
|
||||
// Draw lines for each node's prerequisites
|
||||
for (const FSkillNodeInfo& DependentNode : NodeInfoList)
|
||||
{
|
||||
@@ -277,9 +274,9 @@ int32 USkillTreeConnectionsWidget::NativePaint(
|
||||
if (!PrereqNode)
|
||||
continue;
|
||||
|
||||
// Convert absolute positions to local coordinates relative to this widget
|
||||
FVector2D PrereqLocalPos = PrereqNode->Position - ConnectionsWidgetAbsolutePosition;
|
||||
FVector2D DependentLocalPos = DependentNode.Position - ConnectionsWidgetAbsolutePosition;
|
||||
// Convert absolute/screen positions to local space of this widget using Slate geometry
|
||||
FVector2D PrereqLocalPos = AllottedGeometry.AbsoluteToLocal(PrereqNode->Position);
|
||||
FVector2D DependentLocalPos = AllottedGeometry.AbsoluteToLocal(DependentNode.Position);
|
||||
|
||||
// Draw line from prerequisite to dependent
|
||||
TArray<FVector2D> LinePoints;
|
||||
|
||||
Reference in New Issue
Block a user