1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #2438 from Laserlicht/patch-3

trigger haptic feedback on button-sound
This commit is contained in:
Ivan Savenko 2023-07-30 20:14:34 +03:00 committed by GitHub
commit 4c3a02c8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@
#include "../CPlayerInterface.h"
#include "../battle/BattleInterface.h"
#include "../battle/BattleInterfaceClasses.h"
#include "../eventsSDL/InputHandler.h"
#include "../gui/CGuiHandler.h"
#include "../gui/MouseButton.h"
#include "../gui/Shortcut.h"
@ -175,7 +176,10 @@ void CButton::clickPressed(const Point & cursorPosition)
if (getState() != PRESSED)
{
if (!soundDisabled)
{
CCS->soundh->playSound(soundBase::button);
GH.input().hapticFeedback();
}
setState(PRESSED);
if (actOnDown)
@ -403,6 +407,7 @@ void CToggleButton::clickPressed(const Point & cursorPosition)
if (canActivate())
{
CCS->soundh->playSound(soundBase::button);
GH.input().hapticFeedback();
setState(PRESSED);
}
}