randomised music disc sprite

This commit is contained in:
minjaesong
2024-01-14 22:16:19 +09:00
parent 7aa376dc69
commit a973d33e02
5 changed files with 113 additions and 3 deletions

View File

@@ -4,11 +4,13 @@ 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.langpack.Lang
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
import net.torvald.unicode.getKeycapPC
/**
* Created by minjaesong on 2024-01-13.
@@ -46,6 +48,14 @@ class UIJukebox : UICanvas(
}
}
private val controlHelp: String
get() = if (App.environment == RunningEnvironment.PC)
"${getKeycapPC(ControlPresets.getKey("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}"
else
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
private val transitionalSonglistPanel = UIJukeboxSonglistPanel(this)
private val transitionalDiscInventory = UIJukeboxInventory(this)
private val transitionPanel = UIItemHorizontalFadeSlide(
@@ -85,8 +95,17 @@ class UIJukebox : UICanvas(
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
UIInventoryFull.drawBackground(batch, 1f)
uiItems.forEach { it.render(frameDelta, batch, camera) }
val controlHintXPos = thisOffsetX + 2f
App.fontGame.draw(batch, controlHelp, controlHintXPos, yEnd - 20)
}
private val halfSlotOffset = (UIItemInventoryElemSimple.height + UIItemInventoryItemGrid.listGap) / 2
private val thisOffsetX = UIInventoryFull.INVENTORY_CELLS_OFFSET_X() + UIItemInventoryElemSimple.height + UIItemInventoryItemGrid.listGap - halfSlotOffset
private val yEnd = -UIInventoryFull.YPOS_CORRECTION + (App.scr.height + UIInventoryFull.internalHeight).div(2).toFloat()
override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
if (!openingClickLatched) {
return super.touchDown(screenX, screenY, pointer, button)