JHRGB/map_select/Button.gd
2023-12-04 19:20:43 +00:00

18 lines
387 B
GDScript

extends Button
@export_file var map_path
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _on_pressed():
if map_path==null:
return
var sim = load("res://sim.tscn").instantiate()
var map = load(map_path).new()
map.create_map(sim)
get_tree().root.add_child(sim)
get_node("/root/MapSelect").queue_free()