Skip to content

Commit 14d98f7

Browse files
Catizardseraxis
authored andcommitted
Allow macos user launch the game without opening the javafx window first
1 parent ad4ff24 commit 14d98f7

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

core/src/bms/player/beatoraja/MainLoader.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
import java.util.logging.Level;
99
import java.util.logging.LogManager;
1010

11+
import com.badlogic.gdx.scenes.scene2d.utils.UIUtils;
1112
import de.damios.guacamole.gdx.log.LoggerService;
13+
import javafx.application.Platform;
1214
import org.slf4j.Logger;
1315
import org.slf4j.LoggerFactory;
1416
import org.slf4j.Logger;
@@ -111,7 +113,14 @@ public static void main(String[] args) {
111113

112114
if (Files.exists(Config.configpath) && (bmsPath != null || auto != null)) {
113115
IRConnectionManager.getAllAvailableIRConnectionName();
114-
play(bmsPath, auto, true, null, null, bmsPath != null);
116+
if (UIUtils.isMac) {
117+
BMSPlayerMode finalAuto = auto;
118+
Platform.runLater(() -> {
119+
play(bmsPath, finalAuto, true, null, null, bmsPath != null);
120+
});
121+
} else {
122+
play(bmsPath, auto, true, null, null, bmsPath != null);
123+
}
115124
} else {
116125
launch(args);
117126
}

0 commit comments

Comments
 (0)