Clicking on the unit description label now zooms to map to the unit

This commit is contained in:
Yair Morgenstern
2018-05-30 09:04:45 +03:00
parent aa0ddd4128
commit 0dab2d6dca
2 changed files with 4 additions and 2 deletions

View File

@ -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 {

View File

@ -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("")