mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
better item names for discs
This commit is contained in:
@@ -16,6 +16,7 @@ import net.torvald.terrarum.gameitems.ItemID
|
|||||||
import net.torvald.terrarum.savegame.toHex
|
import net.torvald.terrarum.savegame.toHex
|
||||||
import net.torvald.terrarum.utils.JsonFetcher
|
import net.torvald.terrarum.utils.JsonFetcher
|
||||||
import net.torvald.terrarum.worlddrawer.toRGBA
|
import net.torvald.terrarum.worlddrawer.toRGBA
|
||||||
|
import net.torvald.unicode.EMDASH
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by minjaesong on 2024-01-13.
|
* Created by minjaesong on 2024-01-13.
|
||||||
@@ -45,9 +46,10 @@ open class MusicDiscPrototype(originalID: ItemID, module: String, path: String)
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
val meta = MusicDiscHelper.getMetadata(getAsGdxFile())
|
val meta = MusicDiscHelper.getMetadata(getAsGdxFile())
|
||||||
name = meta.title
|
originalName = meta.title
|
||||||
author = meta.author
|
author = meta.author
|
||||||
collection = meta.album
|
collection = meta.album
|
||||||
|
name = "$author $EMDASH $originalName"
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transient override val itemImage: TextureRegion = generateSprite()
|
@Transient override val itemImage: TextureRegion = generateSprite()
|
||||||
|
|||||||
@@ -175,12 +175,14 @@ class UIJukeboxSonglistPanel(val parent: UIJukebox) : UICanvas() {
|
|||||||
if (index in parent.discInventory.indices) {
|
if (index in parent.discInventory.indices) {
|
||||||
parent.discInventory[index].let {
|
parent.discInventory[index].let {
|
||||||
val item = ItemCodex[it] as? ItemFileRef
|
val item = ItemCodex[it] as? ItemFileRef
|
||||||
button.title = item?.name ?: ""
|
button.title = item?.originalName ?: ""
|
||||||
|
button.album = item?.collection ?: ""
|
||||||
button.artist = item?.author ?: ""
|
button.artist = item?.author ?: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
button.title = ""
|
button.title = ""
|
||||||
|
button.album = ""
|
||||||
button.artist = ""
|
button.artist = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,6 +221,7 @@ class UIItemJukeboxSonglist(
|
|||||||
override val width: Int,
|
override val width: Int,
|
||||||
val index: Int,
|
val index: Int,
|
||||||
var title: String = "",
|
var title: String = "",
|
||||||
|
var album: String = "",
|
||||||
var artist: String = "",
|
var artist: String = "",
|
||||||
|
|
||||||
var keyDownFun: (Int, Int, UIItemJukeboxSonglist) -> Unit, // Index, Keycode, self
|
var keyDownFun: (Int, Int, UIItemJukeboxSonglist) -> Unit, // Index, Keycode, self
|
||||||
@@ -298,7 +301,7 @@ class UIItemJukeboxSonglist(
|
|||||||
Toolkit.drawTextCentered(batch, App.fontGame, title, width, posX, posY + textOffsetY)
|
Toolkit.drawTextCentered(batch, App.fontGame, title, width, posX, posY + textOffsetY)
|
||||||
// draw artist
|
// draw artist
|
||||||
batch.color = batch.color.cpy().mul(0.75f, 0.75f, 0.75f, 1f)
|
batch.color = batch.color.cpy().mul(0.75f, 0.75f, 0.75f, 1f)
|
||||||
Toolkit.drawTextCentered(batch, App.fontGame, artist, width, posX, posY + App.fontGame.lineHeight.toInt() - 2*textOffsetY)
|
Toolkit.drawTextCentered(batch, App.fontGame, album, width, posX, posY + App.fontGame.lineHeight.toInt() - 2*textOffsetY)
|
||||||
}
|
}
|
||||||
|
|
||||||
// see IFs above?
|
// see IFs above?
|
||||||
|
|||||||
Reference in New Issue
Block a user