fix: MatchingDeclarationName warnings

This commit is contained in:
Ban Alexandru 2023-06-30 03:32:42 +03:00
parent 875a3fe595
commit 9475af5052
32 changed files with 181 additions and 181 deletions

View File

@ -19,7 +19,7 @@ import com.unciv.logic.civilization.CivilizationInfoPreview
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.Notification
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.managers.TechManager
import com.unciv.logic.civilization.managers.TurnManager
@ -436,21 +436,21 @@ class GameInfo : IsPartOfGameInfoSerialization, HasGameInfoSerializationVersion
if (tiles.size < 3) {
for (tile in tiles) {
val unitName = tile.militaryUnit!!.name
thisPlayer.addNotification("An enemy [$unitName] was spotted $inOrNear our territory", tile.position, NotificationCategory.War, NotificationIcon.War, unitName)
thisPlayer.addNotification("An enemy [$unitName] was spotted $inOrNear our territory", tile.position, NotificationCategory.War, NotificationIcons.War, unitName)
}
} else {
val positions = tiles.asSequence().map { it.position }
thisPlayer.addNotification("[${tiles.size}] enemy units were spotted $inOrNear our territory", LocationAction(positions), NotificationCategory.War, NotificationIcon.War)
thisPlayer.addNotification("[${tiles.size}] enemy units were spotted $inOrNear our territory", LocationAction(positions), NotificationCategory.War, NotificationIcons.War)
}
}
private fun addBombardNotification(thisPlayer: Civilization, cities: List<City>) {
if (cities.size < 3) {
for (city in cities)
thisPlayer.addNotification("Your city [${city.name}] can bombard the enemy!", city.location, NotificationCategory.War, NotificationIcon.City, NotificationIcon.Crosshair)
thisPlayer.addNotification("Your city [${city.name}] can bombard the enemy!", city.location, NotificationCategory.War, NotificationIcons.City, NotificationIcons.Crosshair)
} else {
val positions = cities.asSequence().map { it.location }
thisPlayer.addNotification("[${cities.size}] of your cities can bombard the enemy!", LocationAction(positions), NotificationCategory.War, NotificationIcon.City, NotificationIcon.Crosshair)
thisPlayer.addNotification("[${cities.size}] of your cities can bombard the enemy!", LocationAction(positions), NotificationCategory.War, NotificationIcons.City, NotificationIcons.Crosshair)
}
}

View File

@ -5,7 +5,7 @@ import com.unciv.logic.automation.civilization.NextTurnAutomation
import com.unciv.logic.city.CityConstructions
import com.unciv.logic.civilization.CityAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.map.BFS
import com.unciv.models.ruleset.Building
@ -117,7 +117,7 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
"Work has started on [$chosenConstruction]",
CityAction(city.location),
NotificationCategory.Production,
NotificationIcon.Construction
NotificationIcons.Construction
)
cityConstructions.currentConstructionFromQueue = chosenConstruction
}

View File

@ -6,7 +6,7 @@ import com.unciv.json.HashMapVector2
import com.unciv.logic.GameInfo
import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.TileMap
import com.unciv.logic.map.tile.Tile
import com.unciv.models.ruleset.unique.UniqueType
@ -161,7 +161,7 @@ class BarbarianManager : IsPartOfGameInfoSerialization {
&& it.hasExplored(tile)
}
.forEach {
it.addNotification("A new barbarian encampment has spawned!", tile.position, NotificationCategory.War, NotificationIcon.War)
it.addNotification("A new barbarian encampment has spawned!", tile.position, NotificationCategory.War, NotificationIcons.War)
it.lastSeenImprovement[tile.position] = Constants.barbarianEncampment
}
}

View File

@ -11,7 +11,7 @@ import com.unciv.logic.city.City
import com.unciv.logic.civilization.AlertType
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.civilization.diplomacy.DiplomacyFlags
@ -127,11 +127,11 @@ object NextTurnAutomation {
civInfo.tradeRequests.remove(tradeRequest)
if (TradeEvaluation().isTradeAcceptable(tradeLogic.currentTrade, civInfo, otherCiv)) {
tradeLogic.acceptTrade()
otherCiv.addNotification("[${civInfo.civName}] has accepted your trade request", NotificationCategory.Trade, NotificationIcon.Trade, civInfo.civName)
otherCiv.addNotification("[${civInfo.civName}] has accepted your trade request", NotificationCategory.Trade, NotificationIcons.Trade, civInfo.civName)
} else {
val counteroffer = getCounteroffer(civInfo, tradeRequest)
if (counteroffer != null) {
otherCiv.addNotification("[${civInfo.civName}] has made a counteroffer to your trade request", NotificationCategory.Trade, NotificationIcon.Trade, civInfo.civName)
otherCiv.addNotification("[${civInfo.civName}] has made a counteroffer to your trade request", NotificationCategory.Trade, NotificationIcons.Trade, civInfo.civName)
otherCiv.tradeRequests.add(counteroffer)
} else
tradeRequest.decline(civInfo)
@ -272,8 +272,8 @@ object NextTurnAutomation {
if (diploManager.isRelationshipLevelGT(RelationshipLevel.Neutral)
&& !diploManager.otherCivDiplomacy().hasFlag(DiplomacyFlags.Denunciation)) {
diploManager.signDeclarationOfFriendship()
requestingCiv.addNotification("We have signed a Declaration of Friendship with [${civInfo.civName}]!", NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, civInfo.civName)
} else requestingCiv.addNotification("[${civInfo.civName}] has denied our Declaration of Friendship!", NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, civInfo.civName)
requestingCiv.addNotification("We have signed a Declaration of Friendship with [${civInfo.civName}]!", NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, civInfo.civName)
} else requestingCiv.addNotification("[${civInfo.civName}] has denied our Declaration of Friendship!", NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, civInfo.civName)
}
}

View File

