working crafting workbench

This commit is contained in:
minjaesong
2023-09-20 16:01:40 +09:00
parent a168db23de
commit 5957f70ff8
12 changed files with 145 additions and 31 deletions

View File

@@ -113,6 +113,13 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
inputMouseY = newmy
}
private val inventoryCategoryAllowClickAndDrag = listOf(
GameItem.Category.TOOL,
GameItem.Category.WALL,
GameItem.Category.WIRE,
GameItem.Category.BLOCK
)
fun update() {
///////////////////
@@ -140,7 +147,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
// - not clicking anymore
// - using any item that is not fixture (blocks, picks)
if (!Terrarum.mouseDown ||
GameItem.Category.MISC != ItemCodex.get(terrarumIngame.actorNowPlaying?.inventory?.itemEquipped?.get(GameItem.EquipPosition.HAND_GRIP))?.inventoryCategory) {
inventoryCategoryAllowClickAndDrag.contains(ItemCodex[terrarumIngame.actorNowPlaying?.inventory?.itemEquipped?.get(GameItem.EquipPosition.HAND_GRIP)]?.inventoryCategory)) {
worldPrimaryClickLatched = false
}