mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 18:14:06 +09:00
jukebox ui wip
This commit is contained in:
@@ -3,6 +3,10 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureInventory
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureJukebox
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.ItemFileRef
|
||||
import net.torvald.terrarum.ui.*
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
|
||||
@@ -14,6 +18,12 @@ class UIJukebox : UICanvas(
|
||||
toggleButtonLiteral = "control_gamepad_start",
|
||||
) {
|
||||
|
||||
lateinit var parent: FixtureJukebox
|
||||
|
||||
companion object {
|
||||
const val SLOT_SIZE = 8
|
||||
}
|
||||
|
||||
init {
|
||||
CommonResourcePool.addToLoadingList("basegame-gui-jukebox_caticons") {
|
||||
TextureRegionPack(ModMgr.getGdxFile("basegame", "gui/jukebox_caticons.tga"), 20, 20)
|
||||
@@ -30,11 +40,14 @@ class UIJukebox : UICanvas(
|
||||
intArrayOf(0, 1),
|
||||
emptyList(),
|
||||
listOf({ "" }, { "" })
|
||||
)
|
||||
).also {
|
||||
it.catBar.selectionChangeListener = { old, new ->
|
||||
transitionPanel.requestTransition(new)
|
||||
}
|
||||
}
|
||||
|
||||
private val transitionalSonglistPanel = UIJukeboxSonglistPanel(this)
|
||||
private val transitionalDiscInventory = UIJukeboxInventory(this)
|
||||
|
||||
private val transitionPanel = UIItemHorizontalFadeSlide(
|
||||
this,
|
||||
0, 0, width, height, 0f,
|
||||
@@ -42,6 +55,9 @@ class UIJukebox : UICanvas(
|
||||
listOf(transitionalDiscInventory)
|
||||
)
|
||||
|
||||
internal val discInventory: Array<ItemID?>
|
||||
get() = parent.discInventory
|
||||
|
||||
init {
|
||||
addUIitem(catbar)
|
||||
addUIitem(transitionPanel)
|
||||
|
||||
Reference in New Issue
Block a user