mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-12 03:48:16 +07:00
Fixed modded images not loading properly
This commit is contained in:
parent
98a79f8fb4
commit
009c59b77c
@ -118,9 +118,9 @@ class UncivGame(parameters: UncivGameParameters) : Game() {
|
||||
fun loadGame(gameInfo: GameInfo) {
|
||||
this.gameInfo = gameInfo
|
||||
ImageGetter.ruleset = gameInfo.ruleSet
|
||||
ImageGetter.reload()
|
||||
Gdx.input.inputProcessor = null // Since we will set the world screen when we're ready,
|
||||
// This is to avoid ANRs when loading.
|
||||
//ImageGetter.refreshAtlas()
|
||||
worldScreen = WorldScreen(gameInfo.getPlayerToViewAs())
|
||||
setWorldScreen()
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick
|
||||
ruleset.modOptions = newRuleset.modOptions
|
||||
|
||||
ImageGetter.ruleset = ruleset
|
||||
ImageGetter.setTextureRegionDrawables()
|
||||
ImageGetter.reload()
|
||||
}
|
||||
|
||||
fun Table.addModCheckboxes() {
|
||||
|
@ -36,17 +36,17 @@ object ImageGetter {
|
||||
val textureRegionDrawables = HashMap<String,TextureRegionDrawable>()
|
||||
|
||||
init{
|
||||
setTextureRegionDrawables()
|
||||
reload()
|
||||
}
|
||||
|
||||
fun setNewRuleset(ruleset: Ruleset) {
|
||||
if (this.ruleset == ruleset) return
|
||||
this.ruleset = ruleset
|
||||
setTextureRegionDrawables()
|
||||
reload()
|
||||
}
|
||||
|
||||
|
||||
fun setTextureRegionDrawables(){
|
||||
/** Required every time the ruleset changes, in order to load mod-specific images */
|
||||
fun reload(){
|
||||
textureRegionDrawables.clear()
|
||||
// These are the drawables from the base game
|
||||
for(region in atlas.regions){
|
||||
|
Loading…
Reference in New Issue
Block a user