mirror of https://github.com/kami-blue/client
[fix] Command history
This commit is contained in:
parent
0d247244bf
commit
d895459def
|
@ -15,16 +15,16 @@ import org.kamiblue.command.AbstractArg
|
||||||
import org.kamiblue.command.AutoComplete
|
import org.kamiblue.command.AutoComplete
|
||||||
import org.kamiblue.commons.extension.stream
|
import org.kamiblue.commons.extension.stream
|
||||||
import org.lwjgl.input.Keyboard
|
import org.lwjgl.input.Keyboard
|
||||||
import java.util.*
|
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
class KamiGuiChat(
|
class KamiGuiChat(
|
||||||
startStringIn: String,
|
startStringIn: String,
|
||||||
historyBufferIn: String? = null,
|
private val historyBufferIn: String? = null,
|
||||||
sentHistoryCursorIn: Int? = null
|
private val sentHistoryCursorIn: Int? = null
|
||||||
) : GuiChat(startStringIn) {
|
) : GuiChat(startStringIn) {
|
||||||
|
|
||||||
init {
|
override fun initGui() {
|
||||||
|
super.initGui()
|
||||||
historyBufferIn?.let { historyBuffer = it }
|
historyBufferIn?.let { historyBuffer = it }
|
||||||
sentHistoryCursorIn?.let { sentHistoryCursor = it }
|
sentHistoryCursorIn?.let { sentHistoryCursor = it }
|
||||||
}
|
}
|
||||||
|
@ -79,11 +79,10 @@ class KamiGuiChat(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun displayNormalChatGUI() {
|
private fun displayNormalChatGUI() {
|
||||||
GuiChat(inputField.text).apply {
|
GuiChat(inputField.text).also {
|
||||||
historyBuffer = this@KamiGuiChat.historyBuffer
|
|
||||||
sentHistoryCursor = this@KamiGuiChat.sentHistoryCursor
|
|
||||||
}.also {
|
|
||||||
mc.displayGuiScreen(it)
|
mc.displayGuiScreen(it)
|
||||||
|
it.historyBuffer = this.historyBuffer
|
||||||
|
it.sentHistoryCursor = this.sentHistoryCursor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue