Przeglądaj źródła

Button-Sound -> haptic feedback

Michael 2 lat temu
rodzic
commit
aaa115cf4b
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      client/widgets/Buttons.cpp

+ 5 - 0
client/widgets/Buttons.cpp

@@ -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);
 	}
 }