mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-20 07:24:06 +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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal fun resetScroll() {
|
||||||
|
scrollFrom = 0
|
||||||
|
scrollTarget = 0
|
||||||
|
scrollAnimCounter = 0f
|
||||||
|
}
|
||||||
|
|
||||||
override fun hide() {
|
override fun hide() {
|
||||||
showCalled = false
|
showCalled = false
|
||||||
cellLoadThread.interrupt()
|
cellLoadThread.interrupt()
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
|||||||
private val mainBackButton = UIItemTextButton(this,
|
private val mainBackButton = UIItemTextButton(this,
|
||||||
{ Lang["MENU_LABEL_BACK"] }, buttonXcentre, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
{ Lang["MENU_LABEL_BACK"] }, buttonXcentre, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||||
it.clickOnceListener = { _,_ ->
|
it.clickOnceListener = { _,_ ->
|
||||||
|
full.resetScroll()
|
||||||
full.changePanelTo(0)
|
full.changePanelTo(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,10 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
// internal fun bringAutosaveSelectorUp() { transitionPanel.setRightUIto(1) }
|
// internal fun bringAutosaveSelectorUp() { transitionPanel.setRightUIto(1) }
|
||||||
// internal fun takeAutosaveSelectorDown() { transitionPanel.setRightUIto(0) }
|
// internal fun takeAutosaveSelectorDown() { transitionPanel.setRightUIto(0) }
|
||||||
|
|
||||||
|
internal fun resetScroll() {
|
||||||
|
transitionalListing.resetScroll()
|
||||||
|
}
|
||||||
|
|
||||||
internal fun changePanelTo(index: Int) {
|
internal fun changePanelTo(index: Int) {
|
||||||
transitionPanel.requestTransition(index)
|
transitionPanel.requestTransition(index)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user