@ -10,7 +10,7 @@ import com.unciv.logic.civilization.AlertType
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
@ -145,7 +145,7 @@ object Battle {
defender.takeDamage(-1) // Back to 2 HP
val ransom = min(200, defender.city.civ.gold)
defender.city.civ.addGold(-ransom)
defender.city.civ.addNotification("Barbarians raided [${defender.city.name}] and stole [$ransom] Gold from your treasury!", defender.city.location, NotificationCategory.War, NotificationIcon.War)
defender.city.civ.addNotification("Barbarians raided [${defender.city.name}] and stole [$ransom] Gold from your treasury!", defender.city.location, NotificationCategory.War, NotificationIcons.War)
attacker.unit.destroy() // Remove the barbarian
} else
conquerCity(defender.city, attacker)
@ -428,8 +428,8 @@ object Battle {
"Your [${plunderingUnit.getName()}] plundered [${plunderedAmount}] [${key.name}] from [${plunderedUnit.getName()}]",
plunderedUnit.getTile().position,
NotificationCategory.War,
plunderingUnit.getName(), NotificationIcon.War, "StatIcons/${key.name}",
if (plunderedUnit is CityCombatant) NotificationIcon.City else plunderedUnit.getName()
plunderingUnit.getName(), NotificationIcons.War, "StatIcons/${key.name}",
if (plunderedUnit is CityCombatant) NotificationIcons.City else plunderedUnit.getName()
)
}
}
@ -445,15 +445,15 @@ object Battle {
// If what happened was that a civilian unit was captured, that's dealt with in the captureCivilianUnit function
val (whatHappenedIcon, whatHappenedString) = when {
attacker !is CityCombatant && attacker.isDefeated() ->
NotificationIcon.War to " was destroyed while attacking"
NotificationIcons.War to " was destroyed while attacking"
!defender.isDefeated() ->
NotificationIcon.War to " has attacked"
NotificationIcons.War to " has attacked"
defender.isCity() && attacker.isMelee() && attacker.getCivInfo().isBarbarian() ->
NotificationIcon.War to " has raided"
NotificationIcons.War to " has raided"
defender.isCity() && attacker.isMelee() ->
NotificationIcon.War to " has captured"
NotificationIcons.War to " has captured"
else ->
NotificationIcon.Death to " has destroyed"
NotificationIcons.Death to " has destroyed"
}
val attackerString =
if (attacker.isCity()) "Enemy city [" + attacker.getName() + "]"
@ -466,8 +466,8 @@ object Battle {
val attackerHurtString = if (damageDealt != null) " ([-${damageDealt.defenderDealt}] HP)" else ""
val defenderHurtString = if (damageDealt != null) " ([-${damageDealt.attackerDealt}] HP)" else ""
val notificationString = attackerString + attackerHurtString + whatHappenedString + defenderString + defenderHurtString
val attackerIcon = if (attacker is CityCombatant) NotificationIcon.City else attacker.getName()
val defenderIcon = if (defender is CityCombatant) NotificationIcon.City else defender.getName()
val attackerIcon = if (attacker is CityCombatant) NotificationIcons.City else attacker.getName()
val defenderIcon = if (defender is CityCombatant) NotificationIcons.City else defender.getName()
val locations = LocationAction(attackedTile.position, attackerTile?.position)
defender.getCivInfo().addNotification(notificationString, locations, NotificationCategory.War, attackerIcon, whatHappenedIcon, defenderIcon)
}
@ -587,7 +587,7 @@ object Battle {
private fun conquerCity(city: City, attacker: MapUnitCombatant) {
val attackerCiv = attacker.getCivInfo()
attackerCiv.addNotification("We have conquered the city of [${city.name}]!", city.location, NotificationCategory.War, NotificationIcon.War)
attackerCiv.addNotification("We have conquered the city of [${city.name}]!", city.location, NotificationCategory.War, NotificationIcons.War)
city.hasJustBeenConquered = true
city.getCenterTile().apply {
@ -699,13 +699,13 @@ object Battle {
defenderCiv.addNotification(
"An enemy [${attacker.getName()}] has captured our [${defender.getName()}]",
defender.getTile().position, NotificationCategory.War, attacker.getName(),
NotificationIcon.War, defender.getName()
NotificationIcons.War, defender.getName()
)
else {
defenderCiv.addNotification(
"An enemy [${attacker.getName()}] has destroyed our [${defender.getName()}]",
defender.getTile().position, NotificationCategory.War, attacker.getName(),
NotificationIcon.War, defender.getName()
NotificationIcons.War, defender.getName()
)
triggerDefeatUniques(defender, attacker, capturedUnitTile)
}
@ -774,7 +774,7 @@ object Battle {
&& civSuffered.getDiplomacyManager(attackingCiv).diplomaticStatus != DiplomaticStatus.War
) {
attackingCiv.getDiplomacyManager(civSuffered).declareWar()
attackingCiv.addNotification("After being hit by our [${attacker.getName()}], [${civSuffered}] has declared war on us!", targetTile.position, NotificationCategory.Diplomacy, NotificationIcon.War)
attackingCiv.addNotification("After being hit by our [${attacker.getName()}], [${civSuffered}] has declared war on us!", targetTile.position, NotificationCategory.Diplomacy, NotificationIcons.War)
}
}
@ -789,7 +789,7 @@ object Battle {
// Declare war on the owners of all hit tiles
for (hitCiv in hitTiles.mapNotNull { it.getOwner() }.distinct()) {
hitCiv.addNotification("A(n) [${attacker.getName()}] exploded in our territory!", targetTile.position, NotificationCategory.War, NotificationIcon.War)
hitCiv.addNotification("A(n) [${attacker.getName()}] exploded in our territory!", targetTile.position, NotificationCategory.War, NotificationIcons.War)
tryDeclareWar(hitCiv)
}
@ -978,11 +978,11 @@ object Battle {
"Our [$interceptorName] ([-0] HP) intercepted and attacked an enemy [$attackerName] ([-0] HP)"
attacker.getCivInfo().addNotification(
attackerText, locations, NotificationCategory.War,
attackerName, NotificationIcon.War, interceptorName
attackerName, NotificationIcons.War, interceptorName
)
interceptingCiv.addNotification(
interceptorText, locations, NotificationCategory.War,
interceptorName, NotificationIcon.War, attackerName
interceptorName, NotificationIcons.War, attackerName
)
attacker.unit.action = null
return
@ -1006,7 +1006,7 @@ object Battle {
attacker.getCivInfo().addNotification(
attackerText, locationsInterceptorUnknown, NotificationCategory.War,
attackerName, NotificationIcon.War, NotificationIcon.Question
attackerName, NotificationIcons.War, NotificationIcons.Question
)
val interceptorText =
@ -1019,7 +1019,7 @@ object Battle {
interceptingCiv.addNotification(
interceptorText, locations, NotificationCategory.War,
interceptorName, NotificationIcon.War, attackerName
interceptorName, NotificationIcons.War, attackerName
)
attacker.unit.action = null
return
@ -1085,14 +1085,14 @@ object Battle {
attacker.getCivInfo().addNotification(
attackerText, interceptor.currentTile.position, NotificationCategory.War,
attackerName, NotificationIcon.War, interceptorName
attackerName, NotificationIcons.War, interceptorName
)
val interceptorText = if (attacker.isDefeated())
"Our [$interceptorName] ([-0] HP) intercepted and destroyed an enemy [$attackerName] ([-$damage] HP)"
else "Our [$interceptorName] ([-0] HP) intercepted and attacked an enemy [$attackerName] ([-$damage] HP)"
interceptingCiv.addNotification(interceptorText, locations, NotificationCategory.War,
interceptorName, NotificationIcon.War, attackerName)
interceptorName, NotificationIcons.War, attackerName)
return DamageDealt(0, damage)
}
@ -1152,8 +1152,8 @@ object Battle {
val attackingUnit = attackBaseUnit.name; val defendingUnit = defendBaseUnit.name
val notificationString = "[$defendingUnit] withdrew from a [$attackingUnit]"
val locations = LocationAction(toTile.position, attacker.getTile().position)
defender.getCivInfo().addNotification(notificationString, locations, NotificationCategory.War, defendingUnit, NotificationIcon.War, attackingUnit)
attacker.getCivInfo().addNotification(notificationString, locations, NotificationCategory.War, defendingUnit, NotificationIcon.War, attackingUnit)
defender.getCivInfo().addNotification(notificationString, locations, NotificationCategory.War, defendingUnit, NotificationIcons.War, attackingUnit)
attacker.getCivInfo().addNotification(notificationString, locations, NotificationCategory.War, defendingUnit, NotificationIcons.War, attackingUnit)
return true
}

View File

@ -7,7 +7,7 @@ import com.unciv.logic.automation.Automation
import com.unciv.logic.automation.city.ConstructionAutomation
import com.unciv.logic.civilization.AlertType
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.map.mapunit.MapUnit
import com.unciv.logic.map.tile.Tile
@ -393,7 +393,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
"Excess production for [$constructionName] converted to [$workDone] gold",
city.location,
NotificationCategory.Production,
NotificationIcon.Gold, "BuildingIcons/${constructionName}")
NotificationIcons.Gold, "BuildingIcons/${constructionName}")
}
} else if (construction is BaseUnit) {
// Production put into upgradable units gets put into upgraded version
@ -424,12 +424,12 @@ class CityConstructions : IsPartOfGameInfoSerialization {
when {
otherCiv.hasExplored(city.getCenterTile()) ->
otherCiv.addNotification("The city of [${city.name}] has started constructing [${construction.name}]!",
city.location, NotificationCategory.General, NotificationIcon.Construction, buildingIcon)
city.location, NotificationCategory.General, NotificationIcons.Construction, buildingIcon)
otherCiv.knows(city.civ) ->
otherCiv.addNotification("[${city.civ.civName}] has started constructing [${construction.name}]!",
NotificationCategory.General, NotificationIcon.Construction, buildingIcon)
NotificationCategory.General, NotificationIcons.Construction, buildingIcon)
else -> otherCiv.addNotification("An unknown civilization has started constructing [${construction.name}]!",
NotificationCategory.General, NotificationIcon.Construction, buildingIcon)
NotificationCategory.General, NotificationIcons.Construction, buildingIcon)
}
}
}
@ -460,7 +460,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
val icon = if (construction is Building) buildingIcon else construction.name // could be a unit, in which case take the unit name.
city.civ.addNotification(
"[${construction.name}] has been built in [${city.name}]",
city.location, NotificationCategory.Production, NotificationIcon.Construction, icon)
city.location, NotificationCategory.Production, NotificationIcons.Construction, icon)
}
if (construction is Building && construction.hasUnique(UniqueType.TriggersAlertOnCompletion,
@ -472,7 +472,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
val completingCivDescription =
if (otherCiv.knows(city.civ)) "[${city.civ.civName}]" else "An unknown civilization"
otherCiv.addNotification("$completingCivDescription has completed [${construction.name}]!",
NotificationCategory.General, NotificationIcon.Construction, buildingIcon)
NotificationCategory.General, NotificationIcons.Construction, buildingIcon)
}
}
return true

