mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
fix: game crashes on pasting text
This commit is contained in:
@@ -65,13 +65,13 @@ let states = {"keylayouts":[[""],[undefined],
|
||||
[undefined],
|
||||
["\n"],
|
||||
["\x08"],
|
||||
[";","~"],
|
||||
["¤","~"],
|
||||
["-","_"],
|
||||
["=","+"],
|
||||
["[","{"],
|
||||
["]","}"],
|
||||
["\\","₩"],
|
||||
["ㅆ",":"],
|
||||
[";",":"],
|
||||
["'",'"'],
|
||||
["/","?"],
|
||||
[undefined],
|
||||
|
||||
@@ -73,8 +73,8 @@ basegame
|
||||
// Commit counts up to the Release 0.3.3: 3020
|
||||
|
||||
// val VERSION_SNAPSHOT = Snapshot(0) // for normal dev
|
||||
// val VERSION_SNAPSHOT = ForcedSnapshot("24w04a") // for snapshot release
|
||||
val VERSION_SNAPSHOT = null // for the release
|
||||
val VERSION_SNAPSHOT = ForcedSnapshot("24w07b") // for snapshot release
|
||||
// val VERSION_SNAPSHOT = null // for the release
|
||||
|
||||
const val VERSION_TAG: String = ""
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ object ControlPanelCommon {
|
||||
}
|
||||
}
|
||||
else if (args.startsWith("typeinres")) {
|
||||
val oldwidth = App.scr.width
|
||||
val oldheight = App.scr.height
|
||||
val keyWidth = optionNames[0]
|
||||
val keyHeight = optionNames[1]
|
||||
UIItemTextLineInput(parent, x, y, CONFIG_SPINNER_WIDTH,
|
||||
@@ -178,8 +180,8 @@ object ControlPanelCommon {
|
||||
}
|
||||
else {
|
||||
it.markAsInvalid()
|
||||
App.setConfig(keyWidth, TerrarumScreenSize.defaultW)
|
||||
App.setConfig(keyHeight, TerrarumScreenSize.defaultH)
|
||||
App.setConfig(keyWidth, oldwidth)
|
||||
App.setConfig(keyHeight, oldheight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ class UIItemTextLineInput(
|
||||
|
||||
textbuf.addAll(actuallyInserted)
|
||||
cursorX += codepoints.size
|
||||
currentTextLenPx = App.fontGame.getWidth(CodepointSequence(textbuf.subList(0, cursorX)))
|
||||
currentTextLenPx = App.fontGame.getWidth(CodepointSequence(textbuf.subList(0, minOf(cursorX, textbuf.size))))
|
||||
moveCursorForward(currentTextLenPx - oldTextLenPx)
|
||||
oldTextLenPx = currentTextLenPx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user