DEADSOFTWARE

Remove guava
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / input / handler / keyboard / OpenInventoryKeyboardInputHandler.kt
index f04c993147d5776091b90bc23b3c506100df6b22..70ae1585c75a9f5ed3f974ddbb147c8871481ecb 100644 (file)
@@ -2,20 +2,22 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard
 
 import ru.deadsoftware.cavedroid.game.GameScope
 import ru.deadsoftware.cavedroid.game.GameUiWindow
-import ru.deadsoftware.cavedroid.game.input.IGameInputHandler
+import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler
 import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction
 import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey
-import ru.deadsoftware.cavedroid.game.windows.GameWindowsManager
+import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager
+import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler
 import javax.inject.Inject
 
 @GameScope
+@BindKeyboardInputHandler
 class OpenInventoryKeyboardInputHandler @Inject constructor(
-    private val gameWindowsManager: GameWindowsManager
-) : IGameInputHandler<KeyboardInputAction> {
+    private val gameWindowsManager: GameWindowsManager,
+) : IKeyboardInputHandler {
 
     override fun checkConditions(action: KeyboardInputAction): Boolean {
         return action.actionKey is KeyboardInputActionKey.OpenInventory &&
-                action.isKeyDown && gameWindowsManager.getCurrentWindow() == GameUiWindow.NONE
+                !action.isKeyDown && gameWindowsManager.getCurrentWindow() == GameUiWindow.NONE
     }
 
     override fun handle(action: KeyboardInputAction) {