Notifications scroll no longer blocks map scrolling

This commit is contained in:
Yair Morgenstern 2018-03-23 12:25:51 +03:00
parent 0a9317f8ca
commit f71c605210
3 changed files with 10 additions and 11 deletions

View File

@ -6,12 +6,11 @@ import com.unciv.logic.map.TileInfo
import com.unciv.ui.tilegroups.TileGroup
import com.unciv.ui.utils.ImageGetter
class CityTileGroup : TileGroup {
class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo) : TileGroup(tileInfo) {
private val city: CityInfo
var yieldGroup: YieldGroup
constructor(city: CityInfo, tileInfo: TileInfo) : super(tileInfo) {
this.city = city
init {
this.yieldGroup = YieldGroup()
addActor(yieldGroup)
if (city.cityLocation == tileInfo.position) {
@ -20,8 +19,6 @@ class CityTileGroup : TileGroup {
}
}
var yieldGroup: YieldGroup
override fun update() {
super.update()
@ -32,7 +29,6 @@ class CityTileGroup : TileGroup {
}
if (improvementImage != null) improvementImage!!.setColor(1f, 1f, 1f, 0.5f)
if (unitImage != null) unitImage!!.setColor(1f, 1f, 1f, 0.5f)
if (resourceImage != null) resourceImage!!.setColor(1f, 1f, 1f, 0.5f)
yieldGroup.setStats(tileInfo.getTileStats(city, city.civInfo.gameInfo.getPlayerCivilization()))
@ -42,4 +38,6 @@ class CityTileGroup : TileGroup {
yieldGroup.setPosition(width / 2 - yieldGroup.width / 2, height * 0.25f - yieldGroup.height / 2)
}
}

View File

@ -38,7 +38,7 @@ class NotificationsScroll(private val notifications: List<Notification>, interna
notificationsTable.row()
}
notificationsTable.pack()
pack()
}
}

View File

@ -37,9 +37,7 @@ class WorldScreen : CameraStageBaseScreen() {
nextTurnButton.setPosition(stage.width - nextTurnButton.width - 10f,
civTable.y - nextTurnButton.height - 10f)
notificationsScroll = NotificationsScroll(gameInfo.notifications, this)
notificationsScroll.setSize(stage.width/3,stage.height/4)
notificationsScroll.setPosition(stage.width - notificationsScroll.width - 5f,
nextTurnButton.y - notificationsScroll.height - 5f)
notificationsScroll.width = stage.width/3
optionsTable = WorldScreenOptionsTable(this, civInfo)
Label("", CameraStageBaseScreen.skin).style.font.data.setScale(game.settings.labelScale)
@ -72,6 +70,9 @@ class WorldScreen : CameraStageBaseScreen() {
tileMapHolder.updateTiles()
civTable.update(this)
notificationsScroll.update()
notificationsScroll.width = stage.width/3
notificationsScroll.setPosition(stage.width - notificationsScroll.width - 5f,
nextTurnButton.y - notificationsScroll.height - 5f)
unitTable.update()
}