From 55b2da6d75fc1e7aadb5d0068f95deb6dc5f2fa4 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 28 Nov 2019 21:05:36 +0200 Subject: [PATCH] Normalized resource reveal notification --- .../jsons/Translations/Notifications.json | 29 +++++++++---------- .../unciv/logic/civilization/TechManager.kt | 8 ++--- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/android/assets/jsons/Translations/Notifications.json b/android/assets/jsons/Translations/Notifications.json index 84bfcb9907..5de79fd325 100644 --- a/android/assets/jsons/Translations/Notifications.json +++ b/android/assets/jsons/Translations/Notifications.json @@ -40,21 +40,20 @@ Polish:"Twoje imperium weszło w Złoty Wiek!" } - "revealed near":{ // As in "Coal revealed near London" - Italian:"scoperto vicino a" - Russian:"обнаружен вблизи " - French:"est dévoilé près de" - Romanian:"dezvăluit lângă" - German:"gefunden in der Nähe von" - Dutch:"Ontdekt: in de buurt van" - Spanish:"descubierto cerca de" - Simplified_Chinese:"被发现在", - Traditional_Chinese:"被發現在", - Portuguese:"revelado perto de" - Japanese:"付近で明らかに", - Czech:" objeven(a) poblíž" - Ukrainian:"виявлено біля" - Polish:"odkryte nieopodal" + "[resourceName] revealed near [cityName]":{ // As in "Coal revealed near London" + Italian:"[resourceName] scoperto vicino a [cityName]", + Russian:"[resourceName] обнаружен вблизи [cityName]", + French:"[resourceName] est dévoilé près de [cityName]", + Romanian:"[resourceName] dezvăluit lângă [cityName]", + German:"[resourceName] gefunden in der Nähe von [cityName]", + Dutch:"[resourceName] Ontdekt: in de buurt van [cityName]", + Spanish:"[resourceName] descubierto cerca de [cityName]", + Simplified_Chinese:"[resourceName] 被发现在 [cityName]", + Traditional_Chinese:"[resourceName] 被發現在 [cityName]", + Portuguese:"[resourceName] revelado perto de [cityName]", + Czech:"[resourceName] objeven(a) poblíž [cityName]", + Ukrainian:"[resourceName] виявлено біля [cityName]", + Polish:"[resourceName] odkryte nieopodal [cityName]" } "A [greatPerson] has been born!":{ //Smashfanful sayd: "You should add WHERE the Great Person is born, so it should be "A [greatPerson] is born in [cityName]"" diff --git a/core/src/com/unciv/logic/civilization/TechManager.kt b/core/src/com/unciv/logic/civilization/TechManager.kt index 8549fd5222..86bd5d72ad 100644 --- a/core/src/com/unciv/logic/civilization/TechManager.kt +++ b/core/src/com/unciv/logic/civilization/TechManager.kt @@ -166,17 +166,15 @@ class TechManager { .forEach { civInfo.addNotification("[" + it.name + "] policy branch unlocked!", null, Color.PURPLE) } } - val revealedResource = GameBasics.TileResources.values.firstOrNull { techName == it.revealedBy } - - if (revealedResource != null) { + for(revealedResource in GameBasics.TileResources.values.filter{ techName == it.revealedBy }){ for (tileInfo in civInfo.gameInfo.tileMap.values .filter { it.resource == revealedResource.name && civInfo == it.getOwner() }) { val closestCityTile = tileInfo.getTilesInDistance(4) .firstOrNull { it.isCityCenter() } if (closestCityTile != null) { - civInfo.addNotification("{" + revealedResource.name + "} {revealed near} " - + closestCityTile.getCity()!!.name, tileInfo.position, Color.BLUE) // todo change to [] notation + val text = "[${revealedResource.name}] revealed near [${closestCityTile.getCity()!!.name}]" + civInfo.addNotification(text, tileInfo.position, Color.BLUE) break } }