mirror of
https://github.com/yairm210/Unciv.git
synced 2025-10-02 16:31:15 -04:00
Selected unit stays selected when single-tap moved into a tile with another unit
This commit is contained in:
parent
2c35cc98de
commit
3e6955d0d9
@ -1235,21 +1235,6 @@
|
|||||||
"upgradesTo": "Helicopter Gunship",
|
"upgradesTo": "Helicopter Gunship",
|
||||||
"uniques": ["Bonus vs Armor 100%"]
|
"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",
|
"name": "Rocket Artillery",
|
||||||
"unitType": "Siege",
|
"unitType": "Siege",
|
||||||
@ -1297,6 +1282,20 @@
|
|||||||
"attackSound": "shot"
|
"attackSound": "shot"
|
||||||
// 65 strength, 3 movement, requiredTech "Rocketry" in expansions
|
// 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",
|
"name": "Jet Fighter",
|
||||||
"unitType": "Fighter",
|
"unitType": "Fighter",
|
||||||
|
@ -107,9 +107,9 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
|||||||
|
|
||||||
if (!policy.name.endsWith("Complete")) {
|
if (!policy.name.endsWith("Complete")) {
|
||||||
if (policy.requires!!.isNotEmpty())
|
if (policy.requires!!.isNotEmpty())
|
||||||
policyText += "{Requires} ".tr() + policy.requires!!.joinToString { it.tr() }
|
policyText += "Requires [" + policy.requires!!.joinToString { it.tr() }+"]"
|
||||||
else
|
else
|
||||||
policyText += ("{Unlocked at} {" + policy.branch.era + "}").tr()
|
policyText += "{Unlocked at} {" + policy.branch.era + "}"
|
||||||
}
|
}
|
||||||
descriptionLabel.setText(policyText.joinToString("\r\n") { it.tr() })
|
descriptionLabel.setText(policyText.joinToString("\r\n") { it.tr() })
|
||||||
}
|
}
|
||||||
@ -123,13 +123,10 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
|||||||
policyButton = policy.name.toTextButton()
|
policyButton = policy.name.toTextButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewingCiv.policies.isAdopted(policy.name)) { // existing
|
if (viewingCiv.policies.isAdopted(policy.name)) policyButton.color = Color.GREEN // existing
|
||||||
policyButton.color = Color.GREEN
|
else if (!viewingCiv.policies.isAdoptable(policy)) policyButton.color = Color.GRAY // non-available
|
||||||
} else if (!viewingCiv.policies.isAdoptable(policy))
|
|
||||||
// non-available
|
|
||||||
{
|
|
||||||
policyButton.color = Color.GRAY
|
|
||||||
}
|
|
||||||
policyButton.onClick { pickPolicy(policy) }
|
policyButton.onClick { pickPolicy(policy) }
|
||||||
policyButton.pack()
|
policyButton.pack()
|
||||||
return policyButton
|
return policyButton
|
||||||
|
@ -205,14 +205,14 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
val turnsToGetThere = unitsWhoCanMoveThere.values.max()!!
|
val turnsToGetThere = unitsWhoCanMoveThere.values.max()!!
|
||||||
// val selectedUnit = unitsWhoCanMoveThere.keys.first()
|
|
||||||
|
|
||||||
if (UncivGame.Current.settings.singleTapMove && turnsToGetThere == 1) {
|
if (UncivGame.Current.settings.singleTapMove && turnsToGetThere == 1) {
|
||||||
// single turn instant move
|
// single turn instant move
|
||||||
|
val selectedUnit = unitsWhoCanMoveThere.keys.first()
|
||||||
for(unit in unitsWhoCanMoveThere.keys) {
|
for(unit in unitsWhoCanMoveThere.keys) {
|
||||||
unit.movement.headTowards(tileInfo)
|
unit.movement.headTowards(tileInfo)
|
||||||
}
|
}
|
||||||
// worldScreen.bottomUnitTable.selectUnit(selectedUnit) // keep moved unit selected
|
worldScreen.bottomUnitTable.selectUnit(selectedUnit) // keep moved unit selected
|
||||||
} else {
|
} else {
|
||||||
// add "move to" button if there is a path to tileInfo
|
// add "move to" button if there is a path to tileInfo
|
||||||
val moveHereButtonDto = MoveHereButtonDto(unitsWhoCanMoveThere, tileInfo)
|
val moveHereButtonDto = MoveHereButtonDto(unitsWhoCanMoveThere, tileInfo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user