From 59f8a0eebf4d8688c2f47dcafd7bb5f0d8dfb449 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Thu, 26 Aug 2021 16:51:38 +0300 Subject: [PATCH] Hardcoded image atlases for it to work from within a .jar - #4993 --- core/src/com/unciv/ui/utils/ImageGetter.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/utils/ImageGetter.kt b/core/src/com/unciv/ui/utils/ImageGetter.kt index 7474d35d9f..40a5e16e5c 100644 --- a/core/src/com/unciv/ui/utils/ImageGetter.kt +++ b/core/src/com/unciv/ui/utils/ImageGetter.kt @@ -61,8 +61,10 @@ object ImageGetter { textureRegionDrawables[region.name] = drawable } - // Load all other atlas files - for (file in Gdx.files.internal(".").list(".atlas")) { + // This is a quickfix for #4993, since you can't .list() on a jar file. This should be fixed in a nicer way. + val fileNames = listOf("game","Flags","Tech","Skin","Construction") + for (fileName in fileNames) { + val file = Gdx.files.internal("$fileName.atlas") val extraAtlas = file.nameWithoutExtension() val tempAtlas = atlases[extraAtlas] // fetch if cached ?: TextureAtlas(file.name()).apply { // load if not