diff --git a/assets/graphics/gui/quickbar/item_slots_atlas2.tga b/assets/graphics/gui/quickbar/item_slots_atlas2.tga index 4ac5711b4..82cf38ded 100644 --- a/assets/graphics/gui/quickbar/item_slots_atlas2.tga +++ b/assets/graphics/gui/quickbar/item_slots_atlas2.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd1edec9570ea89a2f68a961a886623f7f0430c041bf48a1964b85f671097c8e +oid sha256:e7f794764efb65ad2ed718e20cbd3c009856aecafcac1a67dea939a9420143c7 size 702258 diff --git a/assets/mods/basegame/gui/watchface_analogue_atlas.tga b/assets/mods/basegame/gui/watchface_analogue_atlas.tga index ffc45606e..4c43e3b76 100644 --- a/assets/mods/basegame/gui/watchface_analogue_atlas.tga +++ b/assets/mods/basegame/gui/watchface_analogue_atlas.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b51abc8077d124fda6441836dd4ad94456d5c347de8f2eb4b33db28544412b6 +oid sha256:eaa2dd118e3964ec3ba41ed66f896cb870bbbf1ff34dfafc915fc0bbfa6b5382 size 101394 diff --git a/assets/mods/basegame/gui/watchface_atlas.tga b/assets/mods/basegame/gui/watchface_atlas.tga deleted file mode 100644 index 6d9f91f10..000000000 --- a/assets/mods/basegame/gui/watchface_atlas.tga +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a499803b7ee952165c3b37bb8362bc4b38e3083e567c7a46ad761aca902f8a97 -size 117778 diff --git a/assets/mods/basegame/gui/watchface_large_digital.tga b/assets/mods/basegame/gui/watchface_large_digital.tga new file mode 100644 index 000000000..4e4363585 --- /dev/null +++ b/assets/mods/basegame/gui/watchface_large_digital.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4aaab172e5090859a12ca4cef037de258a5fcc637b7ee56fc0920a97051a830 +size 20754 diff --git a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt index 5afa57321..2379863ca 100644 --- a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt +++ b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt @@ -562,7 +562,8 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) { uiBlur = UIFakeBlurOverlay(1f, true) uiBlur.setPosition(0,0) - uiWatchTierOne = UIWatchLargeAnalogue()//UIWatchLargeDigital() + uiWatchTierOne = UIWatchLargeAnalogue() +// uiWatchTierOne = UIWatchLargeDigital() uiWatchTierOne.setAsAlwaysVisible() uiWatchTierOne.setPosition( ((drawWidth - App.scr.tvSafeActionWidth) - (uiQuickBar.posX + uiQuickBar.width) - uiWatchTierOne.width) / 2 + (uiQuickBar.posX + uiQuickBar.width), diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIWatchLargeDigital.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIWatchLargeDigital.kt index a7eba2f31..9a4f85619 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIWatchLargeDigital.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIWatchLargeDigital.kt @@ -3,7 +3,9 @@ package net.torvald.terrarum.modulebasegame.ui import com.badlogic.gdx.Gdx import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.OrthographicCamera +import com.badlogic.gdx.graphics.Texture import com.badlogic.gdx.graphics.g2d.SpriteBatch +import com.badlogic.gdx.graphics.g2d.TextureRegion import net.torvald.terrarum.* import net.torvald.terrarum.gameworld.WorldTime import net.torvald.terrarum.modulebasegame.imagefont.WatchFont @@ -15,23 +17,33 @@ import kotlin.math.roundToInt * Created by minjaesong on 2017-06-11. */ class UIWatchLargeDigital() : UICanvas() { - override var width = 160 - override var height = 23 + override var width = 162 + override var height = 25 override var openCloseTime: Second = 0f private var ELuptimer = 10f // init value higher than uptime: to make the light turned off by default private val ELuptime = 4f private var ELon = false - private val atlas = TextureRegionPack(ModMgr.getGdxFile("basegame", "gui/watchface_atlas.tga"), width, height) + private val atlas = Texture(ModMgr.getGdxFile("basegame", "gui/watchface_large_digital.tga")) + + private val watchface = TextureRegion(atlas, 0, 0, 162, 25) + private val seasonIcon = Array(4) { + TextureRegion(atlas, 12 * it, 25, 12, 7) + } + private val seasonPos = arrayOf( + 143 to 4, + 131 to 4, + 131 to 12, + 143 to 12, + ) private val watchFont = WatchFont private val moonDial = TextureRegionPack(ModMgr.getGdxFile("basegame", "fonts/watch_17pxmoondial.tga"), 17, 17) private val moonDialCount = moonDial.horizontalCount - private val drawCol = Color(1f, 1f, 1f, UIQuickslotBar.DISPLAY_OPACITY) - private val lcdLitColELoff = Color(0xc0c0c0ff.toInt()) mul drawCol - private val lcdLitColELon = Color(0x404040ff) mul drawCol + private val lcdLitColELoff = Color(0xc0c0c0ff.toInt()) + private val lcdLitColELon = Color(0x404040ff) private val lcdLitCol: Color = lcdLitColELoff //get() = if (ELon) lcdLitColELon else lcdLitColELoff @@ -56,18 +68,9 @@ class UIWatchLargeDigital() : UICanvas() { } override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) { - // light overlay or EL - /*blendNormal(batch) - if (ELon) { - batch.draw(atlas.get(0, 2), 0f, 0f) - } - else { - // backplate - batch.draw(atlas.get(0, 0), 0f, 0f) - }*/ // disabling light button - batch.color = drawCol - batch.draw(atlas.get(0, 0), 0f, 0f) + batch.color = Color.WHITE + batch.draw(watchface, -1f, -1f) // day name @@ -83,7 +86,10 @@ class UIWatchLargeDigital() : UICanvas() { watchFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 49f, 7f) // season marker - batch.draw(atlas.get(1, worldTime.calendarMonth - 1), 0f, 0f) + val season = worldTime.calendarMonth - 1 + seasonPos[season].let { (x, y) -> + batch.draw(seasonIcon[season], x.toFloat(), y.toFloat()) + } // moon dial diff --git a/work_files/graphics/gui/watches/watchface_large_analogue.kra b/work_files/graphics/gui/watches/watchface_large_analogue.kra index 8bf0f9f4a..bd2d0c735 100644 --- a/work_files/graphics/gui/watches/watchface_large_analogue.kra +++ b/work_files/graphics/gui/watches/watchface_large_analogue.kra @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f2df886e7d77a5d75a06f433b084b8074626f1545c5175edacc2883bb6feaa9d -size 221962 +oid sha256:5ab04ffb3f3566f7e6e8a6e398637836c3eb7e7d70352479d53b9fc4939b5bf8 +size 221431 diff --git a/work_files/graphics/gui/watches/watchface_large_digital.kra b/work_files/graphics/gui/watches/watchface_large_digital.kra new file mode 100644 index 000000000..5f26d08e9 --- /dev/null +++ b/work_files/graphics/gui/watches/watchface_large_digital.kra @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d64e1f7cb83579606703e6cc21ed5df633e11592d0dd2a0dccf4be6f4307e082 +size 56222