Skip to content

Commit 48a1319

Browse files
committed
perf(render): "Pillaged improvement" image packed with improvement icons to allow mods to override it
1 parent 5d1dab6 commit 48a1319

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed
2.33 KB
Loading

android/assets/Icons.atlas

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,13 @@ OtherIcons/Fire
767767
orig: 115, 115
768768
offset: 0, 0
769769
index: -1
770+
ImprovementIcons/Pillaged
771+
rotate: false
772+
xy: 4, 865
773+
size: 115, 115
774+
orig: 115, 115
775+
offset: 0, 0
776+
index: -1
770777
OtherIcons/ForwardArrow
771778
rotate: false
772779
xy: 1280, 1100

core/src/com/unciv/ui/images/Portrait.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class PortraitImprovement(name: String, size: Float, dim: Boolean = false, isPil
216216
background.color.a = 0.7f
217217
}
218218
if (isPillaged) {
219-
val pillagedIcon = ImageGetter.getImage("OtherIcons/Fire")
219+
val pillagedIcon = ImageGetter.getImage("ImprovementIcons/Pillaged")
220220
pillagedIcon.setSize(width/2, height/2)
221221
pillagedIcon.setPosition(width, 0f, Align.bottomRight)
222222
addActor(pillagedIcon)
@@ -238,7 +238,8 @@ class PortraitImprovement(name: String, size: Float, dim: Boolean = false, isPil
238238
return Color.WHITE
239239
}
240240

241-
override fun draw(batch: Batch?, parentAlpha: Float) = super.draw(batch, parentAlpha)
241+
override fun draw(batch: Batch?, parentAlpha: Float) =
242+
super.draw(batch, parentAlpha)
242243
}
243244

244245
class PortraitNation(name: String, size: Float) : Portrait(Type.Nation, name, size, size*0.1f) {

docs/Modders/Images-and-Audio.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@ If you use external tools and multiple atlases, you will need to maintain this f
3838
A large number of atlases may be the result of having very large icons.
3939
We find that 100x100 pixels is good enough for most icons.
4040

41-
#### Circle icons
41+
#### Rendering performance
4242

4343
To allow for faster rendering for icons, which has a major performance effect, you can copy the ["OtherIcons/circle.png"](https://github.com/yairm210/Unciv/blob/master/android/Images.Icons/OtherIcons/Circle.png) to:
4444

45-
- "ImprovementIcons/Circle.png" for improvements
45+
- "ImprovementIcons/Circle.png" for improvements - you can also copy "ImprovementIcons/Pillaged.png" for it to be packed with your icons
4646
- "ResourceIcons/Circle.png" for resources
4747
- "TechIcons/Circle.png" for technologies
4848
- "ConstructionIcons/Circle.png" for buildings and units
4949
- "StatIcons/Circle.png" for stats
5050

51+
You should only do so if the mod icons will be the *majority* of the icons for each category, NOT if you're adding on a few more.
5152

5253
### Texture packer settings
5354

0 commit comments

Comments
 (0)