mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Memory-saving tweak
This commit is contained in:
parent
115aef50ad
commit
881f532bf7
@ -58,6 +58,7 @@ class UnCivGame : Game() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun setWorldScreen() {
|
fun setWorldScreen() {
|
||||||
|
if(screen != null && screen != worldScreen) screen.dispose()
|
||||||
setScreen(worldScreen)
|
setScreen(worldScreen)
|
||||||
Gdx.input.inputProcessor = worldScreen.stage
|
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
|
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() {
|
class CivilopediaScreen : CameraStageBaseScreen() {
|
||||||
init {
|
init {
|
||||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||||
val buttonTable = Table()
|
val buttonTable = Table()
|
||||||
buttonTable.pad(15f)
|
buttonTable.pad(15f)
|
||||||
val entryTable = Table()
|
val entryTable = Table()
|
||||||
|
@ -22,7 +22,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
|
|||||||
|
|
||||||
val currentPlayerCivInfo = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
val currentPlayerCivInfo = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
||||||
init {
|
init {
|
||||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||||
val topTable = Table().apply { defaults().pad(10f) }
|
val topTable = Table().apply { defaults().pad(10f) }
|
||||||
val centerTable=Table().apply { defaults().pad(20f) }
|
val centerTable=Table().apply { defaults().pad(20f) }
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
|
|||||||
private var tileGroups = ArrayList<CityTileGroup>()
|
private var tileGroups = ArrayList<CityTileGroup>()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
onBackButtonClicked { game.setWorldScreen(); dispose() }
|
onBackButtonClicked { game.setWorldScreen() }
|
||||||
addTiles()
|
addTiles()
|
||||||
|
|
||||||
val tableBackgroundColor = ImageGetter.getBlue().lerp(Color.BLACK,0.5f)
|
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())
|
rightSideButton.setText("Adopt free policy".tr())
|
||||||
closeButton.disable()
|
closeButton.disable()
|
||||||
}
|
}
|
||||||
else onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
else onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||||
|
|
||||||
rightSideButton.onClick("policy") {
|
rightSideButton.onClick("policy") {
|
||||||
civInfo.policies.adopt(pickedPolicy!!)
|
civInfo.policies.adopt(pickedPolicy!!)
|
||||||
|
@ -16,7 +16,7 @@ class PromotionPickerScreen(mapUnit: MapUnit) : PickerScreen() {
|
|||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||||
setDefaultCloseAction()
|
setDefaultCloseAction()
|
||||||
rightSideButton.setText("Pick promotion".tr())
|
rightSideButton.setText("Pick promotion".tr())
|
||||||
rightSideButton.onClick("promote") {
|
rightSideButton.onClick("promote") {
|
||||||
|
@ -40,7 +40,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
setDefaultCloseAction()
|
setDefaultCloseAction()
|
||||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||||
|
|
||||||
tempTechsToResearch = ArrayList(civTech.techsToResearch)
|
tempTechsToResearch = ArrayList(civTech.techsToResearch)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class DiplomacyScreen:CameraStageBaseScreen(){
|
|||||||
val rightSideTable = Table()
|
val rightSideTable = Table()
|
||||||
|
|
||||||
init{
|
init{
|
||||||
onBackButtonClicked { UnCivGame.Current.setWorldScreen(); dispose() }
|
onBackButtonClicked { UnCivGame.Current.setWorldScreen() }
|
||||||
val splitPane = SplitPane(ScrollPane(leftSideTable),rightSideTable,false, skin)
|
val splitPane = SplitPane(ScrollPane(leftSideTable),rightSideTable,false, skin)
|
||||||
splitPane.splitAmount = 0.2f
|
splitPane.splitAmount = 0.2f
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user