mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 20:28:56 +07:00
Clicking on the unit description label now zooms to map to the unit
This commit is contained in:
@ -28,7 +28,7 @@ class NotificationsScroll(private val notifications: List<Notification>, interna
|
||||
minitable.add(ImageGetter.getImage("OtherIcons/Circle.png")
|
||||
.apply { color=notification.color }).size(10f).pad(5f)
|
||||
minitable.background(ImageGetter.getDrawable("skin/civTableBackground.png"))
|
||||
minitable.add(label).pad(10f)
|
||||
minitable.add(label).pad(5f).padRight(10f)
|
||||
|
||||
if (notification.location != null) {
|
||||
minitable.addClickListener {
|
||||
|
@ -5,6 +5,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||
import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.logic.map.UnitType
|
||||
import com.unciv.ui.cityscreen.addClickListener
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.worldscreen.WorldScreen
|
||||
|
||||
@ -32,6 +33,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
fun update() {
|
||||
prevIdleUnitButton.update()
|
||||
nextIdleUnitButton.update()
|
||||
unitDescriptionLabel.clearListeners()
|
||||
|
||||
if(selectedUnit!=null)
|
||||
{
|
||||
@ -59,7 +61,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
unitLabelText+="\n+"+unit.getFortificationTurns()*20+"% fortification"
|
||||
|
||||
unitDescriptionLabel.setText(unitLabelText)
|
||||
|
||||
unitDescriptionLabel.addClickListener { worldScreen.tileMapHolder.setCenterPosition(unit.getTile().position) }
|
||||
}
|
||||
else {
|
||||
unitNameLabel.setText("")
|
||||
|
Reference in New Issue
Block a user