mirror of https://github.com/kami-blue/client
[fix] Don't close the GUI when typing a module name
Closes #1793 Signed-off-by: Dominika <sokolov.dominika@gmail.com>
This commit is contained in:
parent
dd42ead163
commit
d32f4db886
|
@ -72,8 +72,9 @@ object KamiClickGui : AbstractKamiGui<ModuleSettingWindow, Module>() {
|
|||
}
|
||||
}
|
||||
|
||||
// Check for typedString added to resolve #1793. TODO: Better solution suggested in #1803
|
||||
override fun keyTyped(typedChar: Char, keyCode: Int) {
|
||||
if (keyCode == Keyboard.KEY_ESCAPE || ClickGUI.bind.value.isDown(keyCode)) {
|
||||
if (keyCode == Keyboard.KEY_ESCAPE || (keyCode == ClickGUI.bind.value.key && typedString.isEmpty())) {
|
||||
ClickGUI.disable()
|
||||
} else if (settingWindow?.listeningChild == null) {
|
||||
when {
|
||||
|
|
|
@ -8,7 +8,7 @@ object ExtraTab : Module(
|
|||
description = "Expands the player tab menu",
|
||||
category = Category.RENDER
|
||||
) {
|
||||
val tabSize = setting("MaxPlayers", 265, 80..400, 5)
|
||||
private val tabSize = setting("MaxPlayers", 265, 80..400, 5)
|
||||
|
||||
fun <E> subList(list: List<E>, fromIndex: Int, toIndex: Int): List<E> {
|
||||
return list.subList(fromIndex, if (isEnabled) tabSize.value.coerceAtMost(list.size) else toIndex)
|
||||
|
|
Loading…
Reference in New Issue