mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-19 15:04:05 +09:00
block placing is now primary-use (left click/main trigger/screen tap)
This commit is contained in:
@@ -133,9 +133,14 @@ abstract class GameItem : Comparable<GameItem>, Cloneable {
|
||||
open fun effectWhenPickedUp(delta: Float) { }
|
||||
|
||||
/**
|
||||
* Apply effects (continuously or not) while primary button (usually left mouse button) is down.
|
||||
* Apply effects (continuously or not) while primary button is down.
|
||||
* The item will NOT be consumed, so you will want to consume it yourself by inventory.consumeItem(item)
|
||||
*
|
||||
* Primary button refers to all of these:
|
||||
* - Left mouse button (configurable)
|
||||
* - Screen tap
|
||||
* - XBox controller RT (fixed; LT is for jumping)
|
||||
*
|
||||
* @return true when used successfully, false otherwise
|
||||
*
|
||||
* note: DO NOT super() this!
|
||||
@@ -146,9 +151,11 @@ abstract class GameItem : Comparable<GameItem>, Cloneable {
|
||||
open fun startPrimaryUse(delta: Float): Boolean = false
|
||||
|
||||
/**
|
||||
* Apply effects (continuously or not) while secondary button (usually right mouse button) is down
|
||||
* Apply effects (continuously or not) while secondary button is down
|
||||
* The item will NOT be consumed, so you will want to consume it yourself by inventory.consumeItem(item)
|
||||
*
|
||||
* NOTE: please refrain from using this; secondary button is currently undefined in the gamepad and touch input.
|
||||
*
|
||||
* @return true when used successfully, false otherwise
|
||||
*
|
||||
* note: DO NOT super() this!
|
||||
|
||||
@@ -190,7 +190,7 @@ object ItemCodex {
|
||||
|
||||
override val equipPosition: Int = EquipPosition.HAND_GRIP
|
||||
|
||||
override fun startSecondaryUse(delta: Float): Boolean {
|
||||
override fun startPrimaryUse(delta: Float): Boolean {
|
||||
val ingame = Terrarum.ingame!! as Ingame // must be in here
|
||||
ingame.world.setFluid(Terrarum.mouseTileX, Terrarum.mouseTileY, Fluid.WATER, 4f)
|
||||
return true
|
||||
@@ -217,7 +217,7 @@ object ItemCodex {
|
||||
|
||||
override val equipPosition: Int = EquipPosition.HAND_GRIP
|
||||
|
||||
override fun startSecondaryUse(delta: Float): Boolean {
|
||||
override fun startPrimaryUse(delta: Float): Boolean {
|
||||
val ingame = Terrarum.ingame!! as Ingame // must be in here
|
||||
ingame.world.setFluid(Terrarum.mouseTileX, Terrarum.mouseTileY, Fluid.LAVA, 4f)
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user