mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +09:00
fix: pickaxe will constantly closing the tooltip while equipped
This commit is contained in:
@@ -18,6 +18,7 @@ import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.DroppedItem
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.PickaxeCore.BASE_MASS_AND_SIZE
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.PickaxeCore.TOOL_DURABILITY_BASE
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryCellCommonRes.tooltipShowing
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas.RenderTag
|
||||
import org.dyn4j.geometry.Vector2
|
||||
import kotlin.math.roundToInt
|
||||
@@ -26,6 +27,8 @@ import kotlin.math.roundToInt
|
||||
* Created by minjaesong on 2019-03-10.
|
||||
*/
|
||||
object PickaxeCore {
|
||||
private val hash = 10002L
|
||||
|
||||
/**
|
||||
* @param mx centre position of the digging
|
||||
* @param my centre position of the digging
|
||||
@@ -199,13 +202,14 @@ object PickaxeCore {
|
||||
Lang[ItemCodex[itemForOre]!!.originalName]
|
||||
else "???"
|
||||
INGAME.setTooltipMessage(tileName)
|
||||
tooltipShowing[hash] = true
|
||||
tooltipSet = true
|
||||
}
|
||||
|
||||
true // just a placeholder
|
||||
}
|
||||
|
||||
if (!tooltipSet) INGAME.setTooltipMessage(null)
|
||||
if (!tooltipSet) tooltipShowing[hash] = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ object UIItemInventoryCellCommonRes {
|
||||
/**
|
||||
* Special hash values:
|
||||
* - 10001: Encumbrance bar
|
||||
* - 10002: Pickaxe
|
||||
*/
|
||||
val tooltipShowing = HashMap<Long, Boolean>() // Long: `hash` field on UIItemInventoryItemGrid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user