Memory-saving tweak
This commit is contained in:
parent
115aef50ad
commit
881f532bf7
8 changed files with 8 additions and 7 deletions
|
@ -58,6 +58,7 @@ class UnCivGame : Game() {
|
|||
}
|
||||
|
||||
fun setWorldScreen() {
|
||||
if(screen != null && screen != worldScreen) screen.dispose()
|
||||
setScreen(worldScreen)
|
||||
Gdx.input.inputProcessor = worldScreen.stage
|
||||
worldScreen.shouldUpdate=true // This can set the screen to the policy picker or tech picker screen, so the input processor must come before
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.util.*
|
|||
|
||||
class CivilopediaScreen : CameraStageBaseScreen() {
|
||||
init {
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||
val buttonTable = Table()
|
||||
buttonTable.pad(15f)
|
||||
val entryTable = Table()
|
||||
|
|
|
@ -22,7 +22,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
|
|||
|
||||
val currentPlayerCivInfo = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
||||
init {
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||
val topTable = Table().apply { defaults().pad(10f) }
|
||||
val centerTable=Table().apply { defaults().pad(20f) }
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
|
|||
private var tileGroups = ArrayList<CityTileGroup>()
|
||||
|
||||
init {
|
||||
onBackButtonClicked { game.setWorldScreen(); dispose() }
|
||||
onBackButtonClicked { game.setWorldScreen() }
|
||||
addTiles()
|
||||
|
||||
val tableBackgroundColor = ImageGetter.getBlue().lerp(Color.BLACK,0.5f)
|
||||
|
|
|
@ -27,7 +27,7 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen(
|
|||
rightSideButton.setText("Adopt free policy".tr())
|
||||
closeButton.disable()
|
||||
}
|
||||
else onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
||||
else onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||
|
||||
rightSideButton.onClick("policy") {
|
||||
civInfo.policies.adopt(pickedPolicy!!)
|
||||
|
|
|
@ -16,7 +16,7 @@ class PromotionPickerScreen(mapUnit: MapUnit) : PickerScreen() {
|
|||
|
||||
|
||||
init {
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||
setDefaultCloseAction()
|
||||
rightSideButton.setText("Pick promotion".tr())
|
||||
rightSideButton.onClick("promote") {
|
||||
|
|
|
@ -40,7 +40,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
|||
|
||||
init {
|
||||
setDefaultCloseAction()
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||
|
||||
tempTechsToResearch = ArrayList(civTech.techsToResearch)
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class DiplomacyScreen:CameraStageBaseScreen(){
|
|||
val rightSideTable = Table()
|
||||
|
||||
init{
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||
val splitPane = SplitPane(ScrollPane(leftSideTable),rightSideTable,false, skin)
|
||||
splitPane.splitAmount = 0.2f
|
||||
|
||||
|
|
Loading…
Reference in a new issue