mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-11 22:31:52 +09:00
still working on vt, still buggy :/
Former-commit-id: 9164ca8ef33917f7254c65f3947903b8a17dd654 Former-commit-id: 3ebf64f00a0b86d11a449c1d399e149f2714839c
This commit is contained in:
@@ -343,37 +343,6 @@ open class SimpleTextTerminal(
|
||||
var sb: StringBuilder = StringBuilder()
|
||||
private var inputOpen = false
|
||||
private var keyPressVisible = false
|
||||
/**
|
||||
* @param echo if true, keypresses are echoed to the terminal.
|
||||
*/
|
||||
override fun openInput(echo: Boolean) {
|
||||
lastStreamInput = null
|
||||
lastKeyPress = null
|
||||
inputOpen = true
|
||||
keyPressVisible = echo
|
||||
if (DEBUG) println("[SimpleTextTerminal] openInput()")
|
||||
}
|
||||
|
||||
override fun closeInputKey(keyFromUI: Int): Int {
|
||||
inputOpen = false
|
||||
lastKeyPress = keyFromUI
|
||||
|
||||
if (DEBUG) println("[SimpleTextTerminal] closeInputKey(), $keyFromUI")
|
||||
return keyFromUI
|
||||
}
|
||||
|
||||
override var lastStreamInput: String? = null
|
||||
override var lastKeyPress: Int? = null
|
||||
|
||||
override fun closeInputString(): String {
|
||||
inputOpen = false
|
||||
lastStreamInput = sb.toString()
|
||||
sb = StringBuilder()
|
||||
|
||||
if (DEBUG)
|
||||
println("[SimpleTextTerminal] closeInputString(), ${if (keyPressVisible) lastStreamInput else "<keypress hidden>"}")
|
||||
return lastStreamInput!!
|
||||
}
|
||||
|
||||
override fun keyPressed(key: Int, c: Char) {
|
||||
lastInputByte = c.toInt()
|
||||
|
||||
Reference in New Issue
Block a user