diff --git a/assets/mods/basegame/fonts/watch_new.tga b/assets/mods/basegame/fonts/watch_new.tga new file mode 100644 index 000000000..ed03abe4e --- /dev/null +++ b/assets/mods/basegame/fonts/watch_new.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e39f5debc3c0ec7a71c71d17b357c0bd80ce4f17791f4bf5464d5f10ac25791 +size 20780 diff --git a/assets/mods/basegame/gui/old_watchface_atlas_floatey.tga b/assets/mods/basegame/gui/old_watchface_atlas_floatey.tga new file mode 100644 index 000000000..a29dbd6a7 --- /dev/null +++ b/assets/mods/basegame/gui/old_watchface_atlas_floatey.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72827903ef9fa8a1c8d1d899cb6f1f2c6b8e8a35658613bb8685836da9cf70e2 +size 128044 diff --git a/assets/mods/basegame/gui/watchface_atlas.tga b/assets/mods/basegame/gui/watchface_atlas.tga index a29dbd6a7..80defe315 100644 --- a/assets/mods/basegame/gui/watchface_atlas.tga +++ b/assets/mods/basegame/gui/watchface_atlas.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:72827903ef9fa8a1c8d1d899cb6f1f2c6b8e8a35658613bb8685836da9cf70e2 -size 128044 +oid sha256:1f9c91822cf2ffa2b524b00170bf2a82d40bce6978b633209b772e74c53b599f +size 117778 diff --git a/assets/mods/dwarventech/fonts/milkymda.tga b/assets/mods/dwarventech/fonts/milkymda.tga index dc7e9c826..a0099dac3 100644 --- a/assets/mods/dwarventech/fonts/milkymda.tga +++ b/assets/mods/dwarventech/fonts/milkymda.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fea9c5c72ee6c279133be599de50eebe6e71b08903870617e3c33551e0eb93bb +oid sha256:3a76c74c2fe6bcdad9a32c8689dcb78ecf2c945e06f96ebf5861d7e86fe52cf5 size 129068 diff --git a/src/net/torvald/terrarum/itemproperties/GameItem.kt b/src/net/torvald/terrarum/itemproperties/GameItem.kt index 2cf781a64..e70c96e7f 100644 --- a/src/net/torvald/terrarum/itemproperties/GameItem.kt +++ b/src/net/torvald/terrarum/itemproperties/GameItem.kt @@ -212,8 +212,8 @@ abstract class GameItem : Comparable, Cloneable { @JvmStatic val BODY_ARMOUR = 0 @JvmStatic val BODY_BACKPACK = 1 // wings, jetpacks, etc. - @JvmStatic val FOOTWEAR = 2 - @JvmStatic val HEADGEAR = 3 + @JvmStatic val HEADGEAR = 2 + @JvmStatic val FOOTWEAR = 3 @JvmStatic val HAND_GRIP = 4 @JvmStatic val HAND_GAUNTLET = 5 diff --git a/src/net/torvald/terrarum/modulebasegame/Ingame.kt b/src/net/torvald/terrarum/modulebasegame/Ingame.kt index e3a5462c6..115afb5a1 100644 --- a/src/net/torvald/terrarum/modulebasegame/Ingame.kt +++ b/src/net/torvald/terrarum/modulebasegame/Ingame.kt @@ -339,7 +339,7 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) { uiWatchTierOne.setAsAlwaysVisible() uiWatchTierOne.setPosition( ((Terrarum.WIDTH - AppLoader.getTvSafeActionWidth()) - (uiQuickBar.posX + uiQuickBar.width) - uiWatchTierOne.width) / 2 + (uiQuickBar.posX + uiQuickBar.width), - AppLoader.getTvSafeGraphicsHeight() + 7 + AppLoader.getTvSafeGraphicsHeight() + 8 ) @@ -933,7 +933,7 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) { uiWatchBasic.setPosition(Terrarum.WIDTH - uiWatchBasic.width, 0) uiWatchTierOne.setPosition( ((Terrarum.WIDTH - AppLoader.getTvSafeGraphicsWidth()) - (uiQuickBar.posX + uiQuickBar.width) - uiWatchTierOne.width) / 2 + (uiQuickBar.posX + uiQuickBar.width), - AppLoader.getTvSafeGraphicsHeight() + 7 + AppLoader.getTvSafeGraphicsHeight() + 8 ) } diff --git a/src/net/torvald/terrarum/modulebasegame/imagefont/WatchFont.kt b/src/net/torvald/terrarum/modulebasegame/imagefont/WatchFont.kt new file mode 100644 index 000000000..e70f9ebc2 --- /dev/null +++ b/src/net/torvald/terrarum/modulebasegame/imagefont/WatchFont.kt @@ -0,0 +1,38 @@ +package net.torvald.terrarum.modulebasegame.imagefont + +import com.badlogic.gdx.graphics.g2d.Batch +import com.badlogic.gdx.graphics.g2d.BitmapFont +import com.badlogic.gdx.graphics.g2d.GlyphLayout +import net.torvald.terrarum.ModMgr +import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack + +/** + * Created by minjaesong on 2019-01-24. + */ +object WatchFont : BitmapFont() { + internal val W = 9 + internal val H = 12 + + internal val fontSheet = TextureRegionPack(ModMgr.getGdxFile("basegame", "fonts/watch_new.tga"), W, H) + + init { + setOwnsTexture(true) + } + + override fun draw(batch: Batch, str: CharSequence, x: Float, y: Float): GlyphLayout? { + + str.forEachIndexed { index, c -> + batch.draw( + fontSheet.get((c - '0') % 16, (c - '0') / 16), + x + W * index, y + ) + } + + + return null + } + + override fun getLineHeight() = H.toFloat() + override fun getCapHeight() = getLineHeight() + override fun getXHeight() = getLineHeight() +} \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt b/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt index 3f18bc748..97537e84d 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UITierOneWatch.kt @@ -8,9 +8,7 @@ import net.torvald.terrarum.* import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension import net.torvald.terrarum.modulebasegame.gameworld.WorldTime -import net.torvald.terrarum.modulebasegame.imagefont.Watch7SegMain -import net.torvald.terrarum.modulebasegame.imagefont.Watch7SegSmall -import net.torvald.terrarum.modulebasegame.imagefont.WatchDotAlph +import net.torvald.terrarum.modulebasegame.imagefont.WatchFont import net.torvald.terrarum.ui.UICanvas import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack @@ -19,7 +17,7 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack */ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() { override var width = 160 - override var height = 25 + override var height = 23 override var openCloseTime: Second = 0f private var ELuptimer = 10f // init value higher than uptime: to make the light turned off by default @@ -28,18 +26,16 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() { private var atlas = TextureRegionPack(ModMgr.getPath("basegame", "gui/watchface_atlas.tga"), width, height) - private var littleFont = Watch7SegSmall - private var timeFont = Watch7SegMain - private var textFont = WatchDotAlph + private var watchFont = WatchFont private var moonDial = TextureRegionPack(ModMgr.getPath("basegame", "fonts/watch_17pxmoondial.tga"), 17, 17) private var moonDialCount = moonDial.horizontalCount - private val drawCol = Color(1f,1f,1f,0.5f) - private val lcdLitColELoff = Color(0x141414_aa) - private val lcdLitColELon = Color(0x141414_ff) + 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 lcdLitCol: Color - get() = if (ELon) lcdLitColELon else lcdLitColELoff + private val lcdLitCol: Color = lcdLitColELoff + //get() = if (ELon) lcdLitColELon else lcdLitColELoff private val worldTime: WorldTime get() = (Terrarum.ingame!!.world as GameWorldExtension).time @@ -62,33 +58,30 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() { override fun renderUI(batch: SpriteBatch, camera: Camera) { // light overlay or EL + /*blendNormal(batch) if (ELon) { - blendNormal(batch) batch.draw(atlas.get(0, 2), 0f, 0f) } else { // backplate - batch.color = Color.WHITE batch.draw(atlas.get(0, 0), 0f, 0f) - } - - // LCD back - blendNormal(batch) - batch.draw(atlas.get(0, 3), 0f, 0f) - + }*/ + // disabling light button + batch.color = drawCol + batch.draw(atlas.get(0, 0), 0f, 0f) // day name batch.color = lcdLitCol - textFont.draw(batch, worldTime.getDayNameShort().toUpperCase(), 71f, 7f) + watchFont.draw(batch, worldTime.getDayNameShort().toUpperCase(), 73f, 7f) // day - littleFont.draw(batch, worldTime.days.toString().padStart(2, ' '), 110f, 6f) + watchFont.draw(batch, worldTime.days.toString().padStart(2, '@'), 107f, 7f) // hour - littleFont.draw(batch, worldTime.hours.toString().padStart(2, '/'), 26f, 6f) + watchFont.draw(batch, worldTime.hours.toString().padStart(2, '@'), 27f, 7f) // minute - littleFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 48f, 6f) + watchFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 49f, 7f) // season marker batch.draw(atlas.get(1, worldTime.months - 1), 0f, 0f) @@ -97,7 +90,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() { // moon dial val moonPhase = (worldTime.moonPhase * moonDialCount).roundInt() % moonDialCount batch.color = lcdLitCol - batch.draw(moonDial.get(moonPhase, 0), 6f, 4f) + batch.draw(moonDial.get(moonPhase, 0), 6f, 3f) } override fun doOpening(delta: Float) { diff --git a/work_files/UI/inventory_equip_icons.psd b/work_files/UI/inventory_equip_icons.psd new file mode 100644 index 000000000..4f84a1eed --- /dev/null +++ b/work_files/UI/inventory_equip_icons.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:895c0b10fe5756f4d02f526832ba0861dc62c9c7680a04c9bd40936e2677fa7c +size 3953551 diff --git a/work_files/UI/overscan_safe_watches.psd b/work_files/UI/overscan_safe_watches.psd index 7482e84fe..e01f8623a 100644 --- a/work_files/UI/overscan_safe_watches.psd +++ b/work_files/UI/overscan_safe_watches.psd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:081339e3062d40863d638fff2b1681cc1aaa3ad922b1b29767e0094002b8d350 -size 3282054 +oid sha256:56ee20e8c89dd05a13010ebfe10853b98b8226537e85cd9f98d8ccfc53bdc5a6 +size 3284760 diff --git a/work_files/graphics/gui/watches/floatey_smol_consistent.psd b/work_files/graphics/gui/watches/floatey_smol_consistent.psd new file mode 100644 index 000000000..d03a4f7e5 --- /dev/null +++ b/work_files/graphics/gui/watches/floatey_smol_consistent.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d84e01f76243357fad5b1b3c8c3f7bb7fed081787cd92dd51867d7b632edc2f +size 267574 diff --git a/work_files/graphics/items/items.psd b/work_files/graphics/items/items.psd index b24656411..c0a1f4f46 100755 --- a/work_files/graphics/items/items.psd +++ b/work_files/graphics/items/items.psd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0501cf68e975911453bbf4986b7316325e769a90d8341415dc93171240015611 -size 578404 +oid sha256:6b20c79b5b800d7e216b267483c51d51f58e48ffc6eefafe1ce4103feabe8085 +size 582712