mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 07:16:54 +07:00
The "Construct improvement" action is now disabled when the unit has no movement or there are no improvements to pick
This commit is contained in:
parent
1a2d3d4421
commit
c984704af1
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 63
|
||||
versionName "2.2.4"
|
||||
versionCode 64
|
||||
versionName "2.2.5"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -30,7 +30,11 @@ class ImprovementPickerScreen(tileInfo: TileInfo) : PickerScreen() {
|
||||
if (!tileInfo.canBuildImprovement(improvement, civInfo) || improvement.name == tileInfo.improvement) continue
|
||||
val improvementButton = Button(skin)
|
||||
|
||||
improvementButton.add(ImageGetter.getImprovementIcon(improvement.name)).size(30f).pad(10f)
|
||||
|
||||
if(improvement.name.startsWith("Remove"))
|
||||
improvementButton.add(ImageGetter.getImage("OtherIcons/Stop.png")).size(30f).pad(10f)
|
||||
else improvementButton.add(ImageGetter.getImprovementIcon(improvement.name)).size(30f).pad(10f)
|
||||
|
||||
improvementButton.add(Label(improvement.name + " - " + improvement.getTurnsToBuild(civInfo) + " turns",skin)
|
||||
.setFontColor(Color.WHITE)).pad(10f)
|
||||
|
||||
|
@ -31,6 +31,7 @@ object ImageGetter {
|
||||
textureRegionByFileName[fileName] = TextureRegion(texture)
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
return getTextureRegion(WhiteDot)
|
||||
throw Exception("File $fileName not found!",ex)
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,9 @@ class UnitActions {
|
||||
if (unit.name == "Worker") {
|
||||
actionList += UnitAction("Construct improvement",
|
||||
{ worldScreen.game.screen = ImprovementPickerScreen(tile) },
|
||||
unit.currentMovement != 0f &&
|
||||
!tile.isCityCenter() || GameBasics.TileImprovements.values.any { tile.canBuildImprovement(it, unit.civInfo) })
|
||||
unit.currentMovement != 0f
|
||||
&& !tile.isCityCenter()
|
||||
&& GameBasics.TileImprovements.values.any { tile.canBuildImprovement(it, unit.civInfo) })
|
||||
|
||||
if("automation" == unit.action){
|
||||
actionList += UnitAction("Stop automation",
|
||||
|
Loading…
Reference in New Issue
Block a user