diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp index 91be621ee2..f739f00381 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp @@ -401,6 +401,7 @@ void MapSidebar::OnMapReload() // Reset sim test buttons POST_MESSAGE(SimPlay, (0.f, false)); + POST_MESSAGE(SimStopMusic, ()); POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml")); m_SimState = SimInactive; UpdateSimButtons(); @@ -480,6 +481,7 @@ void MapSidebar::OnSimReset(wxCommandEvent& WXUNUSED(event)) { POST_MESSAGE(SimPlay, (0.f, true)); POST_MESSAGE(SimStateRestore, (L"default")); + POST_MESSAGE(SimStopMusic, ()); POST_MESSAGE(SimPlay, (0.f, false)); POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml")); m_SimState = SimInactive; @@ -488,6 +490,7 @@ void MapSidebar::OnSimReset(wxCommandEvent& WXUNUSED(event)) { POST_MESSAGE(SimPlay, (0.f, true)); POST_MESSAGE(SimStateRestore, (L"default")); + POST_MESSAGE(SimStopMusic, ()); POST_MESSAGE(SimPlay, (0.f, false)); POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml")); m_SimState = SimInactive; diff --git a/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp index 10600c40d8..c627e76736 100644 --- a/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp @@ -127,6 +127,15 @@ QUERYHANDLER(Ping) { UNUSED2(msg); } + +MESSAGEHANDLER(SimStopMusic) +{ + UNUSED2(msg); + + CmpPtr cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY); + if (cmpSoundManager) + cmpSoundManager->StopMusic(); +} MESSAGEHANDLER(SimStateSave) { @@ -135,10 +144,6 @@ MESSAGEHANDLER(SimStateSave) MESSAGEHANDLER(SimStateRestore) { - CmpPtr cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY); - if (cmpSoundManager) - cmpSoundManager->StopMusic(); - AtlasView::GetView_Game()->RestoreState(*msg->label); } diff --git a/source/tools/atlas/GameInterface/Messages.h b/source/tools/atlas/GameInterface/Messages.h index d7f1e60362..49e4defe10 100644 --- a/source/tools/atlas/GameInterface/Messages.h +++ b/source/tools/atlas/GameInterface/Messages.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2014 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -101,6 +101,8 @@ MESSAGE(GuiCharEvent, ////////////////////////////////////////////////////////////////////////// +MESSAGE(SimStopMusic, ); + MESSAGE(SimStateSave, ((std::wstring, label)) // named slot to store saved data );