Foreground: don't propagate OnCommand

We load foreground changes at the beginning of the screen, but they
shouldn't be issued an OnCommand until it's time for them to start.  The
Foreground layer, however, should get the OnCommand right away.  So
don't propagate it, since we already issue On manually to changes.
This commit is contained in:
Devin J. Pohly
2014-02-20 10:59:49 -05:00
parent 3ac15cc1ce
commit 9801ec52b2
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -120,6 +120,17 @@ void Foreground::Update( float fDeltaTime )
m_fLastMusicSeconds = GAMESTATE->m_Position.m_fMusicSeconds;
}
void Foreground::HandleMessage( const Message &msg )
{
// We want foregrounds to behave as if their On command happens at the
// starting beat, not when the Foreground object receives an On command.
// So don't propagate that; we'll call it ourselves.
if (msg.GetName() == "On")
Actor::HandleMessage(msg);
else
ActorFrame::HandleMessage(msg);
}
/*
* (c) 2004 Glenn Maynard
* All rights reserved.