OSC: delegate config reset to individual buttons

This commit is contained in:
lynxnb 2023-03-17 19:25:42 +01:00 committed by Niccolò Betto
parent 3fc09f0953
commit 2794af6d06
2 changed files with 6 additions and 2 deletions

View File

@ -184,4 +184,9 @@ abstract class OnScreenButton(
relativeX = defaultRelativeX
relativeY = defaultRelativeY
}
open fun resetConfig() {
resetRelativeValues()
config.enabled = true
}
}

View File

@ -269,8 +269,7 @@ class OnScreenControllerView @JvmOverloads constructor(context : Context, attrs
fun resetControls() {
controls.allButtons.forEach {
it.resetRelativeValues()
it.config.enabled = true
it.resetConfig()
}
controls.globalScale = 1.15f
controls.alpha = 155