mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 17:59:11 +07:00
JAR file is now ready for desktop consumption!
This commit is contained in:
@ -78,9 +78,20 @@ object GameBasics {
|
|||||||
Difficulties += createHashmap(getFromJson(Array<Difficulty>::class.java, "Difficulties"))
|
Difficulties += createHashmap(getFromJson(Array<Difficulty>::class.java, "Difficulties"))
|
||||||
|
|
||||||
|
|
||||||
|
// Apparently you can't iterate over the files in a directory when running out of a .jar...
|
||||||
|
// https://www.badlogicgames.com/forum/viewtopic.php?f=11&t=27250
|
||||||
|
// which means we need to list everything manually =/
|
||||||
|
|
||||||
for (file in Gdx.files.internal("jsons/Translations").list())
|
val translationFileNames = listOf("Buildings","Diplomacy,Trade,Nations",
|
||||||
|
"NewGame,SaveGame,LoadGame,Options", "Notifications","Other","Policies","Techs",
|
||||||
|
"Terrains,Resources,Improvements","Units,Promotions")
|
||||||
|
|
||||||
|
for (fileName in translationFileNames){
|
||||||
|
val file = Gdx.files.internal("jsons/Translations/$fileName.json")
|
||||||
|
if(file.exists()) {
|
||||||
Translations.add(file.readString())
|
Translations.add(file.readString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user