mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-21 07:54:05 +09:00
selecting and consuming item in inventory
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package net.torvald.terrarum.ui
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.colourutil.CIELabUtil.darkerLab
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.ActorHumanoid
|
||||
@@ -59,12 +60,9 @@ class UIVitalMetre(
|
||||
*/
|
||||
override fun render(gc: GameContainer, g: Graphics) {
|
||||
if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
||||
|
||||
// FIXME does not work well with screen zoom, because of my custom g.translate
|
||||
|
||||
g.translate(
|
||||
-MapCamera.x + player!!.centrePosPoint.x.toFloat(),
|
||||
-MapCamera.y + player!!.centrePosPoint.y.toFloat()
|
||||
Terrarum.ingame!!.screenZoom * (player!!.centrePosPoint.x.toFloat() - (MapCamera.x)),
|
||||
Terrarum.ingame!!.screenZoom * (player!!.centrePosPoint.y.toFloat() - (MapCamera.y))
|
||||
)
|
||||
|
||||
|
||||
@@ -118,6 +116,8 @@ class UIVitalMetre(
|
||||
}
|
||||
}
|
||||
|
||||
fun Float.abs() = FastMath.abs(this)
|
||||
|
||||
/*
|
||||
|
||||
+-------------+ (84)
|
||||
|
||||
Reference in New Issue
Block a user