File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
common/src/main/kotlin/com/lambda/module Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import com.lambda.event.listener.Listener
1414import com.lambda.event.listener.SafeListener
1515import com.lambda.event.listener.SafeListener.Companion.listener
1616import com.lambda.event.listener.UnsafeListener
17- import com.lambda.gui.api.LambdaGui
1817import com.lambda.gui.impl.clickgui.buttons.ModuleButton
1918import com.lambda.module.modules.client.ClickGui
2019import com.lambda.module.tag.ModuleTag
@@ -116,9 +115,9 @@ abstract class Module(
116115 if (mc.options.commandKey.isPressed) return @listener
117116 if (keybind == KeyCode .UNBOUND ) return @listener
118117 if (event.translated != keybind) return @listener
119- if (mc.currentScreen is ChatScreen ) return @listener
118+ if (mc.currentScreen != null ) return @listener
120119
121- if (mc.currentScreen == null || this @Module is ClickGui ) toggle()
120+ toggle()
122121 }
123122
124123 onEnable {
Original file line number Diff line number Diff line change 11package com.lambda.module.modules.client
22
33import com.lambda.event.events.ClientEvent
4+ import com.lambda.event.events.KeyPressEvent
5+ import com.lambda.event.events.TickEvent
6+ import com.lambda.event.listener.SafeListener.Companion.listener
47import com.lambda.event.listener.UnsafeListener.Companion.unsafeListener
58import com.lambda.gui.impl.clickgui.LambdaClickGui
69import com.lambda.gui.impl.hudgui.LambdaHudGui
@@ -43,6 +46,14 @@ object ClickGui : Module(
4346 LambdaHudGui .close()
4447 }
4548
49+ listener<KeyPressEvent > { event ->
50+ if (mc.options.commandKey.isPressed) return @listener
51+ if (keybind == KeyCode .UNBOUND ) return @listener
52+ if (event.translated != keybind) return @listener
53+ // ToDo: Exception for ui text input
54+ toggle()
55+ }
56+
4657 unsafeListener<ClientEvent .Shutdown > {
4758 disable()
4859 }
You can’t perform that action at this time.
0 commit comments