From b67429d5cbc8379337ff0ea35061693fa7ccf101 Mon Sep 17 00:00:00 2001 From: ReallyBasicName <173489550+ReallyBasicName@users.noreply.github.com> Date: Mon, 2 Jun 2025 13:08:17 -0700 Subject: [PATCH] Add the option for civs to have unique dialogue when asking for a Declaration of Friendship (#13366) * Uh, Friendship dailogue. * Update 2-Civilization-related-JSON-files.md * Nothing * Yairm fixes my mistake Sorry I didn't get to this sooner and you had to do it Yairm. Co-authored-by: Yair Morgenstern * Update AlertPopup.kt's friendship to declaringFriendship * Update Nation.kt's friendship to declaringFriendship * Update 2-Civilization-related-JSON-files.md's friendship to declaringFriendship * Update nations.json's friendship to declaringFriendship --------- Co-authored-by: Yair Morgenstern --- core/src/com/unciv/models/ruleset/nation/Nation.kt | 2 ++ core/src/com/unciv/ui/screens/worldscreen/AlertPopup.kt | 6 +++++- .../Mod-file-structure/2-Civilization-related-JSON-files.md | 1 + docs/Modders/schemas/nations.json | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/models/ruleset/nation/Nation.kt b/core/src/com/unciv/models/ruleset/nation/Nation.kt index d731699c35..6fc05b4957 100644 --- a/core/src/com/unciv/models/ruleset/nation/Nation.kt +++ b/core/src/com/unciv/models/ruleset/nation/Nation.kt @@ -41,6 +41,8 @@ class Nation : RulesetObject() { var defeated = "" /** Shown for MajorCivDiplomacyTable.getDenounceButton */ var denounced = "" + /** Shown for Declaration of Friendship */ + var declaringFriendship = "" /** Shown for AlertType.FirstContact */ var introduction = "" /** Shown in TradePopup when other Civs initiate trade with a player */ diff --git a/core/src/com/unciv/ui/screens/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/screens/worldscreen/AlertPopup.kt index 972b58756c..1344f039c9 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/AlertPopup.kt @@ -237,13 +237,17 @@ class AlertPopup( if (otherciv.isDefeated()) return false val playerDiploManager = viewingCiv.getDiplomacyManager(otherciv)!! addLeaderName(otherciv) - addGoodSizedLabel("My friend, shall we declare our friendship to the world?").row() + addGoodSizedLabel( + if (otherciv.nation.declaringFriendship.isNotEmpty()) otherciv.nation.declaringFriendship else "My friend, shall we declare our friendship to the world?" + ).row() addCloseButton("Declare Friendship ([30] turns)", KeyboardBinding.Confirm) { playerDiploManager.signDeclarationOfFriendship() }.row() addCloseButton("We are not interested.", KeyboardBinding.Cancel) { playerDiploManager.otherCivDiplomacy().setFlag(DiplomacyFlags.DeclinedDeclarationOfFriendship, 20) }.row() + val music = UncivGame.Current.musicController + music.playVoice("${otherciv.nation.name}.declaringFriendship") return true } diff --git a/docs/Modders/Mod-file-structure/2-Civilization-related-JSON-files.md b/docs/Modders/Mod-file-structure/2-Civilization-related-JSON-files.md index dd1d12b30b..730ab2e99d 100644 --- a/docs/Modders/Mod-file-structure/2-Civilization-related-JSON-files.md +++ b/docs/Modders/Mod-file-structure/2-Civilization-related-JSON-files.md @@ -76,6 +76,7 @@ Each nation has the following structure: | neutralHello | String | none | Another greeting, voice hook supported [^V] | | hateHello | String | none | Another greeting, voice hook supported [^V] | | tradeRequest | String | none | Another greeting, voice hook supported [^V] | +| declaringFriendship | String | none | Another greeting, voice hook supported [^V] | | innerColor | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | black | RGB color for outer ring of nation icon | | outerColor | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | Required | RGB color for inner circle of nation icon | | uniqueName | String | none | Decorative name for the special characteristic of this nation | diff --git a/docs/Modders/schemas/nations.json b/docs/Modders/schemas/nations.json index 527bdc27c7..f2b7f8ec47 100644 --- a/docs/Modders/schemas/nations.json +++ b/docs/Modders/schemas/nations.json @@ -38,6 +38,7 @@ "attacked": { "type": "string" }, "defeated": { "type": "string" }, "denounced": { "type": "string" }, + "declaringFriendship": { "type": "string" }, "startIntroPart1": { "type": "string" }, "startIntroPart2": { "type": "string" }, "cities": {