diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index cfe212873..30b1989ae 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -499,6 +499,7 @@ void QuickSpellPanel::show(Canvas & to) void QuickSpellPanel::inputModiChanged(InputModi modi) { create(); + redraw(); } HeroInfoBasicPanel::HeroInfoBasicPanel(const InfoAboutHero & hero, Point * position, bool initializeBackground) diff --git a/client/eventsSDL/InputHandler.cpp b/client/eventsSDL/InputHandler.cpp index cc6d79d9f..b0e1d141b 100644 --- a/client/eventsSDL/InputHandler.cpp +++ b/client/eventsSDL/InputHandler.cpp @@ -68,7 +68,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) return; case SDL_MOUSEBUTTONDOWN: if (enableMouse) + { + setCurrentInputModi(InputModi::MOUSE); mouseHandler->handleEventMouseButtonDown(current.button); + } return; case SDL_MOUSEBUTTONUP: if (enableMouse) @@ -94,7 +97,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) return; case SDL_FINGERDOWN: if (enableTouch) + { + setCurrentInputModi(InputModi::TOUCH); fingerHandler->handleEventFingerDown(current.tfinger); + } return; case SDL_FINGERUP: if (enableTouch) @@ -109,7 +115,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) return; case SDL_CONTROLLERBUTTONDOWN: if (enableController) + { + setCurrentInputModi(InputModi::CONTROLLER); gameControllerHandler->handleEventButtonDown(current.cbutton); + } return; case SDL_CONTROLLERBUTTONUP: if (enableController) @@ -357,7 +366,8 @@ void InputHandler::stopTextInput() void InputHandler::hapticFeedback() { - fingerHandler->hapticFeedback(); + if(currentInputModi == InputModi::TOUCH) + fingerHandler->hapticFeedback(); } uint32_t InputHandler::getTicks()