I had a similar idea again, but now have a bit more of an idea how to go about it.
I instantiate the foreign scene and go through its children and populate a dropdown with the potential paths to choose from.
This is what I got so far:
@tool
class_name MapConnectionMarker
extends Marker2D
@export_file("*.tscn") var map_path: String: set = set_map_path
@export_custom(PROPERTY_HINT_ENUM, "") var connection: String
@export_tool_button("Regenerate List", "Marker2D") var regenerate_list_action = regenerate_list
func set_map_path(value: String) -> void:
map_path = value
regenerate_list()
func regenerate_list() -> void:
if not map_path:
return # TODO: clear list
var map: Map = load(map_path).instantiate()
for child in map.find_children("*", "MapConnectionMarker"):
child.get_path()
# TODO: where to add the paths to so they appear in the dropdown?