mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-21 07:54:05 +09:00
Inventory UI on ingame
This commit is contained in:
@@ -14,7 +14,7 @@ import org.newdawn.slick.Input
|
||||
* Created by SKYHi14 on 2017-03-03.
|
||||
*/
|
||||
class UIVitalMetre(
|
||||
var player: ActorHumanoid,
|
||||
var player: ActorHumanoid?,
|
||||
var vitalGetterVal: () -> Float?,
|
||||
var vitalGetterMax: () -> Float?,
|
||||
var color: Color?,
|
||||
@@ -25,13 +25,13 @@ class UIVitalMetre(
|
||||
private val gap = 4f
|
||||
|
||||
override var width: Int = 80 + 2 * margin; set(value) { throw Error("operation not permitted") }
|
||||
override var height: Int; get() = player.baseHitboxH * 3 + margin; set(value) { throw Error("operation not permitted") }
|
||||
override var height: Int; get() = player?.baseHitboxH ?: 0 * 3 + margin; set(value) { throw Error("operation not permitted") }
|
||||
override var handler: UIHandler? = null
|
||||
override var openCloseTime: Int = 50
|
||||
|
||||
private val relativePX = width / 2f
|
||||
private val relativePY: Float; get() = player.baseHitboxH * 1.5f
|
||||
private val circleRadius: Float; get() = player.baseHitboxH * 3f
|
||||
private val relativePY: Float; get() = (player?.baseHitboxH ?: 0) * 1.5f
|
||||
private val circleRadius: Float; get() = (player?.baseHitboxH ?: 0) * 3f
|
||||
|
||||
private val theta = 33f
|
||||
private val halfTheta = theta / 2f
|
||||
|
||||
Reference in New Issue
Block a user