Prettier arrow positions

This commit is contained in:
Sebastian Morr 2020-09-24 10:25:38 +02:00
parent c6bd66559a
commit 47f412d3d8
4 changed files with 11 additions and 8 deletions

View file

@ -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):

View file

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

View file

@ -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+" </dev/null")
func show_win_status():
next_level_button.show()

View file

@ -22,7 +22,7 @@ mouse_filter = 1
[node name="RepoVis" type="Control" parent="VSplitContainer"]
margin_right = 1920.0
margin_bottom = 894.0
margin_bottom = 994.0
mouse_filter = 1
size_flags_vertical = 3
__meta__ = {
@ -98,11 +98,11 @@ __meta__ = {
[node name="FileBrowser" parent="VSplitContainer" instance=ExtResource( 4 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 906.0
margin_top = 1006.0
margin_right = 1920.0
margin_bottom = 1080.0
size_flags_vertical = 3
size_flags_stretch_ratio = 0.2
size_flags_stretch_ratio = 0.08
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="VSplitContainer/RepoVis/Button" to="." method="update_everything"]