View File

@ -7,7 +7,7 @@ import com.unciv.logic.city.City
import com.unciv.logic.city.CityFlags
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
import com.unciv.logic.civilization.diplomacy.DiplomaticStatus
import com.unciv.logic.trade.TradeLogic
@ -94,7 +94,7 @@ class CityConquestFunctions(val city: City){
val goldPlundered = getGoldForCapturingCity(conqueringCiv)
conqueringCiv.addGold(goldPlundered)
conqueringCiv.addNotification("Received [$goldPlundered] Gold for capturing [${city.name}]",
city.getCenterTile().position, NotificationCategory.General, NotificationIcon.Gold)
city.getCenterTile().position, NotificationCategory.General, NotificationIcons.Gold)
val reconqueredCityWhileStillInResistance = city.previousOwner == receivingCiv.civName && city.isInResistance()
@ -201,11 +201,11 @@ class CityConquestFunctions(val city: City){
if (civ == foundingCiv || civ == conqueringCiv) continue // don't need to notify these civs
when {
civ.knows(conqueringCiv) && civ.knows(foundingCiv) ->
civ.addNotification("[$conqueringCiv] has liberated [$foundingCiv]", NotificationCategory.Diplomacy, foundingCiv.civName, NotificationIcon.Diplomacy, conqueringCiv.civName)
civ.addNotification("[$conqueringCiv] has liberated [$foundingCiv]", NotificationCategory.Diplomacy, foundingCiv.civName, NotificationIcons.Diplomacy, conqueringCiv.civName)
civ.knows(conqueringCiv) && !civ.knows(foundingCiv) ->
civ.addNotification("[$conqueringCiv] has liberated an unknown civilization", NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, conqueringCiv.civName)
civ.addNotification("[$conqueringCiv] has liberated an unknown civilization", NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, conqueringCiv.civName)
!civ.knows(conqueringCiv) && civ.knows(foundingCiv) ->
civ.addNotification("An unknown civilization has liberated [$foundingCiv]", NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, foundingCiv.civName)
civ.addNotification("An unknown civilization has liberated [$foundingCiv]", NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, foundingCiv.civName)
else -> continue
}
}

View File

@ -4,7 +4,7 @@ import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.city.City
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.models.Spy
enum class SpyFleeReason {
@ -43,7 +43,7 @@ class CityEspionageManager : IsPartOfGameInfoSerialization {
SpyFleeReason.CityCaptured -> "After the city of [${city.name}] was conquered, your spy [${spy.name}] has fled back to our hideout."
else -> "Due to the chaos ensuing in [${city.name}], your spy [${spy.name}] has fled back to our hideout."
}
owningCiv.addNotification(notificationString, city.location, NotificationCategory.Espionage, NotificationIcon.Spy)
owningCiv.addNotification(notificationString, city.location, NotificationCategory.Espionage, NotificationIcons.Spy)
spy.location = null
}
}

View File

@ -6,7 +6,7 @@ import com.unciv.logic.automation.Automation
import com.unciv.logic.city.City
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.tile.Tile
import com.unciv.models.ruleset.unique.LocalUniqueCache
import com.unciv.models.ruleset.unique.UniqueType
@ -195,7 +195,7 @@ class CityExpansionManager : IsPartOfGameInfoSerialization {
if (location != null) {
val locations = LocationAction(location, city.location)
city.civ.addNotification("[${city.name}] has expanded its borders!", locations,
NotificationCategory.Cities, NotificationIcon.Culture)
NotificationCategory.Cities, NotificationIcons.Culture)
}
}
}

View File

@ -5,7 +5,7 @@ import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.automation.Automation
import com.unciv.logic.city.City
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.tile.Tile
import com.unciv.models.Counter
import com.unciv.models.ruleset.unique.LocalUniqueCache
@ -96,7 +96,7 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
foodStored += food
if (food < 0)
city.civ.addNotification("[${city.name}] is starving!",
city.location, NotificationCategory.Cities, NotificationIcon.Growth, NotificationIcon.Death)
city.location, NotificationCategory.Cities, NotificationIcons.Growth, NotificationIcons.Death)
if (foodStored < 0) { // starvation!
if (population > 1) addPopulation(-1)
foodStored = 0
@ -120,7 +120,7 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
addPopulation(1)
city.updateCitizens = true
city.civ.addNotification("[${city.name}] has grown!", city.location,
NotificationCategory.Cities, NotificationIcon.Growth)
NotificationCategory.Cities, NotificationIcons.Growth)
}
fun addPopulation(count: Int) {

View File

@ -4,7 +4,7 @@ import com.unciv.Constants
import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.city.City
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.models.Counter
import com.unciv.models.Religion
import com.unciv.models.ruleset.unique.Unique
@ -107,7 +107,7 @@ class CityReligionManager : IsPartOfGameInfoSerialization {
private fun triggerReligionAdoption(newMajorityReligion: String) {
val newMajorityReligionObject = city.civ.gameInfo.religions[newMajorityReligion]!!
city.civ.addNotification("Your city [${city.name}] was converted to [${newMajorityReligionObject.getReligionDisplayName()}]!",
city.location, NotificationCategory.Religion, NotificationIcon.Faith)
city.location, NotificationCategory.Religion, NotificationIcons.Faith)
if (newMajorityReligion in religionsAtSomePointAdopted) return
@ -127,13 +127,13 @@ class CityReligionManager : IsPartOfGameInfoSerialization {
"You gained [$statsGranted] as your religion was spread to [${city.name}]",
city.location,
NotificationCategory.Religion,
NotificationIcon.Faith
NotificationIcons.Faith
)
else
religionOwningCiv.addNotification(
"You gained [$statsGranted] as your religion was spread to an unknown city",
NotificationCategory.Religion,
NotificationIcon.Faith
NotificationIcons.Faith
)
}
religionsAtSomePointAdopted.add(newMajorityReligion)

View File

@ -4,7 +4,7 @@ import com.unciv.logic.city.CityFlags
import com.unciv.logic.city.CityFocus
import com.unciv.logic.city.City
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.models.ruleset.tile.ResourceType
import com.unciv.models.ruleset.unique.UniqueType
import kotlin.math.min
@ -50,7 +50,7 @@ class CityTurnManager(val city: City) {
city.setFlag(CityFlags.WeLoveTheKing, 20 + 1) // +1 because it will be decremented by 1 in the same startTurn()
city.civ.addNotification(
"Because they have [${city.demandedResource}], the citizens of [${city.name}] are celebrating We Love The King Day!",
city.location, NotificationCategory.General, NotificationIcon.City, NotificationIcon.Happiness)
city.location, NotificationCategory.General, NotificationIcons.City, NotificationIcons.Happiness)
}
}
@ -70,7 +70,7 @@ class CityTurnManager(val city: City) {
CityFlags.WeLoveTheKing.name -> {
city.civ.addNotification(
"We Love The King Day in [${city.name}] has ended.",
city.location, NotificationCategory.General, NotificationIcon.City)
city.location, NotificationCategory.General, NotificationIcons.City)
demandNewResource()
}
CityFlags.Resistance.name -> {
@ -105,7 +105,7 @@ class CityTurnManager(val city: City) {
city.setFlag(CityFlags.ResourceDemand, 15 + Random.Default.nextInt(10))
else
city.civ.addNotification("[${city.name}] demands [${city.demandedResource}]!",
city.location, NotificationCategory.General, NotificationIcon.City, "ResourceIcons/${city.demandedResource}")
city.location, NotificationCategory.General, NotificationIcons.City, "ResourceIcons/${city.demandedResource}")
}

