mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 10:54:19 -04:00
Notifications scroll no longer blocks map scrolling
This commit is contained in:
parent
0a9317f8ca
commit
f71c605210
@ -6,12 +6,11 @@ import com.unciv.logic.map.TileInfo
|
|||||||
import com.unciv.ui.tilegroups.TileGroup
|
import com.unciv.ui.tilegroups.TileGroup
|
||||||
import com.unciv.ui.utils.ImageGetter
|
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) {
|
init {
|
||||||
this.city = city
|
|
||||||
this.yieldGroup = YieldGroup()
|
this.yieldGroup = YieldGroup()
|
||||||
addActor(yieldGroup)
|
addActor(yieldGroup)
|
||||||
if (city.cityLocation == tileInfo.position) {
|
if (city.cityLocation == tileInfo.position) {
|
||||||
@ -20,8 +19,6 @@ class CityTileGroup : TileGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var yieldGroup: YieldGroup
|
|
||||||
|
|
||||||
override fun update() {
|
override fun update() {
|
||||||
super.update()
|
super.update()
|
||||||
|
|
||||||
@ -32,7 +29,6 @@ class CityTileGroup : TileGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (improvementImage != null) improvementImage!!.setColor(1f, 1f, 1f, 0.5f)
|
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)
|
if (resourceImage != null) resourceImage!!.setColor(1f, 1f, 1f, 0.5f)
|
||||||
|
|
||||||
yieldGroup.setStats(tileInfo.getTileStats(city, city.civInfo.gameInfo.getPlayerCivilization()))
|
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)
|
yieldGroup.setPosition(width / 2 - yieldGroup.width / 2, height * 0.25f - yieldGroup.height / 2)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class NotificationsScroll(private val notifications: List<Notification>, interna
|
|||||||
notificationsTable.row()
|
notificationsTable.row()
|
||||||
}
|
}
|
||||||
notificationsTable.pack()
|
notificationsTable.pack()
|
||||||
|
pack()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,7 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
nextTurnButton.setPosition(stage.width - nextTurnButton.width - 10f,
|
nextTurnButton.setPosition(stage.width - nextTurnButton.width - 10f,
|
||||||
civTable.y - nextTurnButton.height - 10f)
|
civTable.y - nextTurnButton.height - 10f)
|
||||||
notificationsScroll = NotificationsScroll(gameInfo.notifications, this)
|
notificationsScroll = NotificationsScroll(gameInfo.notifications, this)
|
||||||
notificationsScroll.setSize(stage.width/3,stage.height/4)
|
notificationsScroll.width = stage.width/3
|
||||||
notificationsScroll.setPosition(stage.width - notificationsScroll.width - 5f,
|
|
||||||
nextTurnButton.y - notificationsScroll.height - 5f)
|
|
||||||
optionsTable = WorldScreenOptionsTable(this, civInfo)
|
optionsTable = WorldScreenOptionsTable(this, civInfo)
|
||||||
Label("", CameraStageBaseScreen.skin).style.font.data.setScale(game.settings.labelScale)
|
Label("", CameraStageBaseScreen.skin).style.font.data.setScale(game.settings.labelScale)
|
||||||
|
|
||||||
@ -72,6 +70,9 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
tileMapHolder.updateTiles()
|
tileMapHolder.updateTiles()
|
||||||
civTable.update(this)
|
civTable.update(this)
|
||||||
notificationsScroll.update()
|
notificationsScroll.update()
|
||||||
|
notificationsScroll.width = stage.width/3
|
||||||
|
notificationsScroll.setPosition(stage.width - notificationsScroll.width - 5f,
|
||||||
|
nextTurnButton.y - notificationsScroll.height - 5f)
|
||||||
unitTable.update()
|
unitTable.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user