mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
storage chest still wip
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import net.torvald.terrarum.UIItemInventoryCatBar.Companion.CAT_ALL
|
||||
import net.torvald.terrarum.gameitem.GameItem
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2021-03-12.
|
||||
*/
|
||||
interface InventoryNegotiator {
|
||||
abstract class InventoryNegotiator {
|
||||
/** Retrieve item filter to be used to show only the acceptable items when player's own inventory is being displayed */
|
||||
fun getItemFilter(): List<String> // GameItem.Category
|
||||
open fun getItemFilter(): List<String> = listOf(CAT_ALL) // GameItem.Category
|
||||
/** Accepts item from the player and pass it to right inventory (object), slot (UI), etc... */
|
||||
fun accept(item: GameItem, amount: Int = 1)
|
||||
abstract fun accept(item: GameItem, amount: Int = 1)
|
||||
/** Rejects item and perhaps returns it back to the player, or make explosion, etc... */
|
||||
fun reject(item: GameItem, amount: Int = 1)
|
||||
abstract fun reject(item: GameItem, amount: Int = 1)
|
||||
}
|
||||
@@ -221,6 +221,8 @@ class UIItemInventoryItemGrid(
|
||||
gridModeButtons[1].highlighted = false
|
||||
itemPage = 0
|
||||
rebuild(currentFilter)
|
||||
|
||||
println("ItemGridMode 0 touchdown")
|
||||
}
|
||||
gridModeButtons[1].touchDownListener = { _, _, _, _ ->
|
||||
isCompactMode = true
|
||||
@@ -228,6 +230,8 @@ class UIItemInventoryItemGrid(
|
||||
gridModeButtons[1].highlighted = true
|
||||
itemPage = 0
|
||||
rebuild(currentFilter)
|
||||
|
||||
println("ItemGridMode 1 touchdown")
|
||||
}
|
||||
|
||||
scrollUpButton.clickOnceListener = { _, _, _ ->
|
||||
|
||||
Reference in New Issue
Block a user