diff --git a/assets/mods/basegame/items/itemid.csv b/assets/mods/basegame/items/itemid.csv index a9b919b2d..d0a1170e0 100644 --- a/assets/mods/basegame/items/itemid.csv +++ b/assets/mods/basegame/items/itemid.csv @@ -24,6 +24,7 @@ id;classname;tags 23;net.torvald.terrarum.modulebasegame.gameitems.PickaxeStone;TOOL,PICK 24;net.torvald.terrarum.modulebasegame.gameitems.AxeStone;TOOL,AXE 25;net.torvald.terrarum.modulebasegame.gameitems.ItemClayBall; + 27;net.torvald.terrarum.modulebasegame.gameitems.ItemFurnaceAndAnvil;FIXTURE,CRAFTING 28;net.torvald.terrarum.modulebasegame.gameitems.ItemJukebox;FIXTURE,MUSIC 29;net.torvald.terrarum.modulebasegame.gameitems.ItemCharcoal;COMBUSTIBLE diff --git a/assets/mods/basegame/locales/en/itemdesc.json b/assets/mods/basegame/locales/en/itemdesc.json new file mode 100644 index 000000000..2ae8b3762 --- /dev/null +++ b/assets/mods/basegame/locales/en/itemdesc.json @@ -0,0 +1,45 @@ +{ + "TOOLTIP_basegame:256": "Provides stable light", + "TOOLTIP_basegame:257": "Provides a light equal to the sun", /* it literally does -- provides the sunlight of the exact hour (emits "moonlight" at night time) */ + "TOOLTIP_basegame:258": "Provides a light equal to the sun at noon", + + "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_item@basegame:1": "Breaks rocks", + "TOOLTIP_item@basegame:2": "Breaks rocks", + "TOOLTIP_item@basegame:3": "Breaks rocks", + "TOOLTIP_item@basegame:4": "Breaks down walls", + "TOOLTIP_item@basegame:5": "Provides light but fancier", + "TOOLTIP_item@basegame:6": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */ + "TOOLTIP_item@basegame:8": "Emits a signal", + "TOOLTIP_item@basegame:9": "An electricians’ best friend", + "TOOLTIP_item@basegame:10": "“Who needs a Book and Quill when you’ve got this?”", /* a jab on the Minecraft item Book and Quill */ + "TOOLTIP_item@basegame:11": "Tells what day it is", + "TOOLTIP_item@basegame:12": "Breaks down walls", + "TOOLTIP_item@basegame:13": "Breaks down walls", + "TOOLTIP_item@basegame:14": "Breaks rocks, just barely", + "TOOLTIP_item@basegame:15": "Breaks down walls", + "TOOLTIP_item@basegame:16": "The most essential crafting table", + "TOOLTIP_item@basegame:17": "“Burn a rock and a metal drools out? What madness is this?”", + "TOOLTIP_item@basegame:18": "It’s just a stick", + "TOOLTIP_item@basegame:19": "Cuts trees", + "TOOLTIP_item@basegame:20": "Cuts trees", + "TOOLTIP_item@basegame:21": "Cuts trees", + "TOOLTIP_item@basegame:22": "Cuts trees, just barely", + "TOOLTIP_item@basegame:23": "Cuts trees", + "TOOLTIP_item@basegame:24": "Breaks rocks", + "TOOLTIP_item@basegame:25": "Finer grains of dirts that gets stronger when burned", + /* 26 is Steel Ingot */ + "TOOLTIP_item@basegame:27": "Every blacksmith gotta start from somewhere", + "TOOLTIP_item@basegame:28": "A music vending machine (free to play)", + "TOOLTIP_item@basegame:29": "A coal lookalike that burns just as well and is renewable", + + "TOOLTIP_item@basegame:114": "A precious fuel for the steel production", + + "TOOLTIP_item@basegame:320": "Travel multiverse!\nWarning: a pair is needed for the return trip" +} \ No newline at end of file diff --git a/assets/mods/basegame/locales/koKR/itemdesc.json b/assets/mods/basegame/locales/koKR/itemdesc.json new file mode 100644 index 000000000..0e8f18aae --- /dev/null +++ b/assets/mods/basegame/locales/koKR/itemdesc.json @@ -0,0 +1,45 @@ +{ + "TOOLTIP_basegame:256": "흔들리지 않는 빛을 냅니다", + "TOOLTIP_basegame:257": "태양과 같은 빛을 냅니다", /* it literally does -- provides the sunlight of the exact hour (emits "moonlight" at night time) */ + "TOOLTIP_basegame:258": "한낮의 태양과 같은 빛을 냅니다", + + "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_item@basegame:1": "돌을 부숩니다", + "TOOLTIP_item@basegame:2": "돌을 부숩니다", + "TOOLTIP_item@basegame:3": "돌을 부숩니다", + "TOOLTIP_item@basegame:4": "벽을 부숩니다", + "TOOLTIP_item@basegame:5": "빛을 더 이쁘게 냅니다", + "TOOLTIP_item@basegame:6": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */ + "TOOLTIP_item@basegame:8": "신호를 만들어냅니다", + "TOOLTIP_item@basegame:9": "전기공의 친한 친구", + "TOOLTIP_item@basegame:10": "“이게 있는데 책과 깃펜이 왜 필요하죠?”", /* a jab on the Minecraft item Book and Quill */ + "TOOLTIP_item@basegame:11": "오늘이 무슨 날인지 알려줍니다", + "TOOLTIP_item@basegame:12": "벽을 부숩니다", + "TOOLTIP_item@basegame:13": "벽을 부숩니다", + "TOOLTIP_item@basegame:14": "돌을 간신히 부숩니다", + "TOOLTIP_item@basegame:15": "벽을 부숩니다", + "TOOLTIP_item@basegame:16": "가장 필수적인 조합대", + "TOOLTIP_item@basegame:17": "“돌을 태우면 쇠가 녹아서 떨어진다고? 이 뭔 개소리야?”", /* 태왕사신기 */ + "TOOLTIP_item@basegame:18": "그냥 막대기예요", + "TOOLTIP_item@basegame:19": "나무를 자릅니다", + "TOOLTIP_item@basegame:20": "나무를 자릅니다", + "TOOLTIP_item@basegame:21": "나무를 자릅니다", + "TOOLTIP_item@basegame:22": "나무를 간신히 자릅니다", + "TOOLTIP_item@basegame:23": "나무를 자릅니다", + "TOOLTIP_item@basegame:24": "돌을 부숩니다", + "TOOLTIP_item@basegame:25": "태우면 더 단단해지는 고운 흙입니다", + /* 26 is Steel Ingot */ + "TOOLTIP_item@basegame:27": "모든 대장장이는 초보 시절이 있는 법이죠", + "TOOLTIP_item@basegame:28": "음악 자판기입이다 (무료 플레이)", + "TOOLTIP_item@basegame:29": "석탄과 비슷하고 똑같이 잘 타지만 재생 가능합니다", + + "TOOLTIP_item@basegame:114": "강철 생산의 소중한 연료입니다", + + "TOOLTIP_item@basegame:320": "멀티버스를 여행하세요!\n경고: 2개를 만들어야 왕복이 가능합니다" +} \ No newline at end of file diff --git a/src/net/torvald/terrarum/langpack/Lang.kt b/src/net/torvald/terrarum/langpack/Lang.kt index 100d551fb..b98404b80 100644 --- a/src/net/torvald/terrarum/langpack/Lang.kt +++ b/src/net/torvald/terrarum/langpack/Lang.kt @@ -124,7 +124,9 @@ object Lang { private val bindOp = ">>=" fun getOrNull(key: String?, capitalise: Boolean = true) = - if (key == null) null else get(key, capitalise) + if (key == null) null else get(key, capitalise).let { + if (it.startsWith("$")) null else it + } /** * Syntax example: diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWorldPortal.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWorldPortal.kt index 0c7d69513..14f83aded 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWorldPortal.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWorldPortal.kt @@ -91,7 +91,8 @@ class FixtureWorldPortal : Electric { val ingame = TerrarumIngame(App.batch) val worldParam = TerrarumIngame.NewGameParams(player, it.worldLoadParam) { ingame -> - val world = ingame.world + // I SCRAP THIS IDEA: it makes the game way too easy + /*val world = ingame.world // flatten terrain for (x in world.spawnX - 2..world.spawnX + 2) { @@ -111,7 +112,7 @@ class FixtureWorldPortal : Electric { printdbg(this, "Portal new world callback; spawning portal at ${world.spawnX}, ${world.spawnY - 1}") FixtureWorldPortal().spawn(world.spawnX, world.spawnY - 1, player.uuid) printdbg(this, "Spawn complete") - + */ } ingame.gameLoadInfoPayload = worldParam ingame.gameLoadMode = TerrarumIngame.GameLoadMode.CREATE_NEW diff --git a/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt b/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt index 168fbfbd5..b1bf653fa 100644 --- a/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt +++ b/src/net/torvald/terrarum/ui/UIItemInventoryElemSimple.kt @@ -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) diff --git a/src/net/torvald/terrarum/ui/UIItemInventoryElemWide.kt b/src/net/torvald/terrarum/ui/UIItemInventoryElemWide.kt index 27011c053..cd2cad078 100644 --- a/src/net/torvald/terrarum/ui/UIItemInventoryElemWide.kt +++ b/src/net/torvald/terrarum/ui/UIItemInventoryElemWide.kt @@ -8,6 +8,7 @@ import net.torvald.terrarum.* import net.torvald.terrarum.App.IS_DEVELOPMENT_BUILD import net.torvald.terrarum.App.printdbg 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 @@ -161,19 +162,18 @@ class UIItemInventoryElemWide( // set tooltip accordingly - if (IS_DEVELOPMENT_BUILD && tooltipShowing[hash] != true && item != null && mouseUp) { + if (tooltipShowing[hash] != true && 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?.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)