mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
3.13.12-patch1
This commit is contained in:
parent
6e31750b55
commit
50e3f62018
@ -3,8 +3,8 @@ package com.unciv.build
|
|||||||
object BuildConfig {
|
object BuildConfig {
|
||||||
const val kotlinVersion = "1.4.30"
|
const val kotlinVersion = "1.4.30"
|
||||||
const val appName = "Unciv"
|
const val appName = "Unciv"
|
||||||
const val appCodeNumber = 552
|
const val appCodeNumber = 553
|
||||||
const val appVersion = "3.13.12"
|
const val appVersion = "3.13.12-patch1"
|
||||||
|
|
||||||
const val gdxVersion = "1.9.14"
|
const val gdxVersion = "1.9.14"
|
||||||
const val roboVMVersion = "2.3.1"
|
const val roboVMVersion = "2.3.1"
|
||||||
|
@ -138,6 +138,13 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam
|
|||||||
mapHolder.setCenterPosition(tileToCenterOn, true, true)
|
mapHolder.setCenterPosition(tileToCenterOn, true, true)
|
||||||
|
|
||||||
|
|
||||||
|
tutorialController.allTutorialsShowedCallback = { shouldUpdate = true }
|
||||||
|
|
||||||
|
onBackButtonClicked { backButtonAndESCHandler() }
|
||||||
|
|
||||||
|
addKeyboardListener() // for map panning by W,S,A,D
|
||||||
|
|
||||||
|
|
||||||
if (gameInfo.gameParameters.isOnlineMultiplayer && !gameInfo.isUpToDate)
|
if (gameInfo.gameParameters.isOnlineMultiplayer && !gameInfo.isUpToDate)
|
||||||
isPlayersTurn = false // until we're up to date, don't let the player do anything
|
isPlayersTurn = false // until we're up to date, don't let the player do anything
|
||||||
|
|
||||||
@ -148,17 +155,10 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam
|
|||||||
// isDaemon = true, in order to not block the app closing
|
// isDaemon = true, in order to not block the app closing
|
||||||
// DO NOT use Timer() since this seems to (maybe?) translate to com.badlogic.gdx.utils.Timer? Not sure about this.
|
// DO NOT use Timer() since this seems to (maybe?) translate to com.badlogic.gdx.utils.Timer? Not sure about this.
|
||||||
multiPlayerRefresher = timer("multiPlayerRefresh", true, period = 10000) {
|
multiPlayerRefresher = timer("multiPlayerRefresh", true, period = 10000) {
|
||||||
if (game.screen != this@WorldScreen) multiPlayerRefresher?.cancel()
|
loadLatestMultiplayerState()
|
||||||
else loadLatestMultiplayerState()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tutorialController.allTutorialsShowedCallback = { shouldUpdate = true }
|
|
||||||
|
|
||||||
onBackButtonClicked { backButtonAndESCHandler() }
|
|
||||||
|
|
||||||
addKeyboardListener() // for map panning by W,S,A,D
|
|
||||||
|
|
||||||
// don't run update() directly, because the UncivGame.worldScreen should be set so that the city buttons and tile groups
|
// don't run update() directly, because the UncivGame.worldScreen should be set so that the city buttons and tile groups
|
||||||
// know what the viewing civ is.
|
// know what the viewing civ is.
|
||||||
shouldUpdate = true
|
shouldUpdate = true
|
||||||
@ -241,8 +241,11 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam
|
|||||||
val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId)
|
val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId)
|
||||||
|
|
||||||
// if we find it still isn't player's turn...nothing changed
|
// if we find it still isn't player's turn...nothing changed
|
||||||
if (gameInfo.isUpToDate && gameInfo.currentPlayer == latestGame.currentPlayer) {
|
if (gameInfo.currentPlayer == latestGame.currentPlayer) {
|
||||||
Gdx.app.postRunnable { loadingGamePopup.close() }
|
Gdx.app.postRunnable { loadingGamePopup.close() }
|
||||||
|
// edge case - if there's only one player in a multiplayer game, we still check online, but it could be that we were correct and it is our turn
|
||||||
|
isPlayersTurn = latestGame.currentPlayer == viewingCiv.civName
|
||||||
|
shouldUpdate = true
|
||||||
return
|
return
|
||||||
} else { //else we found it is the player's turn again, turn off polling and load turn
|
} else { //else we found it is the player's turn again, turn off polling and load turn
|
||||||
stopMultiPlayerRefresher()
|
stopMultiPlayerRefresher()
|
||||||
@ -312,8 +315,6 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam
|
|||||||
techPolicyAndVictoryHolder.setPosition(10f, topBar.y - techPolicyAndVictoryHolder.height - 5f)
|
techPolicyAndVictoryHolder.setPosition(10f, topBar.y - techPolicyAndVictoryHolder.height - 5f)
|
||||||
updateDiplomacyButton(viewingCiv)
|
updateDiplomacyButton(viewingCiv)
|
||||||
|
|
||||||
isPlayersTurn = viewingCiv == gameInfo.currentPlayerCiv
|
|
||||||
|
|
||||||
if (!hasOpenPopups() && isPlayersTurn) {
|
if (!hasOpenPopups() && isPlayersTurn) {
|
||||||
when {
|
when {
|
||||||
!gameInfo.oneMoreTurnMode && (viewingCiv.isDefeated() || gameInfo.civilizations.any { it.victoryManager.hasWon() }) ->
|
!gameInfo.oneMoreTurnMode && (viewingCiv.isDefeated() || gameInfo.civilizations.any { it.victoryManager.hasWon() }) ->
|
||||||
@ -381,16 +382,11 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam
|
|||||||
displayTutorial(Tutorial.Introduction)
|
displayTutorial(Tutorial.Introduction)
|
||||||
|
|
||||||
displayTutorial(Tutorial.EnemyCityNeedsConqueringWithMeleeUnit) {
|
displayTutorial(Tutorial.EnemyCityNeedsConqueringWithMeleeUnit) {
|
||||||
// diplomacy is a HashMap, cities a List - so sequences should help
|
|
||||||
// .flatMap { it.getUnits().asSequence() } is not a good idea because getUnits constructs an ArrayList dynamically
|
|
||||||
viewingCiv.diplomacy.values.asSequence()
|
viewingCiv.diplomacy.values.asSequence()
|
||||||
.filter { it.diplomaticStatus == DiplomaticStatus.War }
|
.filter { it.diplomaticStatus == DiplomaticStatus.War }
|
||||||
.map { it.otherCiv() }
|
.map { it.otherCiv() } // we're now lazily enumerating over CivilizationInfo's we're at war with
|
||||||
// we're now lazily enumerating over CivilizationInfo's we're at war with
|
.flatMap { it.cities.asSequence() } // ... all *their* cities
|
||||||
.flatMap { it.cities.asSequence() }
|
.filter { it.health == 1 } // ... those ripe for conquering
|
||||||
// ... all *their* cities
|
|
||||||
.filter { it.health == 1 }
|
|
||||||
// ... those ripe for conquering
|
|
||||||
.flatMap { it.getCenterTile().getTilesInDistance(2).asSequence() }
|
.flatMap { it.getCenterTile().getTilesInDistance(2).asSequence() }
|
||||||
// ... all tiles around those in range of an average melee unit
|
// ... all tiles around those in range of an average melee unit
|
||||||
// -> and now we look for a unit that could do the conquering because it's ours
|
// -> and now we look for a unit that could do the conquering because it's ours
|
||||||
|
Loading…
x
Reference in New Issue
Block a user