mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 04:54:05 +09:00
save/load kinda mostly working but fixtures are not getting their sprites back
This commit is contained in:
@@ -3,9 +3,11 @@ package net.torvald.terrarum.gameactors
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.spriteanimation.HasAssembledSprite
|
||||
import net.torvald.spriteanimation.SpriteAnimation
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.AppLoader.printdbgerr
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZED
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZEF
|
||||
@@ -40,7 +42,7 @@ open class ActorWithBody : Actor {
|
||||
|
||||
var physProp = PhysProperties.HUMANOID_DEFAULT
|
||||
|
||||
protected constructor()
|
||||
protected constructor() : super()
|
||||
|
||||
constructor(renderOrder: RenderOrder, physProp: PhysProperties, id: ActorID? = null) : super(renderOrder, id) {
|
||||
this.physProp = physProp
|
||||
@@ -1644,11 +1646,19 @@ open class ActorWithBody : Actor {
|
||||
)
|
||||
}
|
||||
else {
|
||||
sprite.render(batch,
|
||||
(hitbox.startX - offsetX).toFloat(),
|
||||
(hitbox.startY - offsetY).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
try {
|
||||
sprite.render(batch,
|
||||
(hitbox.startX - offsetX).toFloat(),
|
||||
(hitbox.startY - offsetY).toFloat(),
|
||||
(scale).toFloat()
|
||||
)
|
||||
}
|
||||
catch (e: UninitializedPropertyAccessException) {
|
||||
printdbgerr(this, this.javaClass.simpleName)
|
||||
printdbgerr(this, actorValue.getAsString(AVKey.NAME))
|
||||
printdbgerr(this, if (this is HasAssembledSprite) this.animDescPath else "(not HasAssembledSprite)")
|
||||
printdbgerr(this, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
data class PhysProperties(
|
||||
val immobileBody: Boolean,
|
||||
var usePhysics: Boolean,
|
||||
val useStairs: Boolean
|
||||
val immobileBody: Boolean = false,
|
||||
var usePhysics: Boolean = true,
|
||||
val useStairs: Boolean = false
|
||||
) {
|
||||
companion object {
|
||||
val HUMANOID_DEFAULT = PhysProperties(
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.*
|
||||
* Created by minjaesong on 2016-05-09.
|
||||
*/
|
||||
class FactionCodex {
|
||||
val factionContainer = ArrayList<Faction>()
|
||||
@Transient val factionContainer = ArrayList<Faction>()
|
||||
|
||||
fun clear() = factionContainer.clear()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user