mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
Only update graph when hitting button or sending command, for now
This commit is contained in:
parent
2a0e2e46bb
commit
5161a8563e
6 changed files with 31 additions and 14 deletions
1
arrow.gd
1
arrow.gd
|
@ -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
|
||||
|
|
3
main.gd
3
main.gd
|
@ -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()
|
||||
|
|
1
node.gd
1
node.gd
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue