mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-24 18:06:04 +07:00
Fix Altas type (should be Atlas). Fix srawable -> drawable (#1639)
This commit is contained in:
parent
9776029376
commit
bc83be1441
@ -120,7 +120,7 @@ class UncivGame(
|
||||
fun loadGame(gameInfo:GameInfo){
|
||||
this.gameInfo = gameInfo
|
||||
ImageGetter.ruleset = gameInfo.ruleSet
|
||||
ImageGetter.refreshAltas()
|
||||
ImageGetter.refreshAtlas()
|
||||
worldScreen = WorldScreen(gameInfo.getPlayerToViewAs())
|
||||
setWorldScreen()
|
||||
}
|
||||
@ -144,7 +144,7 @@ class UncivGame(
|
||||
override fun resume() {
|
||||
super.resume()
|
||||
if(!isInitialized) return // The stuff from Create() is still happening, so the main screen will load eventually
|
||||
ImageGetter.refreshAltas()
|
||||
ImageGetter.refreshAtlas()
|
||||
|
||||
// This is to solve a rare problem -
|
||||
// Sometimes, resume() is called and the gameInfo doesn't have any civilizations.
|
||||
|
@ -38,7 +38,7 @@ object ImageGetter {
|
||||
|
||||
fun setTextureRegionDrawables(){
|
||||
textureRegionDrawables.clear()
|
||||
// These are the srawables from the base game
|
||||
// These are the drawables from the base game
|
||||
for(region in atlas.regions){
|
||||
val drawable =TextureRegionDrawable(region)
|
||||
textureRegionDrawables[region.name] = drawable
|
||||
@ -46,9 +46,9 @@ object ImageGetter {
|
||||
|
||||
// These are from the mods
|
||||
for(mod in ruleset.mods){
|
||||
val modAltasFile = Gdx.files.local("mods/$mod/game.atlas")
|
||||
if (modAltasFile.exists()) {
|
||||
val modAtlas = TextureAtlas(modAltasFile)
|
||||
val modAtlasFile = Gdx.files.local("mods/$mod/game.atlas")
|
||||
if (modAtlasFile.exists()) {
|
||||
val modAtlas = TextureAtlas(modAtlasFile)
|
||||
for (region in modAtlas.regions) {
|
||||
val drawable = TextureRegionDrawable(region)
|
||||
textureRegionDrawables[region.name] = drawable
|
||||
@ -57,7 +57,7 @@ object ImageGetter {
|
||||
}
|
||||
}
|
||||
|
||||
fun refreshAltas() {
|
||||
fun refreshAtlas() {
|
||||
atlas.dispose() // To avoid OutOfMemory exceptions
|
||||
atlas = TextureAtlas("game.atlas")
|
||||
setTextureRegionDrawables()
|
||||
|
Loading…
Reference in New Issue
Block a user