|
24 | 24 | import lol.hyper.customlauncher.updater.UpdateChecker;
|
25 | 25 | import lol.hyper.githubreleaseapi.GitHubRelease;
|
26 | 26 | import lol.hyper.githubreleaseapi.GitHubReleaseAPI;
|
| 27 | +import org.apache.commons.lang3.SystemUtils; |
27 | 28 | import org.apache.logging.log4j.LogManager;
|
28 | 29 | import org.apache.logging.log4j.Logger;
|
29 | 30 | import org.json.JSONArray;
|
| 31 | +import org.json.JSONObject; |
30 | 32 |
|
31 | 33 | import javax.imageio.ImageIO;
|
32 | 34 | import javax.swing.*;
|
@@ -73,6 +75,21 @@ public static void main(String[] args) throws IOException, InterruptedException
|
73 | 75 | if (!TTR_INSTALL_DIR.exists()) {
|
74 | 76 | Files.createDirectory(TTR_INSTALL_DIR.toPath());
|
75 | 77 | logger.info("Creating TTR install folder at " + TTR_INSTALL_DIR.getAbsolutePath());
|
| 78 | + JSONObject options = new JSONObject(); |
| 79 | + // TTR on linux has a bug with fullscreen mode |
| 80 | + // we set TTR to be windowed mode on first launch |
| 81 | + // the user can always change this |
| 82 | + if (SystemUtils.IS_OS_LINUX) { |
| 83 | + JSONObject videoSettings = new JSONObject(); |
| 84 | + videoSettings.put("display-mode", "window"); |
| 85 | + options.put("video", videoSettings); |
| 86 | + } |
| 87 | + // lower the game audio so the user doesn't die when it launches |
| 88 | + JSONObject audioSettings = new JSONObject(); |
| 89 | + audioSettings.put("music-volume", 10); |
| 90 | + audioSettings.put("sfx-volume", 10); |
| 91 | + options.put("audio", audioSettings); |
| 92 | + JSONManager.writeFile(options, new File("ttr-files/settings.json")); |
76 | 93 | }
|
77 | 94 |
|
78 | 95 | // load the icon
|
|
0 commit comments