1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Play the sound only on mouse up when looking for help

This commit is contained in:
Mathieu Schroeter 2018-08-14 23:12:54 +02:00
parent 4877928e62
commit f11514e5e5

View File

@ -2965,7 +2965,6 @@ bool
CEvent::EventButtons (const SDL_Event & event, Point pos)
{
Sint32 lg;
Sounds sound;
// Cherche le tool tips à utiliser pour la souris.
m_textToolTips[0] = 0;
@ -3033,22 +3032,14 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
{
m_bHiliInfoButton = true;
if (
event.type == SDL_MOUSEBUTTONDOWN &&
(event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT))
{
if (m_pDecor->GetInfoMode ())
sound = SOUND_CLOSE;
else
sound = SOUND_OPEN;
m_pSound->PlayImage (sound, pos);
}
if (
event.type == SDL_MOUSEBUTTONUP &&
(event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT))
{
m_pSound->PlayImage (
m_pDecor->GetInfoMode () ? SOUND_CLOSE : SOUND_OPEN, pos);
// Show or hide the informations at the top.
m_pDecor->SetInfoMode (!m_pDecor->GetInfoMode ());
}