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