Fixed scroll position indicator
Some checks failed
Conflict marking / main (push) Failing after 13s
Detekt / detekt (ubuntu-latest) (push) Failing after 46s
Docker / build (push) Failing after 1m37s
Generate mkdocs from docs folder / deploy (push) Failing after 40s
Build and test / Check code and run unit tests (push) Failing after 5m33s
Close stale issues and PRs / stale (push) Successful in 21s

This commit is contained in:
yairm210 2024-12-11 11:55:53 +02:00
parent 0e1dfed64b
commit f018b78f83

View File

@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.g2d.Batch
import com.badlogic.gdx.math.Rectangle
import com.badlogic.gdx.math.Vector2
import com.badlogic.gdx.scenes.scene2d.Actor
import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.Touchable
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.map.MapShape
@ -58,13 +59,17 @@ class Minimap(val mapHolder: WorldMapHolder, minimapSize: Int, private val civIn
group.moveBy(padX, padY)
}
scrollPositionIndicators = createScrollPositionIndicators()
scrollPositionIndicators.forEach(tileLayer::addActor)
addActor(tileLayer)
addActor(borderLayer)
addActor(cityLayer)
val scrollIndicatorLayer = Group()
scrollIndicatorLayer.setSize(width, height)
scrollPositionIndicators = createScrollPositionIndicators()
scrollPositionIndicators.forEach(scrollIndicatorLayer::addActor)
addActor(scrollIndicatorLayer)
mapHolder.onViewportChangedListener = ::updateScrollPosition
}