View File

@ -784,7 +784,7 @@ class Civilization : IsPartOfGameInfoSerialization {
val destructionText = if (isMajorCiv()) "The civilization of [$civName] has been destroyed!"
else "The City-State of [$civName] has been destroyed!"
for (civ in gameInfo.civilizations)
civ.addNotification(destructionText, NotificationCategory.General, civName, NotificationIcon.Death)
civ.addNotification(destructionText, NotificationCategory.General, civName, NotificationIcons.Death)
units.getCivUnits().forEach { it.destroy() }
tradeRequests.clear() // if we don't do this then there could be resources taken by "pending" trades forever
for (diplomacyManager in diplomacy.values) {

View File

@ -1,6 +1,6 @@
package com.unciv.logic.civilization
object NotificationIcon {
object NotificationIcons {
// Remember: The typical white-on-transparency icon will not be visible on Notifications
const val Barbarians = "ImprovementIcons/Barbarian encampment"

View File

@ -9,7 +9,7 @@ import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.DiplomacyAction
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.civilization.Proximity
@ -237,11 +237,11 @@ class CityStateFunctions(val civInfo: Civilization) {
val text = "We have allied with [${civInfo.civName}]."
if (capitalLocation != null) newAllyCiv.addNotification(text, capitalLocation,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy
NotificationIcons.Diplomacy
)
else newAllyCiv.addNotification(text,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy
NotificationIcons.Diplomacy
)
newAllyCiv.cache.updateViewableTiles()
newAllyCiv.cache.updateCivResources()
@ -264,11 +264,11 @@ class CityStateFunctions(val civInfo: Civilization) {
val text = "We have lost alliance with [${civInfo.civName}]."
if (capitalLocation != null) oldAllyCiv.addNotification(text, capitalLocation,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy
NotificationIcons.Diplomacy
)
else oldAllyCiv.addNotification(text,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy
NotificationIcons.Diplomacy
)
oldAllyCiv.cache.updateViewableTiles()
oldAllyCiv.cache.updateCivResources()
@ -309,12 +309,12 @@ class CityStateFunctions(val civInfo: Civilization) {
otherCiv.addNotification("We have married into the ruling family of [${civInfo.civName}], bringing them under our control.",
civInfo.getCapital()!!.location,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy, otherCiv.civName)
NotificationIcons.Diplomacy, otherCiv.civName)
for (civ in civInfo.gameInfo.civilizations.filter { it != otherCiv })
civ.addNotification("[${otherCiv.civName}] has married into the ruling family of [${civInfo.civName}], bringing them under their control.",
civInfo.getCapital()!!.location,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy, otherCiv.civName)
NotificationIcons.Diplomacy, otherCiv.civName)
for (unit in civInfo.units.getCivUnits())
unit.gift(otherCiv)
@ -521,7 +521,7 @@ class CityStateFunctions(val civInfo: Civilization) {
if (protector.playerType != PlayerType.Human) // Humans can have their own emotions
bully.addNotification("[${protector.civName}] is upset that you demanded tribute from [${civInfo.civName}], whom they have pledged to protect!",
NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, protector.civName)
NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, protector.civName)
else // Let humans choose who to side with
protector.popupAlerts.add(
PopupAlert(
@ -606,7 +606,7 @@ class CityStateFunctions(val civInfo: Civilization) {
if (protector.playerType != PlayerType.Human) // Humans can have their own emotions
attacker.addNotification("[${protector.civName}] is upset that you attacked [${civInfo.civName}], whom they have pledged to protect!",
NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, protector.civName)
NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, protector.civName)
else // Let humans choose who to side with
protector.popupAlerts.add(
PopupAlert(
@ -636,9 +636,9 @@ class CityStateFunctions(val civInfo: Civilization) {
if (protector.playerType != PlayerType.Human) // Humans can have their own emotions
attacker.addNotification("[${protector.civName}] is outraged that you destroyed [${civInfo.civName}], whom they had pledged to protect!",
NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, protector.civName)
NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, protector.civName)
protector.addNotification("[${attacker.civName}] has destroyed [${civInfo.civName}], whom you had pledged to protect!",
NotificationCategory.Diplomacy, attacker.civName, NotificationIcon.Death, civInfo.civName)
NotificationCategory.Diplomacy, attacker.civName, NotificationIcons.Death, civInfo.civName)
}
// Notify all City-States that we were killed (for quest completion)

View File

@ -4,7 +4,7 @@ import com.unciv.UncivGame
import com.unciv.logic.civilization.AlertType
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.map.mapunit.UnitMovement
import com.unciv.logic.map.tile.Tile
@ -64,12 +64,12 @@ class DiplomacyFunctions(val civInfo: Civilization){
meetString = "[${civInfo.civName}] has given us [${giftAmount}] as we are the first major civ to meet them"
}
if (cityStateLocation != null)
otherCiv.addNotification(meetString, cityStateLocation, NotificationCategory.Diplomacy, NotificationIcon.Gold)
otherCiv.addNotification(meetString, cityStateLocation, NotificationCategory.Diplomacy, NotificationIcons.Gold)
else
otherCiv.addNotification(meetString, NotificationCategory.Diplomacy, NotificationIcon.Gold)
otherCiv.addNotification(meetString, NotificationCategory.Diplomacy, NotificationIcons.Gold)
if (otherCiv.isCityState() && otherCiv.cityStateFunctions.canProvideStat(Stat.Faith)){
otherCiv.addNotification(religionMeetString, NotificationCategory.Diplomacy, NotificationIcon.Faith)
otherCiv.addNotification(religionMeetString, NotificationCategory.Diplomacy, NotificationIcons.Faith)
for ((key, value) in faithAmount)
otherCiv.addStat(key, value.toInt())

View File

@ -6,7 +6,7 @@ import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.civilization.AlertType
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.trade.Trade
import com.unciv.logic.trade.TradeOffer
@ -458,8 +458,8 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
remakePeaceTreaty(trade.theirOffers.first { it.name == Constants.peaceTreaty }.duration)
}
civInfo.addNotification("One of our trades with [$otherCivName] has been cut short", NotificationCategory.Trade, NotificationIcon.Trade, otherCivName)
otherCiv().addNotification("One of our trades with [${civInfo.civName}] has been cut short", NotificationCategory.Trade, NotificationIcon.Trade, civInfo.civName)
civInfo.addNotification("One of our trades with [$otherCivName] has been cut short", NotificationCategory.Trade, NotificationIcons.Trade, otherCivName)
otherCiv().addNotification("One of our trades with [${civInfo.civName}] has been cut short", NotificationCategory.Trade, NotificationIcons.Trade, civInfo.civName)
civInfo.cache.updateCivResources()
}
}
@ -525,14 +525,14 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
if (getTurnsToRelationshipChange() == 1) {
val text = "Your relationship with [${civInfo.civName}] is about to degrade"
if (civCapitalLocation != null) otherCiv().addNotification(text,
civCapitalLocation, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy)
else otherCiv().addNotification(text, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy)
civCapitalLocation, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy)
else otherCiv().addNotification(text, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy)
}
if (initialRelationshipLevel >= RelationshipLevel.Friend && initialRelationshipLevel != relationshipIgnoreAfraid()) {
val text = "Your relationship with [${civInfo.civName}] degraded"
if (civCapitalLocation != null) otherCiv().addNotification(text, civCapitalLocation, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy)
else otherCiv().addNotification(text, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy)
if (civCapitalLocation != null) otherCiv().addNotification(text, civCapitalLocation, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy)
else otherCiv().addNotification(text, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy)
}
// Potentially notify about afraid status
@ -543,8 +543,8 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
) {
setFlag(DiplomacyFlags.NotifiedAfraid, 20) // Wait 20 turns until next reminder
val text = "[${civInfo.civName}] is afraid of your military power!"
if (civCapitalLocation != null) otherCiv().addNotification(text, civCapitalLocation, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy)
else otherCiv().addNotification(text, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy)
if (civCapitalLocation != null) otherCiv().addNotification(text, civCapitalLocation, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy)
else otherCiv().addNotification(text, NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy)
}
}
}
@ -635,8 +635,8 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
trades.remove(trade)
for (offer in trade.ourOffers.union(trade.theirOffers).filter { it.duration == 0 }) { // this was a timed trade
if (offer in trade.theirOffers)
civInfo.addNotification("[${offer.name}] from [$otherCivName] has ended", NotificationCategory.Trade, otherCivName, NotificationIcon.Trade)
else civInfo.addNotification("[${offer.name}] to [$otherCivName] has ended", NotificationCategory.Trade, otherCivName, NotificationIcon.Trade)
civInfo.addNotification("[${offer.name}] from [$otherCivName] has ended", NotificationCategory.Trade, otherCivName, NotificationIcons.Trade)
else civInfo.addNotification("[${offer.name}] to [$otherCivName] has ended", NotificationCategory.Trade, otherCivName, NotificationIcons.Trade)
civInfo.updateStatsForNextTurn() // if they were bringing us gold per turn
if (trade.theirOffers.union(trade.ourOffers) // if resources were involved
@ -648,9 +648,9 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
for (offer in trade.theirOffers.filter { it.duration <= 3 })
{
if (offer.duration == 3)
civInfo.addNotification("[${offer.name}] from [$otherCivName] will end in [3] turns", NotificationCategory.Trade, otherCivName, NotificationIcon.Trade)
civInfo.addNotification("[${offer.name}] from [$otherCivName] will end in [3] turns", NotificationCategory.Trade, otherCivName, NotificationIcons.Trade)
else if (offer.duration == 1)
civInfo.addNotification("[${offer.name}] from [$otherCivName] will end next turn", NotificationCategory.Trade, otherCivName, NotificationIcon.Trade)
civInfo.addNotification("[${offer.name}] from [$otherCivName] will end next turn", NotificationCategory.Trade, otherCivName, NotificationIcons.Trade)
}
}
}
@ -719,7 +719,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
for (trade in trades)
for (offer in trade.theirOffers.filter { it.duration > 0 })
civInfo.addNotification("[${offer.name}] from [$otherCivName] has ended",
NotificationCategory.Trade, otherCivName, NotificationIcon.Trade)
NotificationCategory.Trade, otherCivName, NotificationIcons.Trade)
trades.clear()
updateHasOpenBorders()
@ -784,12 +784,12 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
otherCivDiplomacy.onWarDeclared()
otherCiv.addNotification("[${civInfo.civName}] has declared war on us!",
NotificationCategory.Diplomacy, NotificationIcon.War, civInfo.civName)
NotificationCategory.Diplomacy, NotificationIcons.War, civInfo.civName)
otherCiv.popupAlerts.add(PopupAlert(AlertType.WarDeclaration, civInfo.civName))
getCommonKnownCivs().forEach {
it.addNotification("[${civInfo.civName}] has declared war on [$otherCivName]!",
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.War, otherCivName)
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.War, otherCivName)
}
otherCivDiplomacy.setModifier(DiplomaticModifiers.DeclaredWarOnUs, -20f)
@ -852,7 +852,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
for (civ in getCommonKnownCivs()) {
civ.addNotification(
"[${civInfo.civName}] and [$otherCivName] have signed a Peace Treaty!",
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy, otherCivName
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy, otherCivName
)
}
}
@ -902,7 +902,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
for (thirdCiv in getCommonKnownCivs().filter { it.isMajorCiv() }) {
thirdCiv.addNotification("[${civInfo.civName}] and [$otherCivName] have signed the Declaration of Friendship!",
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy, otherCivName)
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy, otherCivName)
thirdCiv.getDiplomacyManager(civInfo).setFriendshipBasedModifier()
}
@ -936,12 +936,12 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
otherCivDiplomacy().setFlag(DiplomacyFlags.Denunciation, 30)
otherCiv().addNotification("[${civInfo.civName}] has denounced us!",
NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, civInfo.civName)
NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, civInfo.civName)
// We, A, are denouncing B. What do other major civs (C,D, etc) think of this?
getCommonKnownCivs().filter { it.isMajorCiv() }.forEach { thirdCiv ->
thirdCiv.addNotification("[${civInfo.civName}] has denounced [$otherCivName]!",
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy, otherCivName)
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcons.Diplomacy, otherCivName)
val thirdCivRelationshipWithOtherCiv = thirdCiv.getDiplomacyManager(otherCiv()).relationshipIgnoreAfraid()
val thirdCivDiplomacyManager = thirdCiv.getDiplomacyManager(civInfo)
when (thirdCivRelationshipWithOtherCiv) {
@ -958,7 +958,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
otherCivDiplomacy().setFlag(DiplomacyFlags.AgreedToNotSettleNearUs, 100)
addModifier(DiplomaticModifiers.UnacceptableDemands, -10f)
otherCiv().addNotification("[${civInfo.civName}] agreed to stop settling cities near us!",
NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, civInfo.civName)
NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, civInfo.civName)
}
fun refuseDemandNotToSettleNear() {
@ -966,7 +966,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
otherCivDiplomacy().setFlag(DiplomacyFlags.IgnoreThemSettlingNearUs, 100)
otherCivDiplomacy().addModifier(DiplomaticModifiers.RefusedToNotSettleCitiesNearUs, -15f)
otherCiv().addNotification("[${civInfo.civName}] refused to stop settling cities near us!",
NotificationCategory.Diplomacy, NotificationIcon.Diplomacy, civInfo.civName)
NotificationCategory.Diplomacy, NotificationIcons.Diplomacy, civInfo.civName)
}
fun sideWithCityState() {

View File

@ -3,7 +3,7 @@ package com.unciv.logic.civilization.managers
import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.MapSize
import com.unciv.models.ruleset.Policy
import com.unciv.models.ruleset.Policy.PolicyBranchType
@ -244,7 +244,7 @@ class PolicyManager : IsPartOfGameInfoSerialization {
civ.addNotification(
"{${defaultNotificationText}} {${extraNotificationText}}",
NotificationCategory.General,
NotificationIcon.Culture
NotificationIcons.Culture
)
}
}

