uiloadmanage: going back to list will reset the list scroll

This commit is contained in:
minjaesong
2023-07-13 16:34:01 +09:00
parent 30aca57cbc
commit 0767521441
3 changed files with 11 additions and 0 deletions

View File

@@ -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()

View File

@@ -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)
}
}

View File

@@ -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)
}