mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Nation "style" can define unit appearance (#3368)
* added "style" in Nation.kt and checks in Tilegroups allows pixel units to be displayed as a specific style if appropriate file exists * Preserves "specificUnitIconLocation" in tilegroups.kt
This commit is contained in:
parent
0e39d47dab
commit
2aac9ea314
@ -24,6 +24,7 @@ class Nation : INamed {
|
||||
fun getLeaderDisplayName() = if (isCityState()) name
|
||||
else "[$leaderName] of [$name]"
|
||||
|
||||
val style = ""
|
||||
var cityStateType: CityStateType? = null
|
||||
var preferredVictoryType: VictoryType = VictoryType.Neutral
|
||||
var declaringWar = ""
|
||||
|
@ -614,7 +614,6 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updatePixelMilitaryUnit(showMilitaryUnit: Boolean) {
|
||||
var newImageLocation = ""
|
||||
|
||||
@ -624,8 +623,11 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
val specificUnitIconLocation = tileSetStrings.unitsLocation + militaryUnit.name
|
||||
newImageLocation = when {
|
||||
!UncivGame.Current.settings.showPixelUnits -> ""
|
||||
militaryUnit.civInfo.nation.style=="" &&
|
||||
ImageGetter.imageExists(specificUnitIconLocation) -> specificUnitIconLocation
|
||||
ImageGetter.imageExists(specificUnitIconLocation + "-" + militaryUnit.civInfo.nation.style) ->
|
||||
specificUnitIconLocation + "-" + militaryUnit.civInfo.nation.style
|
||||
ImageGetter.imageExists(specificUnitIconLocation) -> specificUnitIconLocation
|
||||
|
||||
militaryUnit.baseUnit.replaces!=null &&
|
||||
ImageGetter.imageExists(tileSetStrings.unitsLocation + militaryUnit.baseUnit.replaces) ->
|
||||
tileSetStrings.unitsLocation + militaryUnit.baseUnit.replaces
|
||||
@ -664,6 +666,10 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
val specificUnitIconLocation = tileSetStrings.unitsLocation + civilianUnit.name
|
||||
newImageLocation = when {
|
||||
!UncivGame.Current.settings.showPixelUnits -> ""
|
||||
civilianUnit.civInfo.nation.style=="" &&
|
||||
ImageGetter.imageExists(specificUnitIconLocation) -> specificUnitIconLocation
|
||||
ImageGetter.imageExists(specificUnitIconLocation + "-" + civilianUnit.civInfo.nation.style) ->
|
||||
specificUnitIconLocation + "-" + civilianUnit.civInfo.nation.style
|
||||
ImageGetter.imageExists(specificUnitIconLocation) -> specificUnitIconLocation
|
||||
else -> ""
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user