Stop music in Atlas when reloading a map, patch by trompetin17, fixes #1712.
This was SVN commit r16084.
This commit is contained in:
parent
f337905f14
commit
daaddaf433
@ -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;
|
||||
|
@ -128,6 +128,15 @@ QUERYHANDLER(Ping)
|
||||
UNUSED2(msg);
|
||||
}
|
||||
|
||||
MESSAGEHANDLER(SimStopMusic)
|
||||
{
|
||||
UNUSED2(msg);
|
||||
|
||||
CmpPtr<ICmpSoundManager> cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY);
|
||||
if (cmpSoundManager)
|
||||
cmpSoundManager->StopMusic();
|
||||
}
|
||||
|
||||
MESSAGEHANDLER(SimStateSave)
|
||||
{
|
||||
AtlasView::GetView_Game()->SaveState(*msg->label);
|
||||
@ -135,10 +144,6 @@ MESSAGEHANDLER(SimStateSave)
|
||||
|
||||
MESSAGEHANDLER(SimStateRestore)
|
||||
{
|
||||
CmpPtr<ICmpSoundManager> cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY);
|
||||
if (cmpSoundManager)
|
||||
cmpSoundManager->StopMusic();
|
||||
|
||||
AtlasView::GetView_Game()->RestoreState(*msg->label);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user