Add feature request #276 (#370)

* Add request #276

* Remove a warning message

* Some fixes

* Bug fix. Remove Global.save_project_to_recent_list() from src/Main.gd

Co-authored-by: Daniel Simon <dasimon@gmx.org>
This commit is contained in:
dasimonde 2020-10-26 21:51:55 +01:00 committed by GitHub
parent d85efce73a
commit 7126074a0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 4 deletions

View file

@ -143,6 +143,21 @@ func load_last_project() -> void:
Global.dialog_open(true)
func load_recent_project_file(path : String) -> void:
if OS.get_name() == "HTML5":
return
# Check if file still exists on disk
var file_check := File.new()
if file_check.file_exists(path): # If yes then load the file
OpenSave.handle_loading_files([path])
else:
# If file doesn't exist on disk then warn user about this
Global.error_dialog.set_text("Cannot find project file.")
Global.error_dialog.popup_centered()
Global.dialog_open(true)
func _on_OpenSprite_file_selected(path : String) -> void:
OpenSave.handle_loading_files([path])