sound cues for buttons

This commit is contained in:
minjaesong
2024-04-01 03:15:57 +09:00
parent f72ed0f706
commit 576e868996
23 changed files with 193 additions and 41 deletions

View File

@@ -35,9 +35,16 @@ abstract class UIItemInventoryCellBase(
var colourTheme: InventoryCellColourTheme = UIItemInventoryCellCommonRes.defaultInventoryCellTheme,
var showTooltip: Boolean = true,
) : UIItem(parentUI, initialX, initialY) {
abstract override fun update(delta: Float)
override fun update(delta: Float) {
suppressHaptic = (item == null)
super.update(delta)
}
abstract override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera)
override var suppressHaptic = false
protected val tooltipHash = System.nanoTime()
/** Custom highlight rule to highlight tihs button to primary accent colour (blue by default).

View File

@@ -51,6 +51,8 @@ open class UIItemInventoryItemGrid(
private val colourTheme: InventoryCellColourTheme = defaultInventoryCellTheme
) : UIItem(parentUI, initialX, initialY) {
override var suppressHaptic = true
// deal with the moving position
//override var oldPosX = posX
//override var oldPosY = posY

View File

@@ -23,6 +23,7 @@ class UIItemListNavBarVertical(
var extraDrawOpOnBottom: (UIItemListNavBarVertical, SpriteBatch) -> Unit = { _,_ -> }
) : UIItem(parentUI, initialX, initialY) {
override var suppressHaptic = true
override val width = UIItemListNavBarVertical.WIDTH
override val mouseUp: Boolean

View File

@@ -496,6 +496,8 @@ class UIItemPlayerCells(
val playerUUID: UUID,
) : UIItem(parent, initialX, initialY) {
override var suppressHaptic = false
override val width = SAVE_CELL_WIDTH
override val height = SAVE_CELL_HEIGHT
@@ -766,6 +768,7 @@ class UIItemWorldCells(
initialY: Int,
val skimmer: DiskSkimmer) : UIItem(parent, initialX, initialY) {
override var suppressHaptic = false
private val metaFile: EntryFile?
private val saveName: String