mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 04:54:05 +09:00
debugging thing update
This commit is contained in:
@@ -30,17 +30,27 @@ class UIItemHorzSlider(
|
||||
val min: Double,
|
||||
val max: Double,
|
||||
override val width: Int,
|
||||
val handleWidth: Int = 12,
|
||||
initialHandleWidth: Int = 12,
|
||||
private val backgroundTexture: TextureRegion? = null,
|
||||
private val disposeTexture: Boolean = false
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
|
||||
override var suppressHaptic = false
|
||||
|
||||
var handleWidth: Int = initialHandleWidth
|
||||
set(value) {
|
||||
// reset the scroll status
|
||||
handlePos = 0.0
|
||||
this.value = 0.0
|
||||
field = value
|
||||
|
||||
handleTravelDist = width - value
|
||||
}
|
||||
|
||||
override val height = 24
|
||||
private var mouseOnHandle = false
|
||||
|
||||
private val handleTravelDist = width - handleWidth
|
||||
private var handleTravelDist = width - handleWidth
|
||||
private var handlePos = (initialValue / max).times(handleTravelDist).coerceIn(0.0, handleTravelDist.toDouble())
|
||||
|
||||
var value: Double = initialValue; private set
|
||||
|
||||
@@ -23,13 +23,23 @@ class UIItemVertSlider(
|
||||
val min: Double,
|
||||
val max: Double,
|
||||
override val height: Int,
|
||||
val handleHeight: Int = 12,
|
||||
initialHandleHeight: Int = 12,
|
||||
private val backgroundTexture: TextureRegion? = null,
|
||||
private val disposeTexture: Boolean = false
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
|
||||
override var suppressHaptic = false
|
||||
|
||||
var handleHeight: Int = initialHandleHeight
|
||||
set(value) {
|
||||
// reset the scroll status
|
||||
handlePos = 0.0
|
||||
this.value = 0.0
|
||||
field = value
|
||||
|
||||
handleTravelDist = height - value
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val WIDTH = 16
|
||||
}
|
||||
@@ -37,7 +47,7 @@ class UIItemVertSlider(
|
||||
override val width = WIDTH
|
||||
private var mouseOnHandle = false
|
||||
|
||||
private val handleTravelDist = height - handleHeight
|
||||
private var handleTravelDist = height - handleHeight
|
||||
private var handlePos = if (max == 0.0) 0.0 else (initialValue / max).times(handleTravelDist).coerceIn(0.0, handleTravelDist.toDouble())
|
||||
|
||||
var value: Double = initialValue; private set
|
||||
|
||||
Reference in New Issue
Block a user