Skip to content

Commit

Permalink
One Shot Tasks no longer trigger a sound when stating a game.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brotcrunsher committed Dec 8, 2023
1 parent bc1efeb commit cba9fec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Examples/ExampleMother/ExampleMother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class MyGame : public bbe::Game
size_t trayIconIndex = 0;

int32_t amountOfTasksNow = 0;
int32_t amountOfTasksNowWithoutOneShot = 0;

public:
MyGame()
Expand Down Expand Up @@ -573,12 +574,18 @@ class MyGame : public bbe::Game

beginMeasure("Task Amount Calculation");
amountOfTasksNow = 0;
amountOfTasksNowWithoutOneShot = 0;

for (size_t i = 0; i < tasks.getLength(); i++)
{
Task& t = tasks[i];
if (t.nextPossibleExecution().hasPassed())
{
amountOfTasksNow++;
if (!t.oneShot)
{
amountOfTasksNowWithoutOneShot++;
}
}
}

Expand Down Expand Up @@ -617,7 +624,7 @@ class MyGame : public bbe::Game
}

beginMeasure("Working Hours");
if (!openTasksNotificationSilenced && isGameOn && amountOfTasksNow > 0 && isWorkTime())
if (!openTasksNotificationSilenced && isGameOn && amountOfTasksNowWithoutOneShot > 0 && isWorkTime())
{
static float timeSinceLastNotify = 10000.0f;
timeSinceLastNotify += timeSinceLastFrame;
Expand Down

0 comments on commit cba9fec

Please sign in to comment.