mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
fixed a bug where ActorWithBody.mouseUp is incorrectly implemented
This commit is contained in:
@@ -397,6 +397,10 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
|
||||
}
|
||||
}
|
||||
|
||||
open fun getTooltipMessage(): String {
|
||||
return uiTooltip.message
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies most recent `save` to `save.1`, leaving `save` for overwriting, previous `save.1` will be copied to `save.2`
|
||||
*/
|
||||
|
||||
@@ -580,8 +580,13 @@ open class ActorWithBody : Actor {
|
||||
feetPosPoint.set(hitbox.centeredX, hitbox.endY)
|
||||
feetPosTile.set(hIntTilewiseHitbox.centeredX.floorInt(), hIntTilewiseHitbox.endY.floorInt())
|
||||
|
||||
|
||||
if (mouseUp && this.tooltipText != null) INGAME.setTooltipMessage(this.tooltipText)
|
||||
}
|
||||
|
||||
// make sure tooltip to disable even when the actor's update is paused at unfortunate time
|
||||
if (!mouseUp && INGAME.getTooltipMessage() == this.tooltipText) INGAME.setTooltipMessage(null)
|
||||
|
||||
isStationary = (hitbox - oldHitbox).magnitudeSquared < PHYS_EPSILON_VELO
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,8 @@ class Hitbox {
|
||||
return this
|
||||
}
|
||||
|
||||
fun containsPoint(x: Double, y: Double) = (hitboxStart.x - x) in 0.0..width && (hitboxStart.y - y) in 0.0..height
|
||||
// TODO consider ROUNDWORLD
|
||||
fun containsPoint(x: Double, y: Double) = (x - hitboxStart.x) in 0.0..width && (y - hitboxStart.y) in 0.0..height
|
||||
fun containsPoint(p: Point2d) = containsPoint(p.x, p.y)
|
||||
|
||||
|
||||
|
||||
@@ -105,5 +105,5 @@ internal class FixtureTapestry : FixtureBase {
|
||||
}
|
||||
|
||||
|
||||
override var tooltipText: String? = "$artName\n$artAuthor"
|
||||
override var tooltipText: String? = "TEST\nSTRING"//if (artName.length + artAuthor.length > 0) "$artName\n$artAuthor" else null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user