View File

@ -9,7 +9,7 @@ import com.unciv.logic.civilization.CivFlags
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.DiplomacyAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.Proximity
import com.unciv.logic.civilization.diplomacy.CityStatePersonality
@ -240,7 +240,7 @@ class QuestManager : IsPartOfGameInfoSerialization {
otherCiv.addNotification("[${civInfo.civName}] is being invaded by Barbarians! Destroy Barbarians near their territory to earn Influence.",
civInfo.getCapital()!!.location,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.War
NotificationIcons.War
)
}
civInfo.addFlag(CivFlags.TurnsTillCallForBarbHelp.name, 30)

View File

@ -8,7 +8,7 @@ import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.MayaLongCountAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.civilization.TechAction
@ -234,7 +234,7 @@ class TechManager : IsPartOfGameInfoSerialization {
scienceFromResearchAgreements = 0
civInfo.addNotification("We gained [$scienceBoost] Science from Research Agreement",
NotificationCategory.General,
NotificationIcon.Science)
NotificationIcons.Science)
}
if (overflowScience != 0) {
finalScienceToAdd += getOverflowScience(currentTechnologyName()!!)
@ -302,13 +302,13 @@ class TechManager : IsPartOfGameInfoSerialization {
updateTransientBooleans()
for (city in civInfo.cities) {
city.cityStats.update()
city.reassignPopulationDeferred()
city.reassignPopulationDeferred()
}
if (!civInfo.isSpectator() && showNotification)
civInfo.addNotification("Research of [$techName] has completed!", TechAction(techName),
NotificationCategory.General,
NotificationIcon.Science)
NotificationIcons.Science)
if (isNewTech)
civInfo.popupAlerts.add(PopupAlert(AlertType.TechResearched, techName))
@ -384,8 +384,8 @@ class TechManager : IsPartOfGameInfoSerialization {
"[$unit] has become obsolete and was removed from the queue in $cityText!"
else "$cityText changed production from [$unit] to [$newUnit]"
val icons = if (newUnit == null)
arrayOf(NotificationIcon.Construction)
else arrayOf(unit, NotificationIcon.Construction, newUnit)
arrayOf(NotificationIcons.Construction)
else arrayOf(unit, NotificationIcons.Construction, newUnit)
civInfo.addNotification(text, locationAction, NotificationCategory.Production, *icons)
}
}
@ -400,13 +400,13 @@ class TechManager : IsPartOfGameInfoSerialization {
civInfo.addNotification(
"You have entered the [$currentEra]!",
NotificationCategory.General,
NotificationIcon.Science
NotificationIcons.Science
)
if (civInfo.isMajorCiv()) {
for (knownCiv in civInfo.getKnownCivs()) {
knownCiv.addNotification(
"[${civInfo.civName}] has entered the [$currentEra]!",
NotificationCategory.General, civInfo.civName, NotificationIcon.Science
NotificationCategory.General, civInfo.civName, NotificationIcons.Science
)
}
}
@ -417,7 +417,7 @@ class TechManager : IsPartOfGameInfoSerialization {
civInfo.addNotification(
"[${policyBranch.name}] policy branch unlocked!",
NotificationCategory.General,
NotificationIcon.Culture
NotificationIcons.Culture
)
}
}

View File

@ -8,7 +8,7 @@ import com.unciv.logic.civilization.AlertType
import com.unciv.logic.civilization.CivFlags
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.PopupAlert
import com.unciv.logic.map.mapunit.UnitTurnManager
@ -85,7 +85,7 @@ class TurnManager(val civInfo: Civilization) {
if (offeringCiv.isDefeated() || !TradeEvaluation().isTradeValid(tradeRequest.trade, civInfo, offeringCiv)) {
civInfo.tradeRequests.remove(tradeRequest)
// Yes, this is the right direction. I checked.
offeringCiv.addNotification("Our proposed trade is no longer relevant!", NotificationCategory.Trade, NotificationIcon.Trade)
offeringCiv.addNotification("Our proposed trade is no longer relevant!", NotificationCategory.Trade, NotificationIcons.Trade)
}
}
@ -261,7 +261,7 @@ class TurnManager(val civInfo: Civilization) {
?: break
unitToDisband.disband()
val unitName = unitToDisband.shortDisplayName()
civInfo.addNotification("Cannot provide unit upkeep for $unitName - unit has been disbanded!", NotificationCategory.Units, unitName, NotificationIcon.Death)
civInfo.addNotification("Cannot provide unit upkeep for $unitName - unit has been disbanded!", NotificationCategory.Units, unitName, NotificationIcons.Death)
// No need to recalculate unit upkeep, disband did that in UnitManager.removeUnit
nextTurnStats = civInfo.stats.statsForNextTurn
} while (civInfo.gold <= -200 && nextTurnStats.gold.toInt() < 0)

View File

@ -5,7 +5,7 @@ import com.unciv.Constants
import com.unciv.logic.city.City
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.Proximity
import com.unciv.logic.map.MapShape
@ -109,12 +109,12 @@ class CivInfoTransientCache(val civInfo: Civilization) {
civInfo.addNotification("We have encountered [${metCiv.civName}]!",
entry.value.position,
NotificationCategory.Diplomacy, metCiv.civName,
NotificationIcon.Diplomacy
NotificationIcons.Diplomacy
)
metCiv.addNotification("We have encountered [${civInfo.civName}]!",
entry.value.position,
NotificationCategory.Diplomacy, civInfo.civName,
NotificationIcon.Diplomacy
NotificationIcons.Diplomacy
)
}
@ -230,7 +230,7 @@ class CivInfoTransientCache(val civInfo: Civilization) {
if (goldGained > 0) {
civInfo.addGold(goldGained)
civInfo.addNotification("We have received [$goldGained] Gold for discovering [${tile.naturalWonder}]",
NotificationCategory.General, NotificationIcon.Gold
NotificationCategory.General, NotificationIcons.Gold
)
}
@ -264,14 +264,14 @@ class CivInfoTransientCache(val civInfo: Civilization) {
for (city in newConnectedCities)
if (city !in oldMaybeConnectedCities && city.civ == civInfo && city != civInfo.getCapital()!!)
civInfo.addNotification("[${city.name}] has been connected to your capital!",
city.location, NotificationCategory.Cities, NotificationIcon.Gold
city.location, NotificationCategory.Cities, NotificationIcons.Gold
)
// This may still contain cities that have just been destroyed by razing - thus the population test
for (city in oldConnectedCities)
if (city !in newConnectedCities && city.civ == civInfo && city.population.population > 0)
civInfo.addNotification("[${city.name}] has been disconnected from your capital!",
city.location, NotificationCategory.Cities, NotificationIcon.Gold
city.location, NotificationCategory.Cities, NotificationIcons.Gold
)
for (city in civInfo.cities)

View File

@ -9,7 +9,7 @@ import com.unciv.logic.battle.MapUnitCombatant
import com.unciv.logic.city.City
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.tile.Tile
import com.unciv.models.UnitActionType
import com.unciv.models.helpers.UnitMovementMemoryType
@ -664,7 +664,7 @@ class MapUnit : IsPartOfGameInfoSerialization {
"We have captured a barbarian encampment and recovered [${goldGained.toInt()}] gold!",
tile.position,
NotificationCategory.War,
NotificationIcon.Gold
NotificationIcons.Gold
)
}

View File

@ -4,7 +4,7 @@ import com.unciv.Constants
import com.unciv.UncivGame
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.tile.RoadStatus
import com.unciv.models.ruleset.unique.UniqueTriggerActivation
import com.unciv.models.ruleset.unique.UniqueType
@ -93,20 +93,20 @@ class UnitTurnManager(val unit: MapUnit) {
"An enemy [Citadel] has destroyed our [${unit.name}]",
locations,
NotificationCategory.War,
NotificationIcon.Citadel, NotificationIcon.Death, unit.name
NotificationIcons.Citadel, NotificationIcons.Death, unit.name
)
citadelTile.getOwner()?.addNotification(
"Your [Citadel] has destroyed an enemy [${unit.name}]",
locations,
NotificationCategory.War,
NotificationIcon.Citadel, NotificationIcon.Death, unit.name
NotificationIcons.Citadel, NotificationIcons.Death, unit.name
)
unit.destroy()
} else unit.civ.addNotification(
"An enemy [Citadel] has attacked our [${unit.name}]",
locations,
NotificationCategory.War,
NotificationIcon.Citadel, NotificationIcon.War, unit.name
NotificationIcons.Citadel, NotificationIcons.War, unit.name
)
}
@ -121,7 +121,7 @@ class UnitTurnManager(val unit: MapUnit) {
unit.currentTile.position,
NotificationCategory.Units,
unit.name,
NotificationIcon.Death
NotificationIcons.Death
)
unit.destroy()
} else if (tileDamage > 0) unit.civ.addNotification(
@ -230,7 +230,7 @@ class UnitTurnManager(val unit: MapUnit) {
val locations = LocationAction(tile.position, closestCity.location)
unit.civ.addNotification(
"Clearing a [$removedTerrainFeature] has created [$productionPointsToAdd] Production for [${closestCity.name}]",
locations, NotificationCategory.Production, NotificationIcon.Construction
locations, NotificationCategory.Production, NotificationIcons.Construction
)
}
}

View File

@ -4,7 +4,7 @@ import com.unciv.Constants
import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.diplomacy.DiplomacyFlags
class Trade : IsPartOfGameInfoSerialization {
@ -63,7 +63,7 @@ class TradeRequest : IsPartOfGameInfoSerialization {
if (trade.isPeaceTreaty()) diplomacyManager.setFlag(DiplomacyFlags.DeclinedPeace, 5)
requestingCivInfo.addNotification("[${decliningCiv.civName}] has denied your trade request",
NotificationCategory.Trade, decliningCiv.civName, NotificationIcon.Trade)
NotificationCategory.Trade, decliningCiv.civName, NotificationIcons.Trade)
}

View File

@ -5,7 +5,7 @@ import com.unciv.logic.IsPartOfGameInfoSerialization
import com.unciv.logic.city.City
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.managers.EspionageManager
import kotlin.random.Random
@ -91,7 +91,7 @@ class Spy() : IsPartOfGameInfoSerialization {
action = SpyAction.Surveillance
turnsRemainingForAction = 0
val notificationString = "Your spy [$name] cannot steal any more techs from [${getLocation()!!.civ}] as we've already researched all the technology they know!"
civInfo.addNotification(notificationString, getLocation()!!.location, NotificationCategory.Espionage, NotificationIcon.Spy)
civInfo.addNotification(notificationString, getLocation()!!.location, NotificationCategory.Espionage, NotificationIcons.Spy)
return
}
val techStealCost = stealableTechs.maxOfOrNull { civInfo.gameInfo.ruleset.technologies[it]!!.cost }!!
@ -129,11 +129,11 @@ class Spy() : IsPartOfGameInfoSerialization {
else -> null // Not detected
}
if (detectionString != null)
otherCiv.addNotification(detectionString, city.location, NotificationCategory.Espionage, NotificationIcon.Spy)
otherCiv.addNotification(detectionString, city.location, NotificationCategory.Espionage, NotificationIcons.Spy)
civInfo.addNotification("Your spy [$name] stole the Technology [$stolenTech] from [$city]!", city.location,
NotificationCategory.Espionage,
NotificationIcon.Spy
NotificationIcons.Spy
)

View File

@ -9,7 +9,7 @@ import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.MayaLongCountAction
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.managers.ReligionState
import com.unciv.logic.map.mapunit.MapUnit
import com.unciv.logic.map.tile.Tile
@ -149,7 +149,7 @@ object UniqueTriggerActivation {
"You may choose a free Policy")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Culture)
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Culture)
return true
}
UniqueType.OneTimeAmountFreePolicies -> {
@ -161,7 +161,7 @@ object UniqueTriggerActivation {
"You may choose [$newFreePolicies] free Policies")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Culture)
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Culture)
return true
}
UniqueType.OneTimeAdoptPolicy -> {
@ -175,7 +175,7 @@ object UniqueTriggerActivation {
"You gain the [$policyName] Policy")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Culture)
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Culture)
return true
}
UniqueType.OneTimeEnterGoldenAge, UniqueType.OneTimeEnterGoldenAgeTurns -> {
@ -186,7 +186,7 @@ object UniqueTriggerActivation {
"You enter a Golden Age")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Happiness)
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Happiness)
return true
}
@ -241,7 +241,7 @@ object UniqueTriggerActivation {
notification,
LocationAction(applicableCities.map { it.location }),
NotificationCategory.Cities,
NotificationIcon.Population
NotificationIcons.Population
)
return applicableCities.any()
}
@ -258,7 +258,7 @@ object UniqueTriggerActivation {
notificationText,
LocationAction(randomCity.location, tile?.position),
NotificationCategory.Cities,
NotificationIcon.Population
NotificationIcons.Population
)
}
return true
@ -268,7 +268,7 @@ object UniqueTriggerActivation {
if (civInfo.isSpectator()) return false
civInfo.tech.freeTechs += 1
if (notification != null) {
civInfo.addNotification(notification, NotificationCategory.General, NotificationIcon.Science)
civInfo.addNotification(notification, NotificationCategory.General, NotificationIcons.Science)
}
return true
}
@ -276,7 +276,7 @@ object UniqueTriggerActivation {
if (civInfo.isSpectator()) return false
civInfo.tech.freeTechs += unique.params[0].toInt()
if (notification != null) {
civInfo.addNotification(notification, NotificationCategory.General, NotificationIcon.Science)
civInfo.addNotification(notification, NotificationCategory.General, NotificationIcons.Science)
}
return true
}
@ -300,7 +300,7 @@ object UniqueTriggerActivation {
.toTypedArray()))
else notification
civInfo.addNotification(notificationText, LocationAction(tile?.position),
NotificationCategory.General, NotificationIcon.Science)
NotificationCategory.General, NotificationIcons.Science)
}
return true
@ -314,7 +314,7 @@ object UniqueTriggerActivation {
"You have discovered the secrets of [$techName]")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Science)
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Science)
return true
}
@ -324,7 +324,7 @@ object UniqueTriggerActivation {
civInfo.addNotification(
notification,
NotificationCategory.General,
NotificationIcon.Construction
NotificationIcons.Construction
)
}
return true
@ -342,7 +342,7 @@ object UniqueTriggerActivation {
"You have gained [$amount] [$resourceName]")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Science, "ResourceIcons/$resourceName")
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Science, "ResourceIcons/$resourceName")
return true
}
@ -358,13 +358,13 @@ object UniqueTriggerActivation {
"You have lost [$amount] [$resourceName]")
?: return true
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcon.Science, "ResourceIcons/$resourceName")
civInfo.addNotification(notificationText, NotificationCategory.General, NotificationIcons.Science, "ResourceIcons/$resourceName")
return true
}
UniqueType.OneTimeRevealEntireMap -> {
if (notification != null) {
civInfo.addNotification(notification, LocationAction(tile?.position), NotificationCategory.General, NotificationIcon.Scout)
civInfo.addNotification(notification, LocationAction(tile?.position), NotificationCategory.General, NotificationIcons.Scout)
}
civInfo.gameInfo.tileMap.values.asSequence()
.forEach { it.setExplored(civInfo, true) }
@ -419,7 +419,7 @@ object UniqueTriggerActivation {
civInfo.cityStateFunctions.turnsForGreatPersonFromCityState() / 2
)
if (notification != null) {
civInfo.addNotification(notification, NotificationCategory.Diplomacy, NotificationIcon.CityState)
civInfo.addNotification(notification, NotificationCategory.Diplomacy, NotificationIcons.CityState)
}
return true
}
@ -485,7 +485,7 @@ object UniqueTriggerActivation {
if (notification.hasPlaceholderParameters())
notification.fillPlaceholders(gainedFaith.toString())
else notification
civInfo.addNotification(notificationText, LocationAction(tile?.position), NotificationCategory.Religion, NotificationIcon.Faith)
civInfo.addNotification(notificationText, LocationAction(tile?.position), NotificationCategory.Religion, NotificationIcons.Faith)
}
return true
@ -503,7 +503,7 @@ object UniqueTriggerActivation {
if (notification.hasPlaceholderParameters())
notification.fillPlaceholders(gainedFaith.toString())
else notification
civInfo.addNotification(notificationText, LocationAction(tile?.position), NotificationCategory.Religion, NotificationIcon.Faith)
civInfo.addNotification(notificationText, LocationAction(tile?.position), NotificationCategory.Religion, NotificationIcons.Faith)
}
return true
@ -564,7 +564,7 @@ object UniqueTriggerActivation {
LocationAction(positions),
NotificationCategory.War,
if (unique.params[1] == Constants.barbarianEncampment)
NotificationIcon.Barbarians else NotificationIcon.Scout
NotificationIcons.Barbarians else NotificationIcons.Scout
)
}
@ -595,7 +595,7 @@ object UniqueTriggerActivation {
notification,
tile.position,
NotificationCategory.General,
NotificationIcon.Ruins
NotificationIcons.Ruins
)
return true
}
@ -608,7 +608,7 @@ object UniqueTriggerActivation {
civInfo.getTurnsBetweenDiplomaticVotes()
)
if (notification != null)
civInfo.addNotification(notification, NotificationCategory.General, NotificationIcon.Diplomacy)
civInfo.addNotification(notification, NotificationCategory.General, NotificationIcons.Diplomacy)
return true
}
@ -622,9 +622,9 @@ object UniqueTriggerActivation {
otherCiv.espionageManager.erasSpyEarnedFor.add(currentEra)
if (otherCiv == civInfo || otherCiv.knows(civInfo))
// We don't tell which civilization entered the new era, as that is done in the notification directly above this one
otherCiv.addNotification("We have recruited [${spyName}] as a spy!", NotificationCategory.Espionage, NotificationIcon.Spy)
otherCiv.addNotification("We have recruited [${spyName}] as a spy!", NotificationCategory.Espionage, NotificationIcons.Spy)
else
otherCiv.addNotification("After an unknown civilization entered the [${currentEra}], we have recruited [${spyName}] as a spy!", NotificationCategory.Espionage, NotificationIcon.Spy)
otherCiv.addNotification("After an unknown civilization entered the [${currentEra}], we have recruited [${spyName}] as a spy!", NotificationCategory.Espionage, NotificationIcons.Spy)
}
}
return true

View File

@ -1,7 +1,7 @@
package com.unciv.models.stats
import com.badlogic.gdx.graphics.Color
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.models.UncivSound
import com.unciv.ui.components.Fonts
import com.unciv.ui.components.extensions.colorFromHex
@ -12,13 +12,13 @@ enum class Stat(
val character: Char,
val color:Color
) {
Production(NotificationIcon.Production, UncivSound.Click, Fonts.production, colorFromHex(0xc14d00)),
Food(NotificationIcon.Food, UncivSound.Click, Fonts.food, colorFromHex(0x24A348)),
Gold(NotificationIcon.Gold, UncivSound.Coin, Fonts.gold, colorFromHex(0xffeb7f)),
Science(NotificationIcon.Science, UncivSound.Chimes, Fonts.science, colorFromHex(0x8c9dff)),
Culture(NotificationIcon.Culture, UncivSound.Paper, Fonts.culture, colorFromHex(0x8b60ff)),
Happiness(NotificationIcon.Happiness, UncivSound.Click, Fonts.happiness, colorFromHex(0xffd800)),
Faith(NotificationIcon.Faith, UncivSound.Choir, Fonts.faith, colorFromHex(0xcbdfff));
Production(NotificationIcons.Production, UncivSound.Click, Fonts.production, colorFromHex(0xc14d00)),
Food(NotificationIcons.Food, UncivSound.Click, Fonts.food, colorFromHex(0x24A348)),
Gold(NotificationIcons.Gold, UncivSound.Coin, Fonts.gold, colorFromHex(0xffeb7f)),
Science(NotificationIcons.Science, UncivSound.Chimes, Fonts.science, colorFromHex(0x8c9dff)),
Culture(NotificationIcons.Culture, UncivSound.Paper, Fonts.culture, colorFromHex(0x8b60ff)),
Happiness(NotificationIcons.Happiness, UncivSound.Click, Fonts.happiness, colorFromHex(0xffd800)),
Faith(NotificationIcons.Faith, UncivSound.Choir, Fonts.faith, colorFromHex(0xcbdfff));
companion object {
val statsUsableToBuy = setOf(Gold, Food, Science, Culture, Faith)

View File

@ -3,7 +3,7 @@ package com.unciv.ui.screens.worldscreen
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.trade.TradeLogic
import com.unciv.logic.trade.TradeOffer
import com.unciv.logic.trade.TradeType
@ -84,13 +84,13 @@ class TradePopup(worldScreen: WorldScreen): Popup(worldScreen){
tradeLogic.acceptTrade()
close()
TradeThanksPopup(leaderIntroTable, worldScreen)
requestingCiv.addNotification("[${viewingCiv.civName}] has accepted your trade request", NotificationCategory.Trade, viewingCiv.civName, NotificationIcon.Trade)
requestingCiv.addNotification("[${viewingCiv.civName}] has accepted your trade request", NotificationCategory.Trade, viewingCiv.civName, NotificationIcons.Trade)
}.row()
addButton("Not this time.", 'n') {
tradeRequest.decline(viewingCiv)
close()
requestingCiv.addNotification("[${viewingCiv.civName}] has denied your trade request", NotificationCategory.Trade, viewingCiv.civName, NotificationIcon.Trade)
requestingCiv.addNotification("[${viewingCiv.civName}] has denied your trade request", NotificationCategory.Trade, viewingCiv.civName, NotificationIcons.Trade)
worldScreen.shouldUpdate = true
}.row()

View File

@ -6,7 +6,7 @@ import com.unciv.UncivGame
import com.unciv.logic.automation.unit.UnitAutomation
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.civilization.PlayerType
import com.unciv.logic.civilization.diplomacy.DiplomacyFlags
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
@ -556,7 +556,7 @@ object UnitActions {
for (otherCiv in civsToNotify)
otherCiv.addNotification("Your territory has been stolen by [${unit.civ}]!",
unit.currentTile.position, NotificationCategory.Cities, unit.civ.civName, NotificationIcon.War)
unit.currentTile.position, NotificationCategory.Cities, unit.civ.civName, NotificationIcons.War)
}
private fun addFortifyActions(actionList: ArrayList<UnitAction>, unit: MapUnit, showingAdditionalActions: Boolean) {

View File

@ -1,7 +1,7 @@
package com.unciv.ui.screens.worldscreen.unit.actions
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.mapunit.MapUnit
import com.unciv.logic.map.tile.Tile
import com.unciv.models.UnitAction
@ -93,7 +93,7 @@ object UnitActionsGreatPerson {
tileOwningCiv.getDiplomacyManager(unit.civ).addInfluence(influenceEarned)
unit.civ.addNotification("Your trade mission to [$tileOwningCiv] has earned you [$goldEarned] gold and [$influenceEarned] influence!",
NotificationCategory.General, tileOwningCiv.civName, NotificationIcon.Gold, NotificationIcon.Culture)
NotificationCategory.General, tileOwningCiv.civName, NotificationIcons.Gold, NotificationIcons.Culture)
unit.consume()
}.takeIf { canConductTradeMission }
)

View File

@ -2,7 +2,7 @@ package com.unciv.ui.screens.worldscreen.unit.actions
import com.unciv.GUI
import com.unciv.logic.civilization.NotificationCategory
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.logic.civilization.NotificationIcons
import com.unciv.logic.map.mapunit.MapUnit
import com.unciv.logic.map.tile.Tile
import com.unciv.models.UnitAction
@ -54,7 +54,7 @@ object UnitActionsPillage {
tile.position,
NotificationCategory.War,
icon,
NotificationIcon.War,
NotificationIcons.War,
unit.baseUnit.name
)
@ -109,7 +109,7 @@ object UnitActionsPillage {
fun Stats.notify(suffix: String) {
if (isEmpty()) return
val text = "We have looted [${toStringWithoutIcons()}] from a [${improvement.name}]" + suffix
unit.civ.addNotification(text, tile.position, NotificationCategory.War, "ImprovementIcons/${improvement.name}", NotificationIcon.War)
unit.civ.addNotification(text, tile.position, NotificationCategory.War, "ImprovementIcons/${improvement.name}", NotificationIcons.War)
}
toCityPillageYield.notify(" which has been sent to [${closestCity?.name}]")
globalPillageYield.notify("")