mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-24 06:39:16 +07:00
Selected unit stays selected when single-tap moved into a tile with another unit
This commit is contained in:
@ -1235,21 +1235,6 @@
|
||||
"upgradesTo": "Helicopter Gunship",
|
||||
"uniques": ["Bonus vs Armor 100%"]
|
||||
},
|
||||
{
|
||||
// "Hovering unit" unique gives ability to get into impassable tiles - and only that (no vision bonus or flying over ocean)
|
||||
// Unit embarks like any other ground unit and has penalty for attacking over river or from embarked state
|
||||
// "Unable to capture cities"
|
||||
"name": "Helicopter Gunship",
|
||||
"unitType": "Melee",
|
||||
"movement": 6,
|
||||
"strength": 60,
|
||||
"cost": 425,
|
||||
"requiredTech": "Computers",
|
||||
"requiredResource": "Aluminum",
|
||||
"uniques": ["Bonus vs Armor 100%", "No defensive terrain bonus", "Can move after attacking", "All tiles cost 1 movement",
|
||||
"Can pass through impassable tiles", "Unable to capture cities"],
|
||||
"attackSound": "shot"
|
||||
},
|
||||
{
|
||||
"name": "Rocket Artillery",
|
||||
"unitType": "Siege",
|
||||
@ -1297,6 +1282,20 @@
|
||||
"attackSound": "shot"
|
||||
// 65 strength, 3 movement, requiredTech "Rocketry" in expansions
|
||||
},
|
||||
{
|
||||
// "Hovering unit" unique gives ability to get into impassable tiles - and only that (no vision bonus or flying over ocean)
|
||||
// Unit embarks like any other ground unit and has penalty for attacking over river or from embarked state
|
||||
"name": "Helicopter Gunship",
|
||||
"unitType": "Melee",
|
||||
"movement": 6,
|
||||
"strength": 60,
|
||||
"cost": 425,
|
||||
"requiredTech": "Computers",
|
||||
"requiredResource": "Aluminum",
|
||||
"uniques": ["Bonus vs Armor 100%", "No defensive terrain bonus", "Can move after attacking", "All tiles cost 1 movement",
|
||||
"Can pass through impassable tiles", "Unable to capture cities"],
|
||||
"attackSound": "shot"
|
||||
},
|
||||
{
|
||||
"name": "Jet Fighter",
|
||||
"unitType": "Fighter",
|
||||
|
@ -107,9 +107,9 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
||||
|
||||
if (!policy.name.endsWith("Complete")) {
|
||||
if (policy.requires!!.isNotEmpty())
|
||||
policyText += "{Requires} ".tr() + policy.requires!!.joinToString { it.tr() }
|
||||
policyText += "Requires [" + policy.requires!!.joinToString { it.tr() }+"]"
|
||||
else
|
||||
policyText += ("{Unlocked at} {" + policy.branch.era + "}").tr()
|
||||
policyText += "{Unlocked at} {" + policy.branch.era + "}"
|
||||
}
|
||||
descriptionLabel.setText(policyText.joinToString("\r\n") { it.tr() })
|
||||
}
|
||||
@ -123,13 +123,10 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
||||
policyButton = policy.name.toTextButton()
|
||||
}
|
||||
|
||||
if (viewingCiv.policies.isAdopted(policy.name)) { // existing
|
||||
policyButton.color = Color.GREEN
|
||||
} else if (!viewingCiv.policies.isAdoptable(policy))
|
||||
// non-available
|
||||
{
|
||||
policyButton.color = Color.GRAY
|
||||
}
|
||||
if (viewingCiv.policies.isAdopted(policy.name)) policyButton.color = Color.GREEN // existing
|
||||
else if (!viewingCiv.policies.isAdoptable(policy)) policyButton.color = Color.GRAY // non-available
|
||||
|
||||
|
||||
policyButton.onClick { pickPolicy(policy) }
|
||||
policyButton.pack()
|
||||
return policyButton
|
||||
|
@ -205,14 +205,14 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
||||
}
|
||||
|
||||
val turnsToGetThere = unitsWhoCanMoveThere.values.max()!!
|
||||
// val selectedUnit = unitsWhoCanMoveThere.keys.first()
|
||||
|
||||
if (UncivGame.Current.settings.singleTapMove && turnsToGetThere == 1) {
|
||||
// single turn instant move
|
||||
val selectedUnit = unitsWhoCanMoveThere.keys.first()
|
||||
for(unit in unitsWhoCanMoveThere.keys) {
|
||||
unit.movement.headTowards(tileInfo)
|
||||
}
|
||||
// worldScreen.bottomUnitTable.selectUnit(selectedUnit) // keep moved unit selected
|
||||
worldScreen.bottomUnitTable.selectUnit(selectedUnit) // keep moved unit selected
|
||||
} else {
|
||||
// add "move to" button if there is a path to tileInfo
|
||||
val moveHereButtonDto = MoveHereButtonDto(unitsWhoCanMoveThere, tileInfo)
|
||||
|
Reference in New Issue
Block a user