diff --git a/assets/locales/en/terrarum.json b/assets/locales/en/terrarum.json index 072840365..83dfb67d4 100644 --- a/assets/locales/en/terrarum.json +++ b/assets/locales/en/terrarum.json @@ -22,5 +22,8 @@ "MENU_OPTIONS_PARTICLES": "Particles", "MENU_IO_IMPORT": "Import", "APP_NOMODULE_1": "No Module is currently loaded.", - "APP_NOMODULE_2": "Please configure your Load Order and restart:" + "APP_NOMODULE_2": "Please configure your Load Order and restart:", + "MENU_LABEL_KEYCONFIG_HELP1": "Click On the Keycap to Assign Actions", + "MENU_LABEL_IME_TOGGLE": "Toggle IME", + "MENU_LABEL_PASTE_FROM_CLIPBOARD": "Paste from Cliboard" } \ No newline at end of file diff --git a/assets/locales/koKR/terrarum.json b/assets/locales/koKR/terrarum.json index 1a1799c51..f0759cbb5 100644 --- a/assets/locales/koKR/terrarum.json +++ b/assets/locales/koKR/terrarum.json @@ -21,5 +21,8 @@ "MENU_OPTIONS_PARTICLES": "입자 수", "MENU_IO_IMPORT": "가져오기", "APP_NOMODULE_1": "현재 불러와진 모듈이 없습니다.", - "APP_NOMODULE_2": "다음의 파일에서 불러오기 순서를 설정하고 게임을 재시작하십시오." + "APP_NOMODULE_2": "다음의 파일에서 불러오기 순서를 설정하고 게임을 재시작하십시오.", + "MENU_LABEL_KEYCONFIG_HELP1": "키캡을 클릭해 컨트롤을 배정하십시오", + "MENU_LABEL_IME_TOGGLE": "입력기 켜고 끄기", + "MENU_LABEL_PASTE_FROM_CLIPBOARD": "복사한 텍스트 붙여넣기" } diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt index ea32fe7c9..942c76ae7 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt @@ -177,9 +177,19 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() { App.fontGame.draw(batch, txt2, selDrawX + halfselw + (halfselw - tw2) / 2, y1) // title - // TODO only when text input using gamepad is supported, and even then, use text spinner -// val title = Lang["MENU_LABEL_IME"] -// App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat()) + // todo show "Keyboard"/"Gamepad" accordingly + val title = Lang["MENU_CONTROLS_KEYBOARD"] + batch.color = Color.WHITE + App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat()) + + + // button help for string input UI + val help1 = "↓ ${Lang["MENU_LABEL_IME_TOGGLE"]}" + App.fontGame.draw(batch, help1, drawX + 10f, height - 40f - 28f) + val help2 = "${Lang["MENU_LABEL_PASTE_FROM_CLIPBOARD"]} ↑" + App.fontGame.draw(batch, help2, drawX + keyboardTestPanel.width - 4f - App.fontGame.getWidth(help2), height - 40f + 30f) + + batch.color = Color.WHITE uiItems.forEach { it.render(batch, camera) } diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt index e1e9a2b99..684ba2227 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt @@ -197,18 +197,20 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() { uiItems.forEach { it.render(batch, camera) } buttonReset.render(batch, camera) + // title + // todo show "Keyboard"/"Gamepad" accordingly batch.color = Color.WHITE + val title = Lang["MENU_CONTROLS_KEYBOARD"] + App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat()) + val desc = Lang["MENU_LABEL_KEYCONFIG_HELP1"] + App.fontGame.draw(batch, desc, drawX.toFloat() + (width - App.fontGame.getWidth(desc)) / 2, drawY + 360f) + + // action palette + batch.color = Color.WHITE if (keycapClicked >= 0 && controlSelected < 0) { controlPalette.render(batch, camera) } - - // title - // TODO display window "title" using text spinner ONLY WHEN gamepad config is also supported -// val title = Lang["MENU_OPTIONS_CONTROLS"] -// batch.color = Color.WHITE -// App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat()) - } fun setControlOf(key: Int, control: Int) { diff --git a/src/net/torvald/unsafe/UnsafePtr.kt b/src/net/torvald/unsafe/UnsafePtr.kt index a3e127287..44858f755 100644 --- a/src/net/torvald/unsafe/UnsafePtr.kt +++ b/src/net/torvald/unsafe/UnsafePtr.kt @@ -113,8 +113,8 @@ internal class UnsafePtr(pointer: Long, allocSize: Long) { // appear (e.g. getting garbage values when it fucking shouldn't) // using ifs instead of assertions: inactive assert statements still slows down the app - if (destroyed) { throw DanglingPointerException("The pointer is already destroyed ($this)") } - if (index !in 0 until size) { throw AddressOverflowException("Index: $index; alloc size: $size") } +// if (destroyed) { throw DanglingPointerException("The pointer is already destroyed ($this)") } +// if (index !in 0 until size) { throw AddressOverflowException("Index: $index; alloc size: $size") } } operator fun get(index: Long): Byte {