mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
yet another tooltip stuffs
This commit is contained in:
@@ -81,7 +81,10 @@ class ConsoleWindow : UICanvas() {
|
||||
lb.add("${it.referenceID} (${it.actorValue[AVKey.NAME] ?: "\u03AF-${it.javaClass.simpleName}"})")
|
||||
}
|
||||
|
||||
it.setTooltipMessage(if (lb.size > 0) lb.joinToString("\n") else null)
|
||||
if (lb.size > 0)
|
||||
acquireTooltip(lb.joinToString("\n"))
|
||||
else
|
||||
releaseTooltip()
|
||||
|
||||
// click to enter the actor's reference ID
|
||||
if (lb.size > 0 && !clickLatched && Gdx.input.isButtonPressed(App.getConfigInt("config_mouseprimary"))) {
|
||||
@@ -90,7 +93,7 @@ class ConsoleWindow : UICanvas() {
|
||||
}
|
||||
}
|
||||
else {
|
||||
it.setTooltipMessage(null)
|
||||
releaseTooltip()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +269,7 @@ class ConsoleWindow : UICanvas() {
|
||||
drawOffY = MovementInterpolator.fastPullOut(openingTimeCounter.toFloat() / openCloseTime.toFloat(),
|
||||
-height.toFloat(), 0f
|
||||
)*/
|
||||
clearTooltip()
|
||||
}
|
||||
|
||||
override fun doClosing(delta: Float) {
|
||||
@@ -275,6 +279,7 @@ class ConsoleWindow : UICanvas() {
|
||||
)*/
|
||||
textinput.isEnabled = false
|
||||
textinput.mouseoverUpdateLatch = false
|
||||
clearTooltip()
|
||||
}
|
||||
|
||||
override fun endOpening(delta: Float) {
|
||||
@@ -282,6 +287,7 @@ class ConsoleWindow : UICanvas() {
|
||||
openingTimeCounter = 0f
|
||||
textinput.isEnabled = true
|
||||
textinput.mouseoverUpdateLatch = true
|
||||
clearTooltip()
|
||||
}
|
||||
|
||||
override fun endClosing(delta: Float) {
|
||||
@@ -291,7 +297,7 @@ class ConsoleWindow : UICanvas() {
|
||||
// printdbg(this, "Close -- resume game")
|
||||
}
|
||||
iMadeTheGameToPause = false
|
||||
Terrarum.ingame?.setTooltipMessage(null)
|
||||
clearTooltip()
|
||||
drawOffY = -height.toFloat()
|
||||
openingTimeCounter = 0f
|
||||
}
|
||||
|
||||
@@ -137,7 +137,6 @@ abstract class UICanvas(
|
||||
/** A function that is run ONCE when the UI is requested to be opened; will work identical to [endOpening] if [openCloseTime] is zero */
|
||||
open fun show() {
|
||||
openingClickLatched = true
|
||||
clearTooltip()
|
||||
uiItems.forEach { it.show() }
|
||||
handler.subUIs.forEach { it.show() }
|
||||
}
|
||||
@@ -170,7 +169,7 @@ abstract class UICanvas(
|
||||
*/
|
||||
open fun doOpening(delta: Float) {
|
||||
handler.opacity = handler.openCloseCounter / openCloseTime
|
||||
|
||||
clearTooltip()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,6 +177,7 @@ abstract class UICanvas(
|
||||
*/
|
||||
open fun doClosing(delta: Float) {
|
||||
handler.opacity = (openCloseTime - handler.openCloseCounter) / openCloseTime
|
||||
clearTooltip()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,7 +91,7 @@ class UIItemHorizontalFadeSlide(
|
||||
it.posY = it.initialY
|
||||
}
|
||||
|
||||
INGAME.setTooltipMessage(null)
|
||||
releaseTooltip()
|
||||
}
|
||||
|
||||
override fun show() {
|
||||
|
||||
@@ -131,8 +131,6 @@ class UIItemInventoryElemSimple(
|
||||
|
||||
// set tooltip accordingly
|
||||
if (!tooltipAcquired() && mouseUp) {
|
||||
// printdbg(this, "calling INGAME.setTooltipMessage by $hash")
|
||||
|
||||
val grey = App.fontGame.toColorCode(11, 11, 11)
|
||||
val itemIDstr = "\n$grey(${item?.originalID}${if (item?.isCurrentlyDynamic == true) "/${item?.dynamicID}" else ""})"
|
||||
val nameStr0 = if (item?.nameSecondary?.isNotBlank() == true) "${item?.name}\n$grey${item?.nameSecondary}" else "${item?.name}"
|
||||
|
||||
@@ -159,8 +159,6 @@ class UIItemInventoryElemWide(
|
||||
|
||||
// set tooltip accordingly
|
||||
if (!tooltipAcquired() && item != null && mouseUp) {
|
||||
// printdbg(this, "calling INGAME.setTooltipMessage by $hash")
|
||||
|
||||
val grey = App.fontGame.toColorCode(11, 11, 11)
|
||||
val itemIDstr = "\n$grey(${item?.originalID}${if (item?.isCurrentlyDynamic == true) "/${item?.dynamicID}" else ""})"
|
||||
val nameStr0 = if (item?.nameSecondary?.isNotBlank() == true) "${item?.name}\n$grey${item?.nameSecondary}" else "${item?.name}"
|
||||
|
||||
Reference in New Issue
Block a user