mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
Prettier arrow positions
This commit is contained in:
parent
c6bd66559a
commit
47f412d3d8
4 changed files with 11 additions and 8 deletions
6
arrow.gd
6
arrow.gd
|
@ -28,8 +28,10 @@ func _process(_delta):
|
||||||
$Target.show()
|
$Target.show()
|
||||||
|
|
||||||
$Line.points[1] = end - repository.objects[source].position
|
$Line.points[1] = end - repository.objects[source].position
|
||||||
$Label.position = ($Line.points[0] + $Line.points[1])/1.3
|
# Move the tip away from the object a bit.
|
||||||
$Tip.position = ($Line.points[0] + $Line.points[1])/1.3
|
$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])
|
$Tip.rotation = PI+$Line.points[0].angle_to($Line.points[1])
|
||||||
|
|
||||||
func label_set(new_label):
|
func label_set(new_label):
|
||||||
|
|
|
@ -13,11 +13,11 @@ points = PoolVector2Array( -0.480499, -0.11055, 158.301, 0.581757 )
|
||||||
default_color = Color( 0.2, 0.2, 0.2, 1 )
|
default_color = Color( 0.2, 0.2, 0.2, 1 )
|
||||||
|
|
||||||
[node name="Tip" type="Node2D" parent="."]
|
[node name="Tip" type="Node2D" parent="."]
|
||||||
position = Vector2( 149.835, 0.290878 )
|
position = Vector2( 158.06, 0.290878 )
|
||||||
z_index = 1
|
z_index = 1
|
||||||
|
|
||||||
[node name="Polygon" type="Polygon2D" parent="Tip"]
|
[node name="Polygon" type="Polygon2D" parent="Tip"]
|
||||||
position = Vector2( -9.66138, -2.89842 )
|
position = Vector2( -24.7164, -6.37881 )
|
||||||
z_index = -1
|
z_index = -1
|
||||||
color = Color( 0.2, 0.2, 0.2, 1 )
|
color = Color( 0.2, 0.2, 0.2, 1 )
|
||||||
polygon = PoolVector2Array( -8.50021, 20.4619, 36.1874, 8.44903, 0.869781, -21.8232 )
|
polygon = PoolVector2Array( -8.50021, 20.4619, 36.1874, 8.44903, 0.869781, -21.8232 )
|
||||||
|
|
3
main.gd
3
main.gd
|
@ -152,7 +152,8 @@ func construct_repo(script_content, path):
|
||||||
game.global_shell.cd(path)
|
game.global_shell.cd(path)
|
||||||
game.global_shell.run("git init")
|
game.global_shell.run("git init")
|
||||||
game.global_shell.run("git symbolic-ref HEAD refs/heads/main")
|
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():
|
func show_win_status():
|
||||||
next_level_button.show()
|
next_level_button.show()
|
||||||
|
|
|
@ -22,7 +22,7 @@ mouse_filter = 1
|
||||||
|
|
||||||
[node name="RepoVis" type="Control" parent="VSplitContainer"]
|
[node name="RepoVis" type="Control" parent="VSplitContainer"]
|
||||||
margin_right = 1920.0
|
margin_right = 1920.0
|
||||||
margin_bottom = 894.0
|
margin_bottom = 994.0
|
||||||
mouse_filter = 1
|
mouse_filter = 1
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
|
@ -98,11 +98,11 @@ __meta__ = {
|
||||||
[node name="FileBrowser" parent="VSplitContainer" instance=ExtResource( 4 )]
|
[node name="FileBrowser" parent="VSplitContainer" instance=ExtResource( 4 )]
|
||||||
anchor_right = 0.0
|
anchor_right = 0.0
|
||||||
anchor_bottom = 0.0
|
anchor_bottom = 0.0
|
||||||
margin_top = 906.0
|
margin_top = 1006.0
|
||||||
margin_right = 1920.0
|
margin_right = 1920.0
|
||||||
margin_bottom = 1080.0
|
margin_bottom = 1080.0
|
||||||
size_flags_vertical = 3
|
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_entered" from="." to="." method="_on_mouse_entered"]
|
||||||
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
|
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
|
||||||
[connection signal="pressed" from="VSplitContainer/RepoVis/Button" to="." method="update_everything"]
|
[connection signal="pressed" from="VSplitContainer/RepoVis/Button" to="." method="update_everything"]
|
||||||
|
|
Loading…
Reference in a new issue