mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-30 22:58:50 +07:00
Images for Escort Formation (#11449)
* Replace and credit "Link" icon * UnitActionIcons/Escort is a black version of "Link" * Reprioritize UnitGroup "action" badge to prefer showing what Workers build over escorting
This commit is contained in:
@ -15,8 +15,8 @@ import com.unciv.ui.images.ImageGetter
|
||||
*/
|
||||
open class UnitAction(
|
||||
val type: UnitActionType,
|
||||
/** How often this action is used, a higher value means more often and that it should be on an earlier page.
|
||||
* 100 is very frequent, 50 is somewhat frequent, less than 25 is press one time for multi-turn movement.
|
||||
/** How often this action is used, a higher value means more often and that it should be on an earlier page.
|
||||
* 100 is very frequent, 50 is somewhat frequent, less than 25 is press one time for multi-turn movement.
|
||||
* A Rare case is > 100 if a button is something like add in capital, promote or something,
|
||||
* we need to inform the player that taking the action is an option. */
|
||||
val useFrequency: Float,
|
||||
@ -103,9 +103,9 @@ enum class UnitActionType(
|
||||
val defaultPage: Int
|
||||
) {
|
||||
StopEscortFormation("Stop Escort formation",
|
||||
{ ImageGetter.getImage("OtherIcons/Stop") }, false, defaultPage = 1),
|
||||
{ ImageGetter.getUnitActionPortrait("StopEscort") }, false, defaultPage = 1),
|
||||
EscortFormation("Escort formation",
|
||||
{ ImageGetter.getImage("OtherIcons/Link") }, false, defaultPage = 1),
|
||||
{ ImageGetter.getUnitActionPortrait("Escort") }, false, defaultPage = 1),
|
||||
SwapUnits("Swap units",
|
||||
{ ImageGetter.getUnitActionPortrait("Swap") }, false, defaultPage = 0),
|
||||
Automate("Automate",
|
||||
|
@ -177,11 +177,11 @@ class UnitGroup(val unit: MapUnit, val size: Float) : Group() {
|
||||
private fun getActionImage(): Image? {
|
||||
return when {
|
||||
unit.isSleeping() -> ImageGetter.getImage("UnitActionIcons/Sleep")
|
||||
unit.isEscorting() -> ImageGetter.getImage("OtherIcons/Link")
|
||||
unit.getTile().improvementInProgress != null && unit.canBuildImprovement(unit.getTile().getTileImprovementInProgress()!!) ->
|
||||
ImageGetter.getImage("ImprovementIcons/${unit.getTile().improvementInProgress}")
|
||||
unit.isEscorting() -> ImageGetter.getImage("UnitActionIcons/Escort")
|
||||
unit.isMoving() -> ImageGetter.getImage("UnitActionIcons/MoveTo")
|
||||
unit.isExploring() -> ImageGetter.getImage("UnitActionIcons/Explore")
|
||||
unit.getTile().improvementInProgress!=null && unit.canBuildImprovement(unit.getTile().getTileImprovementInProgress()!!) ->
|
||||
ImageGetter.getImage("ImprovementIcons/${unit.getTile().improvementInProgress}")
|
||||
unit.isAutomated() -> ImageGetter.getImage("UnitActionIcons/Automate")
|
||||
unit.isSetUpForSiege() -> ImageGetter.getImage("UnitActionIcons/SetUp")
|
||||
else -> null
|
||||
|
Reference in New Issue
Block a user