storage chest still wip

This commit is contained in:
minjaesong
2021-03-13 15:48:14 +09:00
parent d093c2cb30
commit c25e9f92be
11 changed files with 148 additions and 98 deletions

View File

@@ -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)
}

View File

@@ -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 = { _, _, _ ->