mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
double-click on worked tile icon locks tile, for worked tiles as well!
This commit is contained in:
parent
19f0cadb1e
commit
15577cb3c5
@ -1,6 +1,5 @@
|
||||
package com.unciv.ui.screens.cityscreen
|
||||
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||
@ -353,7 +352,7 @@ class CityScreen(
|
||||
if (!canChangeState || city.isPuppet) return
|
||||
val tile = tileGroup.tile
|
||||
|
||||
// Cycling as: Not-worked -> Worked -> Locked -> Not-worked
|
||||
// Cycling as: Not-worked -> Worked -> Not-worked
|
||||
if (tileGroup.tileState == CityTileState.WORKABLE) {
|
||||
if (!tile.providesYield() && city.population.getFreePopulation() > 0) {
|
||||
city.workedTiles.add(tile.position)
|
||||
@ -404,6 +403,11 @@ class CityScreen(
|
||||
if (!canChangeState || city.isPuppet || tileGroup.tileState != CityTileState.WORKABLE) return
|
||||
val tile = tileGroup.tile
|
||||
|
||||
// Double-click should lead to locked tiles - both for unworked AND worked tiles
|
||||
|
||||
if (!tile.isWorked()) // If not worked, try to work it first
|
||||
tileWorkedIconOnClick(tileGroup, city)
|
||||
|
||||
if (tile.isWorked())
|
||||
city.lockedTiles.add(tile.position)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user