Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
feat: only allow exporting or executing game when data file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
joelgomes1994 committed Jun 17, 2022
1 parent e3e42d6 commit 3a24f8f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scenes/editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ func _update_task_buttons() -> void:
var cur_dir: Directory = Directory.new()
var _error = cur_dir.open(globals.current_project_dir)
var python_valid = _get_python_current_os() and true
var data_file_valid = cur_dir.file_exists(project["DataFile"])

var tooltip = "" if python_valid else "Python executable for current platform must be set first."

Expand All @@ -426,8 +427,15 @@ func _update_task_buttons() -> void:
if python_valid:

if cur_dir.file_exists(project["Python" + platform]) and cur_dir.file_exists(project["Engine" + platform]):
button_export.disabled = false
button_run.disabled = false

if data_file_valid:
button_export.disabled = false
button_run.disabled = false

else:
button_export.disabled = true
button_run.disabled = true
cur_tooltip = "Build the game data first to run or export."

else:
button_export.disabled = true
Expand Down

0 comments on commit 3a24f8f

Please sign in to comment.