Refactor arrow scene, give it reversibility and color

This commit is contained in:
Sebastian Morr 2020-10-29 16:59:46 +01:00
parent 6b612c083d
commit 25d8905df8
6 changed files with 41 additions and 138 deletions
scenes

View file

@ -15,7 +15,6 @@ var hovered = false
var start_pos = null
var arrow = preload("res://scenes/arrow.tscn")
var time_arrow = preload("res://scenes/time_arrow.tscn")
func _ready():
content_set(content)
@ -101,9 +100,13 @@ func children_set(new_children):
if not children.has(c):
var a = arrow.instance()
if type == "commit":
a = time_arrow.instance()
a.source = id
a.target = c
#a = time_arrow.instance()
a.source = c
a.target = id
a.color = Color("c2bf26")
else:
a.source = id
a.target = c
a.repository = repository
$Arrows.add_child(a)
children = new_children