mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
newday
This commit is contained in:
parent
bcf32984ce
commit
6ae09d8458
@ -228,14 +228,22 @@ CInfoBar::VisibleComponentInfo::VisibleComponentInfo(const std::vector<Component
|
||||
|
||||
void CInfoBar::playNewDaySound()
|
||||
{
|
||||
int volume = CCS->soundh->getVolume();
|
||||
int handle = -1;
|
||||
if(volume == 0)
|
||||
CCS->soundh->setVolume(settings["general"]["sound"].Integer());
|
||||
|
||||
if(LOCPLINT->cb->getDate(Date::DAY_OF_WEEK) != 1) // not first day of the week
|
||||
CCS->soundh->playSound(soundBase::newDay);
|
||||
handle = CCS->soundh->playSound(soundBase::newDay);
|
||||
else if(LOCPLINT->cb->getDate(Date::WEEK) != 1) // not first week in month
|
||||
CCS->soundh->playSound(soundBase::newWeek);
|
||||
handle = CCS->soundh->playSound(soundBase::newWeek);
|
||||
else if(LOCPLINT->cb->getDate(Date::MONTH) != 1) // not first month
|
||||
CCS->soundh->playSound(soundBase::newMonth);
|
||||
handle = CCS->soundh->playSound(soundBase::newMonth);
|
||||
else
|
||||
CCS->soundh->playSound(soundBase::newDay);
|
||||
handle = CCS->soundh->playSound(soundBase::newDay);
|
||||
|
||||
if(volume == 0)
|
||||
CCS->soundh->setCallback(handle, [&]() { CCS->soundh->setVolume(0); });
|
||||
}
|
||||
|
||||
void CInfoBar::reset()
|
||||
|
Loading…
Reference in New Issue
Block a user