mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
uiloadmanage: going back to list will reset the list scroll
This commit is contained in:
@@ -291,6 +291,12 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
||||
return true
|
||||
}
|
||||
|
||||
internal fun resetScroll() {
|
||||
scrollFrom = 0
|
||||
scrollTarget = 0
|
||||
scrollAnimCounter = 0f
|
||||
}
|
||||
|
||||
override fun hide() {
|
||||
showCalled = false
|
||||
cellLoadThread.interrupt()
|
||||
|
||||
@@ -75,6 +75,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
private val mainBackButton = UIItemTextButton(this,
|
||||
{ Lang["MENU_LABEL_BACK"] }, buttonXcentre, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
it.clickOnceListener = { _,_ ->
|
||||
full.resetScroll()
|
||||
full.changePanelTo(0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,10 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
// internal fun bringAutosaveSelectorUp() { transitionPanel.setRightUIto(1) }
|
||||
// internal fun takeAutosaveSelectorDown() { transitionPanel.setRightUIto(0) }
|
||||
|
||||
internal fun resetScroll() {
|
||||
transitionalListing.resetScroll()
|
||||
}
|
||||
|
||||
internal fun changePanelTo(index: Int) {
|
||||
transitionPanel.requestTransition(index)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user