From 47f412d3d855ce8bdc4410d3e70b68d76aec870d Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Thu, 24 Sep 2020 10:25:38 +0200 Subject: [PATCH] Prettier arrow positions --- arrow.gd | 6 ++++-- arrow.tscn | 4 ++-- main.gd | 3 ++- repository.tscn | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arrow.gd b/arrow.gd index fb49385..61c5a48 100644 --- a/arrow.gd +++ b/arrow.gd @@ -28,8 +28,10 @@ func _process(_delta): $Target.show() $Line.points[1] = end - repository.objects[source].position - $Label.position = ($Line.points[0] + $Line.points[1])/1.3 - $Tip.position = ($Line.points[0] + $Line.points[1])/1.3 + # Move the tip away from the object a bit. + $Line.points[1] -= $Line.points[1].normalized()*30 + #$Label.position = ($Line.points[0] + $Line.points[1])/1.3 + $Tip.position = $Line.points[1] $Tip.rotation = PI+$Line.points[0].angle_to($Line.points[1]) func label_set(new_label): diff --git a/arrow.tscn b/arrow.tscn index 84263e2..8399df8 100644 --- a/arrow.tscn +++ b/arrow.tscn @@ -13,11 +13,11 @@ points = PoolVector2Array( -0.480499, -0.11055, 158.301, 0.581757 ) default_color = Color( 0.2, 0.2, 0.2, 1 ) [node name="Tip" type="Node2D" parent="."] -position = Vector2( 149.835, 0.290878 ) +position = Vector2( 158.06, 0.290878 ) z_index = 1 [node name="Polygon" type="Polygon2D" parent="Tip"] -position = Vector2( -9.66138, -2.89842 ) +position = Vector2( -24.7164, -6.37881 ) z_index = -1 color = Color( 0.2, 0.2, 0.2, 1 ) polygon = PoolVector2Array( -8.50021, 20.4619, 36.1874, 8.44903, 0.869781, -21.8232 ) diff --git a/main.gd b/main.gd index 9449d6d..319d017 100644 --- a/main.gd +++ b/main.gd @@ -152,7 +152,8 @@ func construct_repo(script_content, path): game.global_shell.cd(path) game.global_shell.run("git init") game.global_shell.run("git symbolic-ref HEAD refs/heads/main") - game.global_shell.run("sh "+script_path) + # Read stdin from /dev/null so that interactive commands don't block. + game.global_shell.run("bash "+script_path+"