add three blank elements to the list
authorEduardo <[email protected]>
Thu, 28 Sep 2023 16:45:11 +0000 (18:45 +0200)
committerEduardo <[email protected]>
Thu, 28 Sep 2023 16:45:11 +0000 (18:45 +0200)
(checkbox is still visible!!)

custom_elements/todo_list_elements/todo_element.gd
scenes/todo_list/ToDoList.gd

index 3e99e5fda3d5ca582394afc679afa0a80585b2fa..6a19d11ae1912671fb40e804b70851ea35582ac9 100644 (file)
@@ -36,3 +36,4 @@ func set_text(text: String):
 
 func destroy_self():
        queue_free()
+
index ee6caa04ac19df48c524f67659fea3d090daaf7b..652c8c2ddec7fe67fe3ed3c7aaf26b637c124fdc 100644 (file)
@@ -35,9 +35,17 @@ func DEBUG_put_lots_of_tasks(how_many: int):
        for i in range(how_many):
                var el = load("res://custom_elements/todo_list_elements/todo_element.tscn").instantiate()
                reorderable_list.call_deferred("add_child", el)
-               el.call_deferred("set_stars", randi_range(1, 3))
+               el.call_deferred("set_priority", randi_range(1, 3))
                el.call_deferred("set_text", text_arr[randi_range(0, text_arr.size() - 1)])
 
+func _add_empty_entry_at_bottom(how_many: int):
+               for i in range(how_many):
+                       var el = load("res://custom_elements/todo_list_elements/todo_element.tscn").instantiate()
+                       reorderable_list.call_deferred("add_child", el)
+                       el.call_deferred("set_priority", 0)
+                       el.call_deferred("set_text", "")
+
 func _on_ready():
        bg = Thread.new()
+       bg.start(_add_empty_entry_at_bottom.bind(3))
        #bg.start(DEBUG_put_lots_of_tasks.bind(50))