mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 13:04:05 +09:00
bringing back old animating titlescreen
This commit is contained in:
@@ -12,11 +12,12 @@ import kotlin.math.roundToInt
|
||||
*/
|
||||
class UIItemTextButtonList(
|
||||
parentUI: UICanvas,
|
||||
val lineHeight: Int,
|
||||
labelsList: Array<String>,
|
||||
initialX: Int,
|
||||
initialY: Int,
|
||||
override var width: Int,
|
||||
override var height: Int = DEFAULT_LINE_HEIGHT * labelsList.size,
|
||||
override var height: Int = lineHeight * labelsList.size,
|
||||
val readFromLang: Boolean = false,
|
||||
val defaultSelection: Int? = null, // negative: INVALID, positive: valid, null: no select
|
||||
|
||||
@@ -48,7 +49,7 @@ class UIItemTextButtonList(
|
||||
val kinematic: Boolean = false,
|
||||
|
||||
val alignment: UIItemTextButton.Companion.Alignment = UIItemTextButton.Companion.Alignment.CENTRE,
|
||||
val itemHitboxSize: Int = DEFAULT_LINE_HEIGHT
|
||||
val itemHitboxSize: Int = lineHeight
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
|
||||
companion object {
|
||||
@@ -75,7 +76,7 @@ class UIItemTextButtonList(
|
||||
val h = height.toFloat()
|
||||
val ss = labelsList.size.toFloat()
|
||||
val lh = itemHitboxSize
|
||||
val vertOff = (h/ss * i + (h/ss - lh) / 2f).roundToInt()
|
||||
val vertOff = lineHeight * i
|
||||
|
||||
if (!kinematic) {
|
||||
UIItemTextButton(
|
||||
|
||||
@@ -99,6 +99,7 @@ class UINSMenu(
|
||||
|
||||
val list = UIItemTextButtonList(
|
||||
this,
|
||||
UIItemTextButtonList.DEFAULT_LINE_HEIGHT,
|
||||
stringsFromTree,
|
||||
width, LINE_HEIGHT,
|
||||
uiWidth, listHeight,
|
||||
|
||||
Reference in New Issue
Block a user