[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:
Dominika 2021-01-11 21:33:24 -05:00
parent dd42ead163
commit d32f4db886
No known key found for this signature in database
GPG Key ID: B4A5A6DCA70F861F
2 changed files with 3 additions and 2 deletions

View File

@ -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 {

View File

@ -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)