mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
actor draw planting offset
This commit is contained in:
@@ -1764,9 +1764,12 @@ open class ActorWithBody : Actor {
|
|||||||
if (world == null) return
|
if (world == null) return
|
||||||
|
|
||||||
val offsetX = 0f
|
val offsetX = 0f
|
||||||
val offsetY = 1f // plant to the ground
|
val offsetY = 0f // for some reason this value must be zero to draw the actor planted to the ground
|
||||||
|
|
||||||
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
|
val posX = hitbox.startX.plus(PHYS_EPSILON_DIST).toFloat()
|
||||||
|
val posY = hitbox.startY.plus(PHYS_EPSILON_DIST).toFloat()
|
||||||
|
|
||||||
|
drawBodyInGoodPosition(posX, posY) { x, y ->
|
||||||
sprite.render(batch, x + offsetX, y + offsetY, scale.toFloat())
|
sprite.render(batch, x + offsetX, y + offsetY, scale.toFloat())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,16 +14,21 @@ import net.torvald.terrarum.modulebasegame.gameactors.Pocketed
|
|||||||
*/
|
*/
|
||||||
internal object Inventory : ConsoleCommand {
|
internal object Inventory : ConsoleCommand {
|
||||||
|
|
||||||
private var targetID: ActorID = INGAME.actorNowPlaying?.referenceID ?: PLAYER_REF_ID
|
private var targetID: ActorID = 0
|
||||||
|
|
||||||
|
private fun tryTargetActivePlayer() {
|
||||||
|
targetID = INGAME.actorNowPlaying?.referenceID ?: 0
|
||||||
|
}
|
||||||
|
|
||||||
override fun execute(args: Array<String>) {
|
override fun execute(args: Array<String>) {
|
||||||
if (args.size == 1) {
|
if (args.size == 1) {
|
||||||
printUsage()
|
printUsage()
|
||||||
}
|
}
|
||||||
else if (args[1] == "target") {
|
else if (args[1] == "target") {
|
||||||
targetID = if (args[2].lowercase() == "player") (INGAME.actorNowPlaying?.referenceID ?: PLAYER_REF_ID) else args[2].toInt()
|
if (args[2].lowercase() == "player") tryTargetActivePlayer() else targetID = args[2].toInt()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (targetID == 0) tryTargetActivePlayer()
|
||||||
val actor = getActor()
|
val actor = getActor()
|
||||||
if (actor != null) {
|
if (actor != null) {
|
||||||
when (args[1]) {
|
when (args[1]) {
|
||||||
@@ -36,7 +41,7 @@ internal object Inventory : ConsoleCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Echo("Actor $targetID is not Pocketed or does not exists")
|
Echo("Actor $targetID is not Pocketed or does not exist")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package net.torvald.terrarum.modulebasegame.gameactors
|
package net.torvald.terrarum.modulebasegame.gameactors
|
||||||
|
|
||||||
|
import net.torvald.terrarum.INGAME
|
||||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||||
import net.torvald.terrarum.gameactors.AVKey
|
import net.torvald.terrarum.gameactors.AVKey
|
||||||
import net.torvald.terrarum.langpack.Lang
|
import net.torvald.terrarum.langpack.Lang
|
||||||
@@ -27,5 +28,7 @@ class FixtureWallCalendar : FixtureBase {
|
|||||||
actorValue[AVKey.BASEMASS] = 1.0
|
actorValue[AVKey.BASEMASS] = 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override var tooltipText: String?
|
||||||
|
get() = INGAME.world.worldTime.getFormattedCalendarDay()
|
||||||
|
set(value) {}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user