mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
sprites can be rendered across the world seam
This commit is contained in:
@@ -4,10 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.TitleScreen
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.INVENTORY_CELLS_OFFSET_Y
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.INVENTORY_CELLS_UI_HEIGHT
|
||||
@@ -86,7 +83,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
full.handler.lockToggle()
|
||||
full.lockTransition()
|
||||
// save the game
|
||||
WriteSavegame(Terrarum.ingame!!.savegameArchive, File(App.defaultSaveDir, "${App.getTIME_T()}"), Terrarum.ingame!! as TerrarumIngame) {
|
||||
WriteSavegame(INGAME.savegameArchive, File(App.defaultSaveDir, "${App.getTIME_T()}"), Terrarum.ingame!! as TerrarumIngame) {
|
||||
// callback:
|
||||
System.gc()
|
||||
screen = 0
|
||||
|
||||
@@ -27,7 +27,7 @@ class UIInventoryFull(
|
||||
) : UICanvas(toggleKeyLiteral, toggleButtonLiteral, customPositioning, doNotWarnConstant) {
|
||||
|
||||
val actor: ActorHumanoid
|
||||
get() = Terrarum.ingame!!.actorNowPlaying!!
|
||||
get() = INGAME.actorNowPlaying!!
|
||||
|
||||
override var width: Int = App.scr.width
|
||||
override var height: Int = App.scr.height
|
||||
|
||||
@@ -34,7 +34,7 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
private val minimapRerenderInterval = .5f
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
MinimapComposer.setWorld(Terrarum.ingame!!.world)
|
||||
MinimapComposer.setWorld(INGAME.world)
|
||||
MinimapComposer.update()
|
||||
minimapRerenderTimer += Gdx.graphics.deltaTime
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class UIItemInventoryEquippedView(
|
||||
|
||||
|
||||
// sprite
|
||||
val sprite = Terrarum.ingame!!.actorNowPlaying?.sprite
|
||||
val sprite = INGAME.actorNowPlaying?.sprite
|
||||
sprite?.let {
|
||||
blendNormal(batch)
|
||||
|
||||
@@ -119,7 +119,7 @@ class UIItemInventoryEquippedView(
|
||||
internal fun rebuild() {
|
||||
rebuildList = false
|
||||
|
||||
Terrarum.ingame!!.actorNowPlaying?.inventory?.let {
|
||||
INGAME.actorNowPlaying?.inventory?.let {
|
||||
// sort by equip position
|
||||
|
||||
// fill the grid from fastest index, make no gap in-between of slots
|
||||
|
||||
@@ -37,7 +37,7 @@ class UITierOneWatch() : UICanvas() {
|
||||
//get() = if (ELon) lcdLitColELon else lcdLitColELoff
|
||||
|
||||
private val worldTime: WorldTime
|
||||
get() = Terrarum.ingame!!.world.worldTime
|
||||
get() = INGAME.world.worldTime
|
||||
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
|
||||
@@ -63,8 +63,8 @@ class UIVitalMetre(
|
||||
|
||||
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
||||
g.translate(
|
||||
Terrarum.ingame!!.screenZoom * (player.centrePosPoint.x.toFloat() - (WorldCamera.x)),
|
||||
Terrarum.ingame!!.screenZoom * (player.centrePosPoint.y.toFloat() - (WorldCamera.y))
|
||||
INGAME.screenZoom * (player.centrePosPoint.x.toFloat() - (WorldCamera.x)),
|
||||
INGAME.screenZoom * (player.centrePosPoint.y.toFloat() - (WorldCamera.y))
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user