2016-09-14 05:45:46 +00:00
|
|
|
#include "CAudioStateWin.hpp"
|
2017-01-22 01:40:12 +00:00
|
|
|
#include "Audio/CSfxManager.hpp"
|
2016-09-14 05:45:46 +00:00
|
|
|
#include "CArchitectureMessage.hpp"
|
|
|
|
#include "CArchitectureQueue.hpp"
|
|
|
|
#include "GameGlobalObjects.hpp"
|
|
|
|
#include "CGameState.hpp"
|
2017-01-22 01:40:12 +00:00
|
|
|
#include "MP1.hpp"
|
2016-09-14 05:45:46 +00:00
|
|
|
|
2017-12-29 08:08:12 +00:00
|
|
|
namespace urde::MP1
|
2017-01-22 01:40:12 +00:00
|
|
|
{
|
2016-09-14 05:45:46 +00:00
|
|
|
|
|
|
|
CIOWin::EMessageReturn CAudioStateWin::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
|
|
|
|
{
|
2017-01-22 01:40:12 +00:00
|
|
|
CMain* m = static_cast<CMain*>(g_Main);
|
|
|
|
|
2016-09-14 05:45:46 +00:00
|
|
|
const EArchMsgType msgType = msg.GetType();
|
|
|
|
if (msgType == EArchMsgType::SetGameState)
|
|
|
|
{
|
2017-01-23 07:22:17 +00:00
|
|
|
CSfxManager::KillAll(CSfxManager::ESfxChannels::Game);
|
|
|
|
CSfxManager::TurnOnChannel(CSfxManager::ESfxChannels::Game);
|
2016-09-14 05:45:46 +00:00
|
|
|
}
|
|
|
|
else if (msgType == EArchMsgType::QuitGameplay)
|
|
|
|
{
|
2016-09-17 06:40:45 +00:00
|
|
|
if (g_GameState->GetWorldTransitionManager()->GetTransType() == CWorldTransManager::ETransType::Disabled ||
|
2017-03-30 22:36:18 +00:00
|
|
|
m->GetFlowState() != EFlowState::None)
|
2016-09-14 05:45:46 +00:00
|
|
|
{
|
2017-01-23 07:22:17 +00:00
|
|
|
CSfxManager::SetChannel(CSfxManager::ESfxChannels::Default);
|
|
|
|
CSfxManager::KillAll(CSfxManager::ESfxChannels::Game);
|
2016-09-14 05:45:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return EMessageReturn::Normal;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|