block placing is now primary-use (left click/main trigger/screen tap)

This commit is contained in:
minjaesong
2019-02-12 01:20:12 +09:00
parent 07b801ace5
commit 7c3acf6e84
4 changed files with 16 additions and 13 deletions

View File

@@ -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!

View File

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