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