Implement dormant Nation.startIntroPart1+2 (#4091)

* Implement dormant Nation.startIntroPart1+2

* Implement dormant Nation.startIntroPart1+2 - translation
This commit is contained in:
SomeTroglodyte 2021-06-10 22:16:35 +02:00 committed by GitHub
parent 7e284f998b
commit eda6dece9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 4 deletions

View File

@ -62,6 +62,7 @@ Research Agreement = Accord de recherche
Declare war = Déclarer la guerre
Declare war on [civName]? = Déclarer la guerre à [civName] ?
[civName] has declared war on us! = [civName] nous a déclaré la guerre !
Let's begin! = Allons-y!
[leaderName] of [nation] = [leaderName] de [nation]
You'll pay for this! = Vous allez payer cet affront !
Negotiate Peace = Négocier la paix

View File

@ -61,6 +61,7 @@ Research Agreement = Forschungsvereinbarung
Declare war = Krieg erklären
Declare war on [civName]? = [civName] den Krieg erklären?
[civName] has declared war on us! = [civName] hat uns den Krieg erklärt!
Let's begin! = Los geht's!
[leaderName] of [nation] = [leaderName] von [nation]
You'll pay for this! = Dafür werdet Ihr bezahlen!
Negotiate Peace = Frieden verhandeln

View File

@ -61,6 +61,7 @@ Research Agreement = Accordo di ricerca
Declare war = Dichiara guerra
Declare war on [civName]? = Vuoi dichiarare guerra a [civName]?
[civName] has declared war on us! = La civiltà [civName] ci ha dichiarato guerra!
Let's begin! = Andiamo!
[leaderName] of [nation] = [leaderName] dell'impero [nation]
You'll pay for this! = Pagherai caro questo affronto!
Negotiate Peace = Negozia una pace

View File

@ -61,6 +61,7 @@ Research Agreement = Acuerdo de investigación
Declare war = Declarar la guerra
Declare war on [civName]? = ¿Declarar la guerra a [civName]?
[civName] has declared war on us! = ¡[civName] nos ha declarado la guerra!
Let's begin! = Vámonos!
[leaderName] of [nation] = [leaderName] de [nation]
You'll pay for this! = ¡Pagarás por esto!
Negotiate Peace = Negociar la paz

View File

@ -60,6 +60,7 @@ Peace =
Research Agreement =
Declare war =
Declare war on [civName]? =
Let's begin! =
[civName] has declared war on us! =
[leaderName] of [nation] =
You'll pay for this! =

View File

@ -2,8 +2,7 @@ package com.unciv.logic
import com.badlogic.gdx.math.Vector2
import com.unciv.Constants
import com.unciv.logic.civilization.CityStatePersonality
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.civilization.*
import com.unciv.logic.map.BFS
import com.unciv.logic.map.TileInfo
import com.unciv.logic.map.TileMap
@ -64,10 +63,22 @@ object GameStarter {
// set max starting movement for units loaded from map
for (unit in tile.getUnits()) unit.currentMovement = unit.getMaxMovement().toFloat()
}
// This triggers the one-time greeting from Nation.startIntroPart1/2
addPlayerIntros(gameInfo)
return gameInfo
}
private fun addPlayerIntros(gameInfo: GameInfo) {
gameInfo.civilizations.filter {
// isNotEmpty should also exclude a spectator
it.playerType == PlayerType.Human && it.nation.startIntroPart1.isNotEmpty()
}.forEach {
it.popupAlerts.add(PopupAlert(AlertType.StartIntro, ""))
}
}
private fun addCivTechs(gameInfo: GameInfo, ruleset: Ruleset, gameSetupInfo: GameSetupInfo) {
for (civInfo in gameInfo.civilizations.filter { !it.isBarbarian() }) {

View File

@ -12,6 +12,7 @@ enum class AlertType {
CitySettledNearOtherCivDespiteOurPromise,
GoldenAge,
DeclarationOfFriendship,
StartIntro,
}
class PopupAlert {

View File

@ -43,10 +43,11 @@ class Nation : INamed {
var innerColor: List<Int>? = null
var startBias = ArrayList<String>()
/* Properties present in json but not yet implemented:
var adjective = ArrayList<String>()
var startIntroPart1 = ""
var startIntroPart2 = ""
/* Properties present in json but not yet implemented:
var adjective = ArrayList<String>()
*/
@Transient

View File

@ -221,6 +221,13 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
playerDiploManager.signDeclarationOfFriendship()
}).row()
}
AlertType.StartIntro -> {
val civInfo = worldScreen.viewingCiv
addLeaderName(civInfo)
addGoodSizedLabel(civInfo.nation.startIntroPart1).row()
addGoodSizedLabel(civInfo.nation.startIntroPart2).row()
add(getCloseButton("Let's begin!"))
}
}
}