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