mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-12 22:56:06 +09:00
new TV-safe watch UI
This commit is contained in:
15
assets/graphics/! PSD to TGA imagemagick.bat
Normal file
15
assets/graphics/! PSD to TGA imagemagick.bat
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
SET basefilename=%~d1%~p1%~n1
|
||||||
|
SET inputextension=%~x1
|
||||||
|
rem inputextension should be dot-psd
|
||||||
|
rem color space must be Lab16
|
||||||
|
|
||||||
|
IF "%inputextension%" NEQ ".psd" goto fail
|
||||||
|
|
||||||
|
convert %1 -colorspace sRGB -write mpr:temp -background black -alpha Remove mpr:temp -compose Copy_Opacity -composite "%basefilename%.tga"
|
||||||
|
|
||||||
|
exit
|
||||||
|
|
||||||
|
:fail
|
||||||
|
echo "File not PSD"
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
Binary file not shown.
BIN
assets/mods/basegame/gui/old_watchface_atlas.tga
LFS
Normal file
BIN
assets/mods/basegame/gui/old_watchface_atlas.tga
LFS
Normal file
Binary file not shown.
Binary file not shown.
@@ -337,7 +337,10 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
uiWatchTierOne = UITierOneWatch(actorNowPlaying)
|
uiWatchTierOne = UITierOneWatch(actorNowPlaying)
|
||||||
uiWatchTierOne.setAsAlwaysVisible()
|
uiWatchTierOne.setAsAlwaysVisible()
|
||||||
uiWatchTierOne.setPosition(Terrarum.WIDTH - uiWatchTierOne.width, uiWatchBasic.height - 2)
|
uiWatchTierOne.setPosition(
|
||||||
|
((Terrarum.WIDTH - AppLoader.getTvSafeActionWidth()) - (uiQuickBar.posX + uiQuickBar.width) - uiWatchTierOne.width) / 2 + (uiQuickBar.posX + uiQuickBar.width),
|
||||||
|
AppLoader.getTvSafeGraphicsHeight() + 7
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
uiTooltip = UITooltip()
|
uiTooltip = UITooltip()
|
||||||
@@ -512,14 +515,6 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
// TODO thread pool(?)
|
// TODO thread pool(?)
|
||||||
CollisionSolver.process()
|
CollisionSolver.process()
|
||||||
|
|
||||||
|
|
||||||
visibleActorsRenderBehind = actorsRenderBehind.filter { it.inScreen() }
|
|
||||||
visibleActorsRenderMiddle = actorsRenderMiddle.filter { it.inScreen() }
|
|
||||||
visibleActorsRenderMidTop = actorsRenderMidTop.filter { it.inScreen() }
|
|
||||||
visibleActorsRenderFront = actorsRenderFront.filter { it.inScreen() }
|
|
||||||
visibleActorsRenderOverlay=actorsRenderOverlay.filter { it.inScreen() }
|
|
||||||
|
|
||||||
|
|
||||||
WorldCamera.update(gameworld, actorNowPlaying)
|
WorldCamera.update(gameworld, actorNowPlaying)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,6 +537,8 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
private fun renderGame() {
|
private fun renderGame() {
|
||||||
Gdx.graphics.setTitle(getCanonicalTitle())
|
Gdx.graphics.setTitle(getCanonicalTitle())
|
||||||
|
|
||||||
|
filterVisibleActors()
|
||||||
|
|
||||||
IngameRenderer.invoke(
|
IngameRenderer.invoke(
|
||||||
world as GameWorldExtension,
|
world as GameWorldExtension,
|
||||||
visibleActorsRenderBehind,
|
visibleActorsRenderBehind,
|
||||||
@@ -556,6 +553,14 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun filterVisibleActors() {
|
||||||
|
visibleActorsRenderBehind = actorsRenderBehind.filter { it.inScreen() }
|
||||||
|
visibleActorsRenderMiddle = actorsRenderMiddle.filter { it.inScreen() }
|
||||||
|
visibleActorsRenderMidTop = actorsRenderMidTop.filter { it.inScreen() }
|
||||||
|
visibleActorsRenderFront = actorsRenderFront.filter { it.inScreen() }
|
||||||
|
visibleActorsRenderOverlay=actorsRenderOverlay.filter { it.inScreen() }
|
||||||
|
}
|
||||||
|
|
||||||
private fun repossessActor() {
|
private fun repossessActor() {
|
||||||
// check if currently pocessed actor is removed from game
|
// check if currently pocessed actor is removed from game
|
||||||
if (!theGameHasActor(actorNowPlaying)) {
|
if (!theGameHasActor(actorNowPlaying)) {
|
||||||
@@ -913,6 +918,7 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
notifier.setPosition(
|
notifier.setPosition(
|
||||||
(Terrarum.WIDTH - notifier.width) / 2, Terrarum.HEIGHT - notifier.height)
|
(Terrarum.WIDTH - notifier.width) / 2, Terrarum.HEIGHT - notifier.height)
|
||||||
|
uiQuickBar.setPosition((Terrarum.WIDTH - uiQuickBar.width) / 2, AppLoader.getTvSafeGraphicsHeight())
|
||||||
|
|
||||||
// inventory
|
// inventory
|
||||||
/*uiInventoryPlayer =
|
/*uiInventoryPlayer =
|
||||||
@@ -925,7 +931,11 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
// basic watch-style notification bar (temperature, new mail)
|
// basic watch-style notification bar (temperature, new mail)
|
||||||
uiWatchBasic.setPosition(Terrarum.WIDTH - uiWatchBasic.width, 0)
|
uiWatchBasic.setPosition(Terrarum.WIDTH - uiWatchBasic.width, 0)
|
||||||
uiWatchTierOne.setPosition(Terrarum.WIDTH - uiWatchTierOne.width, uiWatchBasic.height - 2)
|
uiWatchTierOne.setPosition(
|
||||||
|
((Terrarum.WIDTH - AppLoader.getTvSafeGraphicsWidth()) - (uiQuickBar.posX + uiQuickBar.width) - uiWatchTierOne.width) / 2 + (uiQuickBar.posX + uiQuickBar.width),
|
||||||
|
AppLoader.getTvSafeGraphicsHeight() + 7
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,15 +18,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 = 77
|
override var width = 160
|
||||||
override var height = 53
|
override var height = 25
|
||||||
override var openCloseTime: Second = 0f
|
override var openCloseTime: Second = 0f
|
||||||
|
|
||||||
private var ELuptimer = 10f // init value higher than uptime: 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/watchface2_atlas.tga"), width, height)
|
private var atlas = TextureRegionPack(ModMgr.getPath("basegame", "gui/watchface_atlas.tga"), width, height)
|
||||||
|
|
||||||
private var littleFont = Watch7SegSmall
|
private var littleFont = Watch7SegSmall
|
||||||
private var timeFont = Watch7SegMain
|
private var timeFont = Watch7SegMain
|
||||||
@@ -68,7 +68,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// backplate
|
// backplate
|
||||||
batch.color = drawCol
|
batch.color = Color.WHITE
|
||||||
batch.draw(atlas.get(0, 0), 0f, 0f)
|
batch.draw(atlas.get(0, 0), 0f, 0f)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,15 +80,15 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
|
|
||||||
// day name
|
// day name
|
||||||
batch.color = lcdLitCol
|
batch.color = lcdLitCol
|
||||||
textFont.draw(batch, worldTime.getDayNameShort().toUpperCase(), 9f, 5f)
|
textFont.draw(batch, worldTime.getDayNameShort().toUpperCase(), 71f, 7f)
|
||||||
|
|
||||||
// day
|
// day
|
||||||
littleFont.draw(batch, worldTime.days.toString().padStart(2, ' '), 54f, 4f)
|
littleFont.draw(batch, worldTime.days.toString().padStart(2, ' '), 110f, 6f)
|
||||||
|
|
||||||
// hour
|
// hour
|
||||||
timeFont.draw(batch, worldTime.hours.toString().padStart(2, '/'), 25f, 31f)
|
littleFont.draw(batch, worldTime.hours.toString().padStart(2, '/'), 26f, 6f)
|
||||||
// minute
|
// minute
|
||||||
timeFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 53f, 31f)
|
littleFont.draw(batch, worldTime.minutes.toString().padStart(2, '0'), 48f, 6f)
|
||||||
|
|
||||||
// season marker
|
// season marker
|
||||||
batch.draw(atlas.get(1, worldTime.months - 1), 0f, 0f)
|
batch.draw(atlas.get(1, worldTime.months - 1), 0f, 0f)
|
||||||
@@ -97,7 +97,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas() {
|
|||||||
// 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, 19f)
|
batch.draw(moonDial.get(moonPhase, 0), 6f, 4f)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doOpening(delta: Float) {
|
override fun doOpening(delta: Float) {
|
||||||
|
|||||||
BIN
work_files/UI/overscan_safe_watches.psd
LFS
Normal file
BIN
work_files/UI/overscan_safe_watches.psd
LFS
Normal file
Binary file not shown.
BIN
work_files/graphics/gui/watches/floatey_smol.psd
LFS
Normal file
BIN
work_files/graphics/gui/watches/floatey_smol.psd
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user