diff --git a/assets/mods/basegame/locales/en/itemdesc.json b/assets/mods/basegame/locales/en/itemdesc.json index c11573660..6ced9f080 100644 --- a/assets/mods/basegame/locales/en/itemdesc.json +++ b/assets/mods/basegame/locales/en/itemdesc.json @@ -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", diff --git a/assets/mods/basegame/locales/koKR/itemdesc.json b/assets/mods/basegame/locales/koKR/itemdesc.json index c7a1f82de..d42618cc4 100644 --- a/assets/mods/basegame/locales/koKR/itemdesc.json +++ b/assets/mods/basegame/locales/koKR/itemdesc.json @@ -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": "돌을 부숩니다", diff --git a/src/net/torvald/terrarum/langpack/Lang.kt b/src/net/torvald/terrarum/langpack/Lang.kt index 2a07c1a2e..03d3649ad 100644 --- a/src/net/torvald/terrarum/langpack/Lang.kt +++ b/src/net/torvald/terrarum/langpack/Lang.kt @@ -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) diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIWallCalendar.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIWallCalendar.kt index d08a36472..36192791a 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIWallCalendar.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIWallCalendar.kt @@ -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 diff --git a/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt b/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt index e9c9891fc..d2b90e254 100644 --- a/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt +++ b/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt @@ -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