Next turn button shows move spies notification icon (#11557)

This commit is contained in:
Oskar Niesen
2024-05-04 13:04:08 -05:00
committed by GitHub
parent 59084399a6
commit da4657fa44
7 changed files with 117 additions and 86 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -34,7 +34,7 @@ CityStateIcons/Militaristic
index: -1 index: -1
CityStateIcons/Religious CityStateIcons/Religious
rotate: false rotate: false
xy: 544, 35 xy: 652, 1007
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -279,105 +279,105 @@ ImprovementIcons/Moai
index: -1 index: -1
ImprovementIcons/Offshore Platform ImprovementIcons/Offshore Platform
rotate: false rotate: false
xy: 328, 235 xy: 328, 127
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Oil well ImprovementIcons/Oil well
rotate: false rotate: false
xy: 328, 19 xy: 436, 1007
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Pasture ImprovementIcons/Pasture
rotate: false rotate: false
xy: 436, 899 xy: 544, 1007
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Plantation ImprovementIcons/Plantation
rotate: false rotate: false
xy: 544, 683 xy: 436, 467
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Polder ImprovementIcons/Polder
rotate: false rotate: false
xy: 436, 467 xy: 544, 575
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Quarry ImprovementIcons/Quarry
rotate: false rotate: false
xy: 544, 359 xy: 436, 143
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Railroad ImprovementIcons/Railroad
rotate: false rotate: false
xy: 544, 143 xy: 544, 35
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Remove Fallout ImprovementIcons/Remove Fallout
rotate: false rotate: false
xy: 652, 899 xy: 652, 791
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Remove Forest ImprovementIcons/Remove Forest
rotate: false rotate: false
xy: 652, 791 xy: 652, 683
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Remove Jungle ImprovementIcons/Remove Jungle
rotate: false rotate: false
xy: 652, 791 xy: 652, 683
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Remove Marsh ImprovementIcons/Remove Marsh
rotate: false rotate: false
xy: 652, 576 xy: 652, 468
size: 100, 99 size: 100, 99
orig: 100, 99 orig: 100, 99
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Remove Railroad ImprovementIcons/Remove Railroad
rotate: false rotate: false
xy: 652, 468 xy: 652, 360
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Remove Road ImprovementIcons/Remove Road
rotate: false rotate: false
xy: 652, 360 xy: 652, 252
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Repair ImprovementIcons/Repair
rotate: false rotate: false
xy: 652, 252 xy: 652, 144
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Road ImprovementIcons/Road
rotate: false rotate: false
xy: 760, 1010 xy: 760, 902
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -431,16 +431,51 @@ StatIcons/Faith
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
NotificationIcons/Loading
rotate: false
xy: 220, 451
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
NotificationIcons/Working
rotate: false
xy: 220, 451
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
OtherIcons/Loading
rotate: false
xy: 220, 451
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
NotificationIcons/MoveSpies
rotate: false
xy: 328, 775
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
OtherIcons/Spy_White
rotate: false
xy: 328, 775
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
NotificationIcons/PickConstruction NotificationIcons/PickConstruction
rotate: false rotate: false
xy: 436, 683 xy: 544, 791
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
StatIcons/Production StatIcons/Production
rotate: false rotate: false
xy: 436, 683 xy: 544, 791
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -454,14 +489,14 @@ NotificationIcons/PickPolicy
index: -1 index: -1
NotificationIcons/PickTech NotificationIcons/PickTech
rotate: false rotate: false
xy: 544, 791 xy: 436, 575
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
StatIcons/Science StatIcons/Science
rotate: false rotate: false
xy: 544, 791 xy: 436, 575
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -690,27 +725,6 @@ OtherIcons/Load
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Loading
rotate: false
xy: 220, 451
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
NotificationIcons/Loading
rotate: false
xy: 220, 451
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
NotificationIcons/Working
rotate: false
xy: 220, 451
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
OtherIcons/LockSmall OtherIcons/LockSmall
rotate: false rotate: false
xy: 1637, 1695 xy: 1637, 1695
@ -741,14 +755,14 @@ OtherIcons/Mods
index: -1 index: -1
OtherIcons/Multiplayer OtherIcons/Multiplayer
rotate: false rotate: false
xy: 328, 775 xy: 328, 667
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/NationSwap OtherIcons/NationSwap
rotate: false rotate: false
xy: 328, 667 xy: 328, 559
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -762,21 +776,21 @@ OtherIcons/Nations
index: -1 index: -1
OtherIcons/New OtherIcons/New
rotate: false rotate: false
xy: 328, 559 xy: 328, 451
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Notifications OtherIcons/Notifications
rotate: false rotate: false
xy: 328, 343 xy: 328, 235
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Options OtherIcons/Options
rotate: false rotate: false
xy: 436, 1007 xy: 436, 899
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -790,35 +804,35 @@ OtherIcons/Pause
index: -1 index: -1
OtherIcons/Pencil OtherIcons/Pencil
rotate: false rotate: false
xy: 436, 791 xy: 544, 899
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Pentagon OtherIcons/Pentagon
rotate: false rotate: false
xy: 544, 899 xy: 436, 683
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Pillage OtherIcons/Pillage
rotate: false rotate: false
xy: 436, 575 xy: 544, 683
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Politics OtherIcons/Politics
rotate: false rotate: false
xy: 544, 575 xy: 436, 359
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
NotificationIcons/WorldCongressVote NotificationIcons/WorldCongressVote
rotate: false rotate: false
xy: 544, 575 xy: 436, 359
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -832,7 +846,7 @@ OtherIcons/Politics-diagram-bg
index: -1 index: -1
OtherIcons/Present OtherIcons/Present
rotate: false rotate: false
xy: 436, 251 xy: 544, 359
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -846,103 +860,96 @@ OtherIcons/Puppet
index: -1 index: -1
OtherIcons/Quest OtherIcons/Quest
rotate: false rotate: false
xy: 436, 143 xy: 544, 251
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Question OtherIcons/Question
rotate: false rotate: false
xy: 544, 251 xy: 436, 35
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Quickstart OtherIcons/Quickstart
rotate: false rotate: false
xy: 436, 35 xy: 544, 143
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Remove Heresy OtherIcons/Remove Heresy
rotate: false rotate: false
xy: 652, 683 xy: 652, 575
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Resources OtherIcons/Resources
rotate: false rotate: false
xy: 652, 144 xy: 652, 36
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Resume OtherIcons/Resume
rotate: false rotate: false
xy: 652, 36 xy: 760, 1010
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Scenarios OtherIcons/Scenarios
rotate: false rotate: false
xy: 760, 794 xy: 760, 686
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Search OtherIcons/Search
rotate: false rotate: false
xy: 760, 686 xy: 760, 578
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/SecretOptions OtherIcons/SecretOptions
rotate: false rotate: false
xy: 760, 578 xy: 760, 470
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Settings OtherIcons/Settings
rotate: false rotate: false
xy: 760, 470 xy: 760, 362
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Shield OtherIcons/Shield
rotate: false rotate: false
xy: 760, 254 xy: 760, 146
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Sleep OtherIcons/Sleep
rotate: false rotate: false
xy: 784, 1796 xy: 799, 1688
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Speaker OtherIcons/Speaker
rotate: false rotate: false
xy: 799, 1688 xy: 799, 1580
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Spy OtherIcons/Spy
rotate: false
xy: 838, 1364
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
OtherIcons/Spy_White
rotate: false rotate: false
xy: 898, 1256 xy: 898, 1256
size: 100, 100 size: 100, 100
@ -1161,56 +1168,56 @@ ResourceIcons/Marble
index: -1 index: -1
ResourceIcons/Oil ResourceIcons/Oil
rotate: false rotate: false
xy: 328, 127 xy: 328, 19
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Pearls ResourceIcons/Pearls
rotate: false rotate: false
xy: 544, 1007 xy: 436, 791
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Porcelain ResourceIcons/Porcelain
rotate: false rotate: false
xy: 544, 467 xy: 436, 251
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Salt ResourceIcons/Salt
rotate: false rotate: false
xy: 760, 902 xy: 760, 794
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Sheep ResourceIcons/Sheep
rotate: false rotate: false
xy: 760, 362 xy: 760, 254
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Silk ResourceIcons/Silk
rotate: false rotate: false
xy: 760, 146 xy: 760, 38
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Silver ResourceIcons/Silver
rotate: false rotate: false
xy: 760, 38 xy: 784, 1796
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ResourceIcons/Spices ResourceIcons/Spices
rotate: false rotate: false
xy: 838, 1472 xy: 838, 1364
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1322,14 +1329,14 @@ StatIcons/Malcontent
index: -1 index: -1
StatIcons/Population StatIcons/Population
rotate: false rotate: false
xy: 436, 359 xy: 544, 467
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TileIcons/Worked TileIcons/Worked
rotate: false rotate: false
xy: 436, 359 xy: 544, 467
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1350,7 +1357,7 @@ StatIcons/RangedStrength
index: -1 index: -1
StatIcons/ReligiousStrength StatIcons/ReligiousStrength
rotate: false rotate: false
xy: 652, 1007 xy: 652, 899
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1364,7 +1371,7 @@ StatIcons/Resistance
index: -1 index: -1
StatIcons/Specialist StatIcons/Specialist
rotate: false rotate: false
xy: 799, 1580 xy: 838, 1472
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1434,7 +1441,7 @@ TileIcons/MapOverlayToggleYields
index: -1 index: -1
TileIcons/NotWorked TileIcons/NotWorked
rotate: false rotate: false
xy: 328, 451 xy: 328, 343
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 KiB

After

Width:  |  Height:  |  Size: 535 KiB

View File

@ -1110,6 +1110,7 @@ turn =
Next unit = Next unit =
Fog of War = Fog of War =
Pick a policy = Pick a policy =
Move Spies =
Movement = Movement =
Strength = Strength =
Ranged strength = Ranged strength =

View File

@ -15,6 +15,13 @@ class EspionageManager : IsPartOfGameInfoSerialization {
@Transient @Transient
lateinit var civInfo: Civilization lateinit var civInfo: Civilization
/**
* Part of the nextTurnAction of MoveSpies.
* We need to store if the player has clicked the button already
*/
@Transient
var dismissedShouldMoveSpies = false
fun clone(): EspionageManager { fun clone(): EspionageManager {
val toReturn = EspionageManager() val toReturn = EspionageManager()
spyList.mapTo(toReturn.spyList) { it.clone() } spyList.mapTo(toReturn.spyList) { it.clone() }
@ -77,4 +84,10 @@ class EspionageManager : IsPartOfGameInfoSerialization {
fun getCitiesWithOurSpies(): List<City> = spyList.filter { it.isSetUp() }.mapNotNull { it.getLocation() } fun getCitiesWithOurSpies(): List<City> = spyList.filter { it.isSetUp() }.mapNotNull { it.getLocation() }
fun getSpyAssignedToCity(city: City): Spy? = spyList.firstOrNull {it.getLocation() == city} fun getSpyAssignedToCity(city: City): Spy? = spyList.firstOrNull {it.getLocation() == city}
/**
* Determines whether the NextTurnAction MoveSpies should be shown or not
* @return true if there are spies waiting to be moved
*/
fun shouldShowMoveSpies(): Boolean = !dismissedShouldMoveSpies && spyList.any { it.isIdle() }
} }

View File

@ -245,7 +245,8 @@ class Spy() : IsPartOfGameInfoSerialization {
fun isSetUp() = action !in listOf(SpyAction.Moving, SpyAction.None, SpyAction.EstablishNetwork) fun isSetUp() = action !in listOf(SpyAction.Moving, SpyAction.None, SpyAction.EstablishNetwork)
// Only returns true if the spy is doing a helpful and implemented action fun isIdle(): Boolean =action == SpyAction.None || action == SpyAction.Surveillance
fun isDoingWork(): Boolean { fun isDoingWork(): Boolean {
if (action == SpyAction.StealingTech || action == SpyAction.EstablishNetwork || action == SpyAction.Moving) return true if (action == SpyAction.StealingTech || action == SpyAction.EstablishNetwork || action == SpyAction.Moving) return true
if (action == SpyAction.RiggingElections && !civInfo.isAtWarWith(getLocation()!!.civ)) return true if (action == SpyAction.RiggingElections && !civInfo.isAtWarWith(getLocation()!!.civ)) return true

View File

@ -11,6 +11,7 @@ import com.unciv.ui.components.extensions.disable
import com.unciv.ui.components.extensions.enable import com.unciv.ui.components.extensions.enable
import com.unciv.ui.popups.ConfirmPopup import com.unciv.ui.popups.ConfirmPopup
import com.unciv.ui.screens.cityscreen.CityScreen import com.unciv.ui.screens.cityscreen.CityScreen
import com.unciv.ui.screens.overviewscreen.EspionageOverviewScreen
import com.unciv.ui.screens.pickerscreens.DiplomaticVotePickerScreen import com.unciv.ui.screens.pickerscreens.DiplomaticVotePickerScreen
import com.unciv.ui.screens.pickerscreens.PantheonPickerScreen import com.unciv.ui.screens.pickerscreens.PantheonPickerScreen
import com.unciv.ui.screens.pickerscreens.PolicyPickerScreen import com.unciv.ui.screens.pickerscreens.PolicyPickerScreen
@ -67,6 +68,14 @@ enum class NextTurnAction(protected val text: String, val color: Color) {
worldScreen.viewingCiv.policies.shouldOpenPolicyPicker = false worldScreen.viewingCiv.policies.shouldOpenPolicyPicker = false
} }
}, },
MoveSpies("Move Spies", Color.WHITE) {
override fun isChoice(worldScreen: WorldScreen) =
worldScreen.gameInfo.isEspionageEnabled() && worldScreen.viewingCiv.espionageManager.shouldShowMoveSpies()
override fun action(worldScreen: WorldScreen) {
worldScreen.game.pushScreen(EspionageOverviewScreen(worldScreen.selectedCiv, worldScreen))
worldScreen.viewingCiv.espionageManager.dismissedShouldMoveSpies = true
}
},
FoundPantheon("Found Pantheon", Color.valueOf(BeliefType.Pantheon.color)) { FoundPantheon("Found Pantheon", Color.valueOf(BeliefType.Pantheon.color)) {
override fun isChoice(worldScreen: WorldScreen) = override fun isChoice(worldScreen: WorldScreen) =
worldScreen.viewingCiv.religionManager.run { worldScreen.viewingCiv.religionManager.run {