mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 02:24:05 +09:00
a new watchface to support seasons instead of months
This commit is contained in:
BIN
assets/mods/basegame/gui/watchface2_atlas.tga
LFS
Normal file
BIN
assets/mods/basegame/gui/watchface2_atlas.tga
LFS
Normal file
Binary file not shown.
@@ -72,7 +72,7 @@ void main() {
|
|||||||
// TODO blend a breakage (0xrrggbb where 0xr0 -- upper 4 bits of int_red component)
|
// TODO blend a breakage (0xrrggbb where 0xr0 -- upper 4 bits of int_red component)
|
||||||
|
|
||||||
|
|
||||||
// if statements considered harmful
|
// if statements considered harmful (on shader program)
|
||||||
// --definitely not Dijkstra
|
// --definitely not Dijkstra
|
||||||
/*if (tileXY.x == 0 && tileXY.y == 0)
|
/*if (tileXY.x == 0 && tileXY.y == 0)
|
||||||
gl_FragColor = nocolour;
|
gl_FragColor = nocolour;
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import net.torvald.dataclass.CircularArray
|
|||||||
import net.torvald.terrarum.*
|
import net.torvald.terrarum.*
|
||||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||||
import net.torvald.terrarum.gamecontroller.KeyToggler
|
import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||||
import net.torvald.terrarum.gameworld.GameWorld
|
|
||||||
import net.torvald.terrarum.gameworld.fmod
|
import net.torvald.terrarum.gameworld.fmod
|
||||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
|
||||||
import net.torvald.terrarum.modulebasegame.gameactors.ParticleBase
|
import net.torvald.terrarum.modulebasegame.gameactors.ParticleBase
|
||||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||||
import net.torvald.terrarum.ui.UICanvas
|
import net.torvald.terrarum.ui.UICanvas
|
||||||
|
|||||||
@@ -22,15 +22,15 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
|||||||
* Created by minjaesong on 2017-06-11.
|
* Created by minjaesong on 2017-06-11.
|
||||||
*/
|
*/
|
||||||
class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
||||||
override var width = 85
|
override var width = 77
|
||||||
override var height = 52
|
override var height = 53
|
||||||
override var openCloseTime: Second = 0f
|
override var openCloseTime: Second = 0f
|
||||||
|
|
||||||
private var ELuptimer = 10f // to make the light turned off by default
|
private var ELuptimer = 10f // init value higher than uptime: to make the light turned off by default
|
||||||
private val ELuptime = 4f
|
private val ELuptime = 4f
|
||||||
private var ELon = false
|
private var ELon = false
|
||||||
|
|
||||||
private var atlas = TextureRegionPack(ModMgr.getPath("basegame", "gui/watchface_atlas.tga"), width, height)
|
private var atlas = TextureRegionPack(ModMgr.getPath("basegame", "gui/watchface2_atlas.tga"), width, height)
|
||||||
|
|
||||||
private var littleFont = Watch7SegSmall
|
private var littleFont = Watch7SegSmall
|
||||||
private var timeFont = Watch7SegMain
|
private var timeFont = Watch7SegMain
|
||||||
@@ -91,23 +91,24 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
|
|
||||||
// day name
|
// day name
|
||||||
batch.color = lcdLitCol
|
batch.color = lcdLitCol
|
||||||
textFont.draw(batch, worldTime.getDayNameShort().toUpperCase(), 7f, 7f)
|
textFont.draw(batch, worldTime.getDayNameShort().toUpperCase(), 9f, 5f)
|
||||||
|
|
||||||
// month
|
|
||||||
littleFont.draw(batch, worldTime.months.toString().padStart(2, ' '), 40f, 6f)
|
|
||||||
// day
|
// day
|
||||||
littleFont.draw(batch, worldTime.days.toString().padStart(2, ' '), 62f, 6f)
|
littleFont.draw(batch, worldTime.days.toString().padStart(2, ' '), 54f, 4f)
|
||||||
|
|
||||||
// hour
|
// hour
|
||||||
timeFont.draw(batch, worldTime.hours.toString().padStart(2, '/'), 30f, 28f)
|
timeFont.draw(batch, worldTime.hours.toString().padStart(2, '/'), 25f, 31f)
|
||||||
// minute
|
// minute
|
||||||
timeFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 58f, 28f)
|
timeFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 53f, 31f)
|
||||||
|
|
||||||
|
// season marker
|
||||||
|
batch.draw(atlas.get(1, worldTime.months - 1), 0f, 0f)
|
||||||
|
|
||||||
|
|
||||||
// moon dial
|
// moon dial
|
||||||
val moonPhase = (worldTime.moonPhase * moonDialCount).roundInt() % moonDialCount
|
val moonPhase = (worldTime.moonPhase * moonDialCount).roundInt() % moonDialCount
|
||||||
batch.color = lcdLitCol
|
batch.color = lcdLitCol
|
||||||
batch.draw(moonDial.get(moonPhase, 0), 4f, 22f)
|
batch.draw(moonDial.get(moonPhase, 0), 4f, 19f)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doOpening(delta: Float) {
|
override fun doOpening(delta: Float) {
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ import java.util.zip.GZIPInputStream
|
|||||||
/**
|
/**
|
||||||
* Sub-portion of IngameRenderer. You are not supposed to directly deal with this.
|
* Sub-portion of IngameRenderer. You are not supposed to directly deal with this.
|
||||||
*
|
*
|
||||||
|
* The terrain texture atlas is HARD CODED as "4096x4096, on which 256x256 tiles are contained"
|
||||||
|
* in the shader (tiling.frag). This will not be a problem in the base game, but if you are modifying
|
||||||
|
* this engine for your project, you must edit the shader program accordingly.
|
||||||
|
*
|
||||||
* Created by minjaesong on 2016-01-19.
|
* Created by minjaesong on 2016-01-19.
|
||||||
*/
|
*/
|
||||||
internal object BlocksDrawer {
|
internal object BlocksDrawer {
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user