-
Notifications
You must be signed in to change notification settings - Fork 1.7k
added 2 unique to change name/appearance of civ #13105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 70 commits
9dd38f5
ab36bac
3a67ef7
919a082
ed21943
b9a832a
5edf4b7
545572f
904e5a8
938091f
6faa088
aaabab0
cb96cff
e400964
61f90fa
ff67bb7
467e725
aa532e9
5ee629f
b300c51
342d56a
04f6be5
1623290
4edcd24
0d5295e
1599dd2
eab98f2
bd60cc4
4fadce6
9d0ac5f
a7a2e75
48d4770
eb54ab4
dc00ad5
ef0bb39
fe66e04
bb78c9e
b02d9cb
74aa1ff
547a393
503fbe1
5ca4104
58c806c
94b21ca
343ef4e
e46afa6
0185096
77bf114
81423e8
0ac103b
aabe698
b71a2d9
a593037
75ce273
ae116f1
90b4779
0ffd85b
f422292
75e385e
4fa37e3
74e3e0c
d54b66f
8ae7456
0acef7c
b59c5e0
4eee5f8
460e6a4
69124a8
01b567e
c168b01
871fe2f
b16aa30
9d02066
d7fd525
90f7833
99be5d5
0509f6d
15affa7
e933bd2
8be1243
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,8 @@ class Civilization : IsPartOfGameInfoSerialization { | |
*/ | ||
var civName = "" | ||
private set | ||
var displayCivName = "" | ||
private set | ||
|
||
var tech = TechManager() | ||
var policies = PolicyManager() | ||
|
@@ -259,6 +261,7 @@ class Civilization : IsPartOfGameInfoSerialization { | |
|
||
constructor(civName: String) { | ||
this.civName = civName | ||
this.displayCivName = civName | ||
} | ||
|
||
fun clone(): Civilization { | ||
|
@@ -267,6 +270,7 @@ class Civilization : IsPartOfGameInfoSerialization { | |
toReturn.playerType = playerType | ||
toReturn.playerId = playerId | ||
toReturn.civName = civName | ||
toReturn.displayCivName = displayCivName | ||
toReturn.tech = tech.clone() | ||
toReturn.policies = policies.clone() | ||
toReturn.civConstructions = civConstructions.clone() | ||
|
@@ -775,8 +779,8 @@ class Civilization : IsPartOfGameInfoSerialization { | |
* And if the civs don't yet know who they are then they don't know if they're barbarians =\ | ||
* */ | ||
fun setNationTransient() { | ||
nation = gameInfo.ruleset.nations[civName] | ||
?: throw UncivShowableException("Nation $civName is not found!") | ||
nation = gameInfo.ruleset.nations[displayCivName] | ||
?: throw UncivShowableException("Nation $displayCivName is not found!") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... but this is right. |
||
} | ||
|
||
fun setTransients() { | ||
|
@@ -1070,6 +1074,10 @@ class Civilization : IsPartOfGameInfoSerialization { | |
else | ||
lastSeenImprovement[position] = improvement | ||
} | ||
|
||
fun changeDisplayCivName(name: String) { | ||
this.displayCivName = name | ||
} | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,10 @@ enum class UniqueType( | |
TriggersVictory("Triggers victory", UniqueTarget.Global), | ||
TriggersCulturalVictory("Triggers a Cultural Victory upon completion", UniqueTarget.Global), | ||
|
||
// Civ appearance | ||
ChangeCivilizationName("Change civilization [civFilter] name to [civFilter]",UniqueTarget.Era), | ||
ChangeCivilizationNation("Change civilization [civFilter] nation to [civFilter]",UniqueTarget.Era), | ||
|
||
/// Misc. | ||
MayBuyConstructionsInPuppets("May buy items in puppet cities", UniqueTarget.Global), | ||
MayNotAnnexCities("May not annex cities", UniqueTarget.Global), | ||
|
@@ -602,7 +606,7 @@ enum class UniqueType( | |
RoughTerrain("Rough terrain", UniqueTarget.Terrain), | ||
|
||
ExcludedFromMapEditor("Excluded from map editor", UniqueTarget.Terrain, UniqueTarget.Improvement, UniqueTarget.Resource, UniqueTarget.Nation, flags = UniqueFlag.setOfHiddenToUsers), | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't introduce trailing blanks, especially not where it's not your changes |
||
/////// Resource uniques | ||
ResourceAmountOnTiles("Deposits in [tileFilter] tiles always provide [amount] resources", UniqueTarget.Resource), | ||
CityStateOnlyResource("Can only be created by Mercantile City-States", UniqueTarget.Resource), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,7 +156,7 @@ class CityStateDiplomacyTable(private val diplomacyScreen: DiplomacyScreen) { | |
val nextLevelString = when { | ||
atWar -> "" | ||
otherCivDiplomacyManager.getInfluence().toInt() < 30 -> "Reach 30 for friendship." | ||
ally == viewingCiv.civName -> "" | ||
ally == viewingCiv.displayCivName-> "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should stay the unique key as well - or you'd lose your CS allies when you change name |
||
else -> "Reach highest influence above 60 for alliance." | ||
} | ||
diplomacyTable.add(diplomacyScreen.getRelationshipTable(otherCivDiplomacyManager)).row() | ||
|
@@ -472,8 +472,8 @@ class CityStateDiplomacyTable(private val diplomacyScreen: DiplomacyScreen) { | |
val warTable = Table() | ||
warTable.defaults().pad(10f) | ||
|
||
val title = "War against [${target.civName}]" | ||
val description = "We need you to help us defend against [${target.civName}]. Killing [${otherCiv.questManager.unitsToKill(target)}] of their military units would slow their offensive." | ||
val title = "War against [${target.displayCivName}]" | ||
val description = "We need you to help us defend against [${target.displayCivName}]. Killing [${otherCiv.questManager.unitsToKill(target)}] of their military units would slow their offensive." | ||
val progress = if (viewingCiv.knows(target)) "Currently you have killed [${otherCiv.questManager.unitsKilledSoFar(target, viewingCiv)}] of their military units." | ||
else "You need to find them first!" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import com.unciv.logic.civilization.PlayerType | |
import com.unciv.models.metadata.GameSettings.NationPickerListMode | ||
import com.unciv.models.metadata.Player | ||
import com.unciv.models.ruleset.nation.Nation | ||
import com.unciv.models.ruleset.unique.UniqueType | ||
import com.unciv.models.translations.tr | ||
import com.unciv.ui.audio.MusicMood | ||
import com.unciv.ui.audio.MusicTrackChooserFlags | ||
|
@@ -176,7 +177,7 @@ internal class NationPickerPopup( | |
|
||
// Decide by listMode how each block is built - | ||
// for each a factory producing an Actor and info on how to select it | ||
fun getListModeNationActor(element: NationIterationElement): Pair<WidgetGroup, SelectInfo> { | ||
fun getListModeNationActor(element: NationIterationElement): Pair<NationTable, SelectInfo> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems unrelated. A simple explanation probably? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should change it back 😅 |
||
val currentSelectInfo = SelectInfo(element.nation, currentY) | ||
val nationTable = NationTable(element.nation, civBlocksWidth, 0f) // no need for min height | ||
val cell = nationListTable.add(nationTable) | ||
|
@@ -215,7 +216,7 @@ internal class NationPickerPopup( | |
|
||
for (element in getSortedNations()) { | ||
val (nationActor, currentSelectInfo) = nationActorFactory(element) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More trailing blanks. You don't let Android Studio clean them for you? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use intelij 😅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Surely has a comparable setting as it's the same thing just different wrapping. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though i didn't manage to remove the white space with it but |
||
nationActor.onClick { | ||
highlightNation(currentSelectInfo) | ||
} | ||
|
@@ -238,7 +239,7 @@ internal class NationPickerPopup( | |
nationListTable.keyShortcuts.add(key) { onKeyPress(key) } | ||
} | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👋 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😬 |
||
|
||
nationListScroll.layout() | ||
pack() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope - the nation lookup key shouldn't change