feat: connection lines

This commit is contained in:
2025-10-12 20:36:39 +02:00
parent c4d2334fb7
commit 4213b6e85f
2 changed files with 5 additions and 8 deletions

BIN
Content/UI/WBP_SkillTree.uasset (Stored with Git LFS)

Binary file not shown.

View File

@@ -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;