• Godot Help
  • How to check confirmation of "File exists, overwrite?" subdialog?

How to actually check if user confirmed (or not) file overwriting? Signal "confirmed" is emitted just after first clicking on "OK" button. Relying on it make the whole sub-dialog confirmation idea useless. But I see no other way to communicate with file dialog, except for some tricky hacking, like checking for sub-nodes in the fly. I can't believe it's a oversight in such a usefull component. Or is it?

Edit: I actually did it tricky. I found the sub-dialog node via "Remote" tab in scene viewer and connected applicable signal. But I'm afraid sub-node path will change without warning, maybe from version to version or just with next engine run, I have no guarantee. So it's not a solution, just dirty hack for now.

cybereality Here is relevant code from the root scene node.

func _ready():
	var cd = get_node("MMenu/SaveFileDialog/@@141")
	if cd == null:
		print("Cannot find save confirmation sub-dialog")
		return
	cd.connect("confirmed", self, "onSaveToFileAccepted")
func onSaveToFileAccepted():
	print("Save dialog accepted")
	var dialog = get_node("MMenu/SaveFileDialog")
	if dialog == null:
		print("No save file dialog found!!")
		return
	var cd = get_node("MMenu/SaveFileDialog/@@141")
	if cd == null:
		print("No confirm sub-dialog!")
	if cd.visible:
		print("Wait for extra confirmation...")
		return
	var path = dialog.get_current_path()
	doSaveToFile(path)