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