Skip to content

Commit

Permalink
Fixed macOS problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Martomate committed Jul 26, 2023
1 parent 5e5a8e4 commit 62db63d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,17 @@ func startGame(versionID):
var version = versions[versionID]
var dir = str(OS.get_user_data_dir(), "/versions/", version.name)

var javaArgs = ["-jar", libFilePath, "execute", dir]

if OS.get_name() == "macOS":
javaArgs.append_array([javaCommand, "-XstartOnFirstThread"])
else:
javaArgs.append_array([javaCommand])

javaArgs.append_array(["-jar", version.file_to_run])

var output = []
OS.execute(javaCommand, ["-jar", libFilePath, "execute", dir, javaCommand, "-jar", version.file_to_run], output, true, false)
OS.execute(javaCommand, javaArgs, output, true, false)
OS.delay_msec(1000)
if !output.is_empty() && output[0] != "":
print("Failed to run game. Error: ", output)
Expand Down

0 comments on commit 62db63d

Please sign in to comment.