From b15b1043f91996c5213d7f1b5aa46202703a572b Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 23 Jul 2014 10:00:03 +0200 Subject: CGE2: Updgrade checkSaySwitch(). Now it takes into account the "Speech volume" option in the Launcher and it only plays the keyClick() sound if the button is really switched, not every time it's clicked. --- engines/cge2/cge2_main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 37821fb375..4d38b1034b 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -833,6 +833,10 @@ void CGE2Engine::checkSaySwitch() { bool speechMute = mute; if (!speechMute) speechMute = ConfMan.getBool("speech_mute"); + if (!speechMute) { + int speechVolume = ConfMan.getInt("speech_volume"); + speechMute = speechVolume == 0; + } if (mute || speechMute) { _sayVox = false; @@ -842,6 +846,7 @@ void CGE2Engine::checkSaySwitch() { if (_oldSayVox != _sayVox) { _commandHandlerTurbo->addCommand(kCmdSeq, 129, _sayVox, nullptr); _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr); + keyClick(); } _oldSayVox = _sayVox; @@ -1160,7 +1165,6 @@ void CGE2Engine::switchCap() { _sayCap = !_sayCap; if (!_sayCap) _sayVox = true; - keyClick(); checkSaySwitch(); } } @@ -1170,7 +1174,6 @@ void CGE2Engine::switchVox() { _sayVox = !_sayVox; if (!_sayVox) _sayCap = true; - keyClick(); checkSaySwitch(); } } -- cgit v1.2.3