utilities.gd 1014 B

123456789101112131415161718192021
  1. extends Node
  2. var nodes := {} #stores all scenes that can be loaded as utilities
  3. # Called when the node enters the scene tree for the first time.
  4. func _ready() -> void:
  5. #check utilities folder for all scenes and load into nodes dictionary
  6. #var dir = DirAccess.open("res://scenes/Nodes/utilities/")
  7. #if dir:
  8. #for file in dir.get_files():
  9. #if file.ends_with(".tscn"):
  10. #var name = file.get_basename()
  11. #var path = "res://scenes/Nodes/utilities/" + file
  12. #nodes[name] = load(path)
  13. nodes["calculator"] = load("res://scenes/Nodes/utilities/calculator.tscn")
  14. nodes["convert_time"] = load("res://scenes/Nodes/utilities/convert_time.tscn")
  15. nodes["inputfile"] = load("res://scenes/Nodes/utilities/inputfile.tscn")
  16. nodes["notes"] = load("res://scenes/Nodes/utilities/notes.tscn")
  17. nodes["note_to_hz"] = load("res://scenes/Nodes/utilities/note_to_hz.tscn")
  18. nodes["outputfile"] = load("res://scenes/Nodes/utilities/outputfile.tscn")
  19. nodes["preview"] = load("res://scenes/Nodes/utilities/preview.tscn")