File tree Expand file tree Collapse file tree
game/src/main/java/mygame Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 targetCompatibility = JavaVersion . VERSION_11
99}
1010
11+ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
12+ Boolean isMacOS = DefaultNativePlatform . currentOperatingSystem. isMacOsX()
13+
1114tasks. withType(JavaExec ) { // Java runtime options:
15+ if (isMacOS) {
16+ args ' --noDialog'
17+ jvmArgs ' -XstartOnFirstThread'
18+ }
1219 enableAssertions = true
1320}
1421
Original file line number Diff line number Diff line change @@ -45,9 +45,17 @@ public class Main extends GameApplication {
4545
4646 /**
4747 * Start the jMonkeyEngine application
48- * @param args
48+ *
49+ * @param args might contain "--noDialog"
4950 */
5051 public static void main (String [] args ) {
52+ boolean showSettingsDialog = true ;
53+ for (String arg : args ) {
54+ if (arg .equals ("--noDialog" )) {
55+ showSettingsDialog = false ;
56+ }
57+ }
58+
5159 // Mute the chatty loggers in certain packages.
5260 Heart .setLoggingLevels (Level .WARNING );
5361
@@ -65,7 +73,7 @@ public static void main(String[] args) {
6573 //settings.setFrameRate(60);
6674
6775 app .setSettings (settings );
68- app .setShowSettings (true );
76+ app .setShowSettings (showSettingsDialog );
6977 app .setPauseOnLostFocus (false );
7078 app .start ();
7179 }
You can’t perform that action at this time.
0 commit comments