1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

always sound at chat message

This commit is contained in:
Laserlicht
2023-09-19 01:08:49 +02:00
committed by GitHub
parent 996036bdf2
commit bcf32984ce

View File

@@ -105,7 +105,13 @@ void CInGameConsole::print(const std::string & txt)
} }
GH.windows().totalRedraw(); // FIXME: ingame console has no parent widget set GH.windows().totalRedraw(); // FIXME: ingame console has no parent widget set
CCS->soundh->playSound(AudioPath::builtin("CHAT"));
int volume = CCS->soundh->getVolume();
if(volume == 0)
CCS->soundh->setVolume(settings["general"]["sound"].Integer());
int handle = CCS->soundh->playSound(AudioPath::builtin("CHAT"));
if(volume == 0)
CCS->soundh->setCallback(handle, [&]() { CCS->soundh->setVolume(0); });
} }
bool CInGameConsole::captureThisKey(EShortcut key) bool CInGameConsole::captureThisKey(EShortcut key)