Only update graph when hitting button or sending command, for now

This commit is contained in:
Sebastian Morr 2020-09-01 19:32:33 +02:00
parent 2a0e2e46bb
commit 5161a8563e
6 changed files with 31 additions and 14 deletions

View file

@ -8,6 +8,7 @@ func _ready():
pass
func _process(delta):
if repository.objects.has(target):
var t = repository.objects[target]
#print(t)
$Line.points[1] = t.global_position - global_position

View file

@ -16,6 +16,9 @@ func _ready():
server = TCP_Server.new()
server.listen(1234)
# Load first level.
load_level(0)
func list_levels():
var levels = []
var dir = Directory.new()

View file

@ -14,6 +14,7 @@ func _ready():
func _process(delta):
for c in children.keys():
if get_node("..").objects.has(c):
var other = get_node("..").objects[c]
var d = other.position.distance_to(position)
var dir = (other.position - position).normalized()

View file

@ -10,20 +10,20 @@ func _ready():
func _process(delta):
if path:
update_everything()
apply_forces()
func update_everything():
update_head()
update_refs()
update_index()
update_objects()
apply_forces()
func set_path(new_path):
path = new_path
for o in objects.values():
o.queue_free()
objects = {}
update_everything()
func get_path():
return path

View file

@ -25,3 +25,14 @@ text = "Index:"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Button" type="Button" parent="."]
margin_left = 36.5602
margin_top = 67.9891
margin_right = 94.5602
margin_bottom = 109.989
text = "Update"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="Button" to="." method="update_everything"]

View file

@ -12,3 +12,4 @@ func run_command_in_a_thread(command):
$Input.text = ""
$Output.text = $Output.text + "$ " + command + "\n" + output
$Output.scroll_vertical = 999999
$"../ActiveRepository".update_everything()