mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
click also change of modi; haptic only with touch
This commit is contained in:
@ -499,6 +499,7 @@ void QuickSpellPanel::show(Canvas & to)
|
|||||||
void QuickSpellPanel::inputModiChanged(InputModi modi)
|
void QuickSpellPanel::inputModiChanged(InputModi modi)
|
||||||
{
|
{
|
||||||
create();
|
create();
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
HeroInfoBasicPanel::HeroInfoBasicPanel(const InfoAboutHero & hero, Point * position, bool initializeBackground)
|
HeroInfoBasicPanel::HeroInfoBasicPanel(const InfoAboutHero & hero, Point * position, bool initializeBackground)
|
||||||
|
@ -68,7 +68,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
|
|||||||
return;
|
return;
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
if (enableMouse)
|
if (enableMouse)
|
||||||
|
{
|
||||||
|
setCurrentInputModi(InputModi::MOUSE);
|
||||||
mouseHandler->handleEventMouseButtonDown(current.button);
|
mouseHandler->handleEventMouseButtonDown(current.button);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
if (enableMouse)
|
if (enableMouse)
|
||||||
@ -94,7 +97,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
|
|||||||
return;
|
return;
|
||||||
case SDL_FINGERDOWN:
|
case SDL_FINGERDOWN:
|
||||||
if (enableTouch)
|
if (enableTouch)
|
||||||
|
{
|
||||||
|
setCurrentInputModi(InputModi::TOUCH);
|
||||||
fingerHandler->handleEventFingerDown(current.tfinger);
|
fingerHandler->handleEventFingerDown(current.tfinger);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
case SDL_FINGERUP:
|
case SDL_FINGERUP:
|
||||||
if (enableTouch)
|
if (enableTouch)
|
||||||
@ -109,7 +115,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
|
|||||||
return;
|
return;
|
||||||
case SDL_CONTROLLERBUTTONDOWN:
|
case SDL_CONTROLLERBUTTONDOWN:
|
||||||
if (enableController)
|
if (enableController)
|
||||||
|
{
|
||||||
|
setCurrentInputModi(InputModi::CONTROLLER);
|
||||||
gameControllerHandler->handleEventButtonDown(current.cbutton);
|
gameControllerHandler->handleEventButtonDown(current.cbutton);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
case SDL_CONTROLLERBUTTONUP:
|
case SDL_CONTROLLERBUTTONUP:
|
||||||
if (enableController)
|
if (enableController)
|
||||||
@ -357,6 +366,7 @@ void InputHandler::stopTextInput()
|
|||||||
|
|
||||||
void InputHandler::hapticFeedback()
|
void InputHandler::hapticFeedback()
|
||||||
{
|
{
|
||||||
|
if(currentInputModi == InputModi::TOUCH)
|
||||||
fingerHandler->hapticFeedback();
|
fingerHandler->hapticFeedback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user