[Resolved] Trying to load file with a popup in editor, and its asking if I want to overwrite?

Godot Version 4.2

This has been resolved!

Hi all, I’m working on a simple custom plugin to make branching dialogue in a way that I need. So far the plugin itself has been great, but I am having trouble with a save/load feature. I finished the save feature, no issues there. But the load feature has a weird “bug” that I am not sure what to do with.

When I want to load a dialogue, I make a popup to search through my assets then I can select a file. When I hit OK, it then pops up another window asking if I want to overwrite the file. But I have no idea why it would be asking me about overwriting if I am loading. As far as I can tell all my code is correct too, so no idea where the issue is.

func _load_dialogue():
	var file_dialogue = FileDialog.new()
	file_dialogue.clear_filters()
	file_dialogue.mode = FileDialog.FILE_MODE_OPEN_FILE
	file_dialogue.access = FileDialog.ACCESS_FILESYSTEM
	file_dialogue.filters = ["*.tres ; Tres Files"]
	file_dialogue.set_size(Vector2(800, 600))
	add_child(file_dialogue)
	file_dialogue.connect("file_selected", _on_file_loaded)
	
	file_dialogue.popup()

All the code here works just fine, no real issues at all. It even triggers the next func in the sequence properly. I get the path info that I need, so it is all loading properly. I just don’t know why the popup is happening asking to overwrite a file. Any help at all would be great!

You’re using the wrong property, it’s file_mode not mode, the mode property is of Window

That seems to have done it! Thanks! I had a feeling it was something tiny I overlooked haha

If the problem is solved, please mark it as such

1 Like

By marking it as resolved you need to mark my comment above as the solution, not editing the title

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.