fix: item desc

This commit is contained in:
minjaesong
2024-03-17 20:26:12 +09:00
parent 33671d6e52
commit 2785a67823
5 changed files with 14 additions and 10 deletions

View File

@@ -6,9 +6,11 @@
"TOOLTIP_wire@basegame:8192": "Carries signals",
"TOOLTIP_wire@basegame:8193": "Carries signals",
"TOOLTIP_wire@basegame:8194": "Carries signals",
"TOOLTIP_wire@basegame:8196": "Carries power",
"TOOLTIP_wire@basegame:8197": "Carries power",
"TOOLTIP_wire@basegame:8198": "Carries information",
"TOOLTIP_wire@basegame:8195": "Carries signals",
"TOOLTIP_wire@basegame:8196": "Carries signals",
"TOOLTIP_wire@basegame:1": "Carries power",
"TOOLTIP_wire@basegame:2": "Carries power",
"TOOLTIP_wire@basegame:16": "Carries information",
"TOOLTIP_item@basegame:1": "Breaks rocks",
"TOOLTIP_item@basegame:2": "Breaks rocks",

View File

@@ -6,9 +6,10 @@
"TOOLTIP_wire@basegame:8192": "신호를 전달합니다",
"TOOLTIP_wire@basegame:8193": "신호를 전달합니다",
"TOOLTIP_wire@basegame:8194": "신호를 전달합니다",
"TOOLTIP_wire@basegame:8196": "전력을 전달합니다",
"TOOLTIP_wire@basegame:8197": "전력을 전달합니다",
"TOOLTIP_wire@basegame:8198": "정보를 전달합니다",
"TOOLTIP_wire@basegame:8195": "신호를 전달합니다",
"TOOLTIP_wire@basegame:1": "전력을 전달합니다",
"TOOLTIP_wire@basegame:2": "전력을 전달합니다",
"TOOLTIP_wire@basegame:16": "정보를 전달합니다",
"TOOLTIP_item@basegame:1": "돌을 부숩니다",
"TOOLTIP_item@basegame:2": "돌을 부숩니다",

View File

@@ -170,8 +170,9 @@ object Lang {
}
fun getAndUseTemplate(key: String, capitalise: Boolean = false, vararg arguments: Any?): String {
var raw = get(key, capitalise)
fun getAndUseTemplate(key: String, capitalise: Boolean = false, vararg arguments: Any?): String? {
var raw = getOrNull(key, capitalise) ?: return null
arguments.forEachIndexed { index, it0 ->
val it = if (capitalise) it0.toString().capitalize() else it0.toString()
raw = raw.replace("{${index}}", it)

View File

@@ -313,7 +313,7 @@ class UIWallCalendar : UICanvas(
// cell texts
batch.color = Toolkit.Theme.COL_LIST_DEFAULT
Toolkit.drawTextCentered(batch, App.fontGame, Lang.getAndUseTemplate("CONTEXT_CALENDAR_DATE_FORMAT_Y", false, thisYear), yearCellWidth, (width - yearCellWidth) / 2, y - 34)
Toolkit.drawTextCentered(batch, App.fontGame, Lang.getAndUseTemplate("CONTEXT_CALENDAR_DATE_FORMAT_Y", false, thisYear)!!, yearCellWidth, (width - yearCellWidth) / 2, y - 34)
for (week in 0..7) {
// highlight this week and the mouse-up
batch.color = if (week == todayOfWeek) Toolkit.Theme.COL_SELECTED else if (week == mouseOverCell % 8) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_LIST_DEFAULT

View File

@@ -139,7 +139,7 @@ class UIItemInventoryElemSimple(
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}"
val nameStr = if (Gdx.input.isKeyPressed(Input.Keys.ALT_LEFT)) nameStr0 + itemIDstr else nameStr0
val descStr = Lang.getAndUseTemplate("TOOLTIP_${item?.originalID}")?.replace("\n","\n$grey")
val descStr = Lang.getOrNull("TOOLTIP_${item?.originalID}")?.replace("\n","\n$grey")
val finalStr = if (descStr != null) "$nameStr\n$grey$descStr" else nameStr