From 4ce653687173829daeb4404df1665b6d642a989d Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sat, 27 Jul 2024 23:23:03 +0300 Subject: [PATCH] Added CLI arg to specify the data directory. Tests for save/load, downloading mods, creating maps, show success --- desktop/src/com/unciv/app/desktop/DesktopLauncher.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt index e6ef75ad8d..37b0b74abf 100644 --- a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt +++ b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt @@ -91,8 +91,12 @@ internal object DesktopLauncher { UiElementDocsWriter().write() } + + val customDataDirPrefix="--data-dir=" + val customDataDir = arg.find { it.startsWith(customDataDirPrefix) }?.removePrefix(customDataDirPrefix) + // HardenGdxAudio extends Lwjgl3Application, and the Lwjgl3Application constructor runs as long as the game runs - HardenGdxAudio(DesktopGame(config, null), config) + HardenGdxAudio(DesktopGame(config, customDataDir), config) exitProcess(0) } }