mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 13:51:53 +09:00
tooltip show item id if ALT is down
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package net.torvald.terrarum.ui
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.Input.Keys
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
@@ -136,7 +139,7 @@ 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 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 nameStr = if (Gdx.input.isKeyPressed(Input.Keys.ALT_LEFT)) nameStr0 + itemIDstr else nameStr0
|
||||
val descStr = Lang.getOrNull("TOOLTIP_${item?.originalID}")?.replace("\n","\n$grey")
|
||||
|
||||
val finalStr = if (descStr != null) "$nameStr\n$grey$descStr" else nameStr
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.torvald.terrarum.ui
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
@@ -168,7 +170,7 @@ class UIItemInventoryElemWide(
|
||||
val grey = App.fontGame.toColorCode(11, 11, 11)
|
||||
val itemIDstr = "\n$grey(${item?.originalID}${if (item?.originalID == item?.dynamicID) "" else "/${item?.dynamicID}"})"
|
||||
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 nameStr = if (Gdx.input.isKeyPressed(Input.Keys.ALT_LEFT)) nameStr0 + itemIDstr else nameStr0
|
||||
val descStr = Lang.getOrNull("TOOLTIP_${item?.originalID}")?.replace("\n","\n$grey")
|
||||
|
||||
val finalStr = if (descStr != null) "$nameStr\n$grey$descStr" else nameStr
|
||||
|
||||
Reference in New Issue
Block a user