Inventory UI on ingame

This commit is contained in:
Song Minjae
2017-04-09 03:35:18 +09:00
parent 1a3c9d7f65
commit 4254b87e51
20 changed files with 245 additions and 267 deletions

View File

@@ -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