From 15577cb3c5fd4d7596a6cdd38c1de56fc31ceaf6 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 31 Jul 2023 11:17:23 +0300 Subject: [PATCH] double-click on worked tile icon locks tile, for worked tiles as well! --- core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt b/core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt index 51c20b854f..5d59e1fbca 100644 --- a/core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt +++ b/core/src/com/unciv/ui/screens/cityscreen/CityScreen.kt @@ -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)