yet another tooltip stuffs

This commit is contained in:
minjaesong
2024-10-12 11:26:29 +09:00
parent 66c2ffa598
commit dbb0c60976
24 changed files with 53 additions and 82 deletions

View File

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

View File

@@ -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()
}
/**

View File

@@ -91,7 +91,7 @@ class UIItemHorizontalFadeSlide(
it.posY = it.initialY
}
INGAME.setTooltipMessage(null)
releaseTooltip()
}
override fun show() {

View File

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

View File

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