mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
isSpectator check for notifications (#8558)
This commit is contained in:
parent
772615cffa
commit
af2307782f
@ -274,9 +274,10 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
city.updateCitizens = true
|
||||
}
|
||||
|
||||
civInfo.addNotification("Research of [$techName] has completed!", TechAction(techName),
|
||||
NotificationCategory.General,
|
||||
NotificationIcon.Science, techName)
|
||||
if(!civInfo.isSpectator())
|
||||
civInfo.addNotification("Research of [$techName] has completed!", TechAction(techName),
|
||||
NotificationCategory.General,
|
||||
NotificationIcon.Science, techName)
|
||||
if (isNewTech)
|
||||
civInfo.popupAlerts.add(PopupAlert(AlertType.TechResearched, techName))
|
||||
|
||||
@ -374,11 +375,12 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
updateEra()
|
||||
val currentEra = civInfo.getEra()
|
||||
if (previousEra != currentEra) {
|
||||
civInfo.addNotification(
|
||||
"You have entered the [$currentEra]!",
|
||||
NotificationCategory.General,
|
||||
NotificationIcon.Science
|
||||
)
|
||||
if(!civInfo.isSpectator())
|
||||
civInfo.addNotification(
|
||||
"You have entered the [$currentEra]!",
|
||||
NotificationCategory.General,
|
||||
NotificationIcon.Science
|
||||
)
|
||||
if (civInfo.isMajorCiv()) {
|
||||
for (knownCiv in civInfo.getKnownCivs()) {
|
||||
knownCiv.addNotification(
|
||||
@ -390,11 +392,12 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
for (policyBranch in getRuleset().policyBranches.values.filter {
|
||||
it.era == currentEra.name && civInfo.policies.isAdoptable(it)
|
||||
}) {
|
||||
civInfo.addNotification(
|
||||
"[${policyBranch.name}] policy branch unlocked!",
|
||||
NotificationCategory.General,
|
||||
NotificationIcon.Culture
|
||||
)
|
||||
if(!civInfo.isSpectator())
|
||||
civInfo.addNotification(
|
||||
"[${policyBranch.name}] policy branch unlocked!",
|
||||
NotificationCategory.General,
|
||||
NotificationIcon.Culture
|
||||
)
|
||||
}
|
||||
|
||||
val erasPassed = getRuleset().eras.values
|
||||
|
@ -98,11 +98,12 @@ class CivInfoTransientCache(val civInfo: Civilization) {
|
||||
val metCiv = entry.key
|
||||
if (metCiv == civInfo || metCiv.isBarbarian() || civInfo.diplomacy.containsKey(metCiv.civName)) continue
|
||||
civInfo.diplomacyFunctions.makeCivilizationsMeet(metCiv)
|
||||
civInfo.addNotification("We have encountered [${metCiv.civName}]!",
|
||||
entry.value.position,
|
||||
NotificationCategory.Diplomacy, metCiv.civName,
|
||||
NotificationIcon.Diplomacy
|
||||
)
|
||||
if(!civInfo.isSpectator())
|
||||
civInfo.addNotification("We have encountered [${metCiv.civName}]!",
|
||||
entry.value.position,
|
||||
NotificationCategory.Diplomacy, metCiv.civName,
|
||||
NotificationIcon.Diplomacy
|
||||
)
|
||||
metCiv.addNotification("We have encountered [${civInfo.civName}]!",
|
||||
entry.value.position,
|
||||
NotificationCategory.Diplomacy, civInfo.civName,
|
||||
@ -189,8 +190,9 @@ class CivInfoTransientCache(val civInfo: Civilization) {
|
||||
if (civInfo.naturalWonders.contains(tile.naturalWonder))
|
||||
continue
|
||||
civInfo.naturalWonders.add(tile.naturalWonder!!)
|
||||
civInfo.addNotification("We have discovered [${tile.naturalWonder}]!",
|
||||
tile.position, NotificationCategory.General, "StatIcons/Happiness")
|
||||
if(!civInfo.isSpectator())
|
||||
civInfo.addNotification("We have discovered [${tile.naturalWonder}]!",
|
||||
tile.position, NotificationCategory.General, "StatIcons/Happiness")
|
||||
|
||||
var goldGained = 0
|
||||
val discoveredNaturalWonders = civInfo.gameInfo.civilizations.filter { it != civInfo && it.isMajorCiv() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user