2016-09-14 05:45:46 +00:00
|
|
|
#include "CAudioStateWin.hpp"
|
|
|
|
#include "CSfxManager.hpp"
|
|
|
|
#include "CArchitectureMessage.hpp"
|
|
|
|
#include "CArchitectureQueue.hpp"
|
|
|
|
#include "GameGlobalObjects.hpp"
|
|
|
|
#include "CGameState.hpp"
|
2016-09-25 16:45:22 +00:00
|
|
|
#include "IMain.hpp"
|
2016-09-14 05:45:46 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
CIOWin::EMessageReturn CAudioStateWin::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
|
|
|
|
{
|
|
|
|
const EArchMsgType msgType = msg.GetType();
|
|
|
|
if (msgType == EArchMsgType::SetGameState)
|
|
|
|
{
|
|
|
|
CSfxManager::KillAll(CSfxManager::ESfxChannels::One);
|
|
|
|
CSfxManager::TurnOnChannel(CSfxManager::ESfxChannels::One);
|
|
|
|
}
|
|
|
|
else if (msgType == EArchMsgType::QuitGameplay)
|
|
|
|
{
|
2016-09-17 06:40:45 +00:00
|
|
|
if (g_GameState->GetWorldTransitionManager()->GetTransType() == CWorldTransManager::ETransType::Disabled ||
|
2016-09-25 16:45:22 +00:00
|
|
|
g_Main->GetFlowState() != IMain::EFlowState::Zero)
|
2016-09-14 05:45:46 +00:00
|
|
|
{
|
|
|
|
CSfxManager::SetChannel(CSfxManager::ESfxChannels::Zero);
|
|
|
|
CSfxManager::KillAll(CSfxManager::ESfxChannels::One);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return EMessageReturn::Normal;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|