mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 21:14:04 +09:00
item tooltip descriptions
This commit is contained in:
@@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameitems.GameItem
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.ui.InventoryCellColourTheme
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryCellBase
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryCellCommonRes
|
||||
@@ -134,14 +135,13 @@ class UIItemInventoryElemSimple(
|
||||
|
||||
val grey = App.fontGame.toColorCode(11, 11, 11)
|
||||
val itemIDstr = "\n$grey(${item?.originalID}${if (item?.originalID == item?.dynamicID) "" else "/${item?.dynamicID}"})"
|
||||
val nameStr = if (item?.nameSecondary?.isNotBlank() == true) "${item?.name}\n$grey${item?.nameSecondary}" else "${item?.name}"
|
||||
val nameStr0 = if (item?.nameSecondary?.isNotBlank() == true) "${item?.name}\n$grey${item?.nameSecondary}" else "${item?.name}"
|
||||
val nameStr = if (App.IS_DEVELOPMENT_BUILD) nameStr0 + itemIDstr else nameStr0
|
||||
val descStr = Lang.getOrNull("TOOLTIP_${item?.originalID}")?.replace("\n","\n$grey")
|
||||
|
||||
INGAME.setTooltipMessage(
|
||||
if (App.IS_DEVELOPMENT_BUILD)
|
||||
nameStr + itemIDstr
|
||||
else
|
||||
nameStr
|
||||
)
|
||||
val finalStr = if (descStr != null) "$nameStr\n$grey$descStr" else nameStr
|
||||
|
||||
INGAME.setTooltipMessage(finalStr)
|
||||
|
||||
tooltipShowing[hash] = true
|
||||
// printdbg(this, tooltipShowing.entries)
|
||||
|
||||
Reference in New Issue
Block a user