add queuemessage

This commit is contained in:
Glenn Maynard
2005-02-27 03:21:18 +00:00
parent dcdedc3c52
commit 81bf2cf8ff
3 changed files with 17 additions and 1 deletions
+13 -1
View File
@@ -359,7 +359,10 @@ void Actor::UpdateTweening( float fDeltaTime )
// Execute the command in this tween (if any).
if( TS.sCommandName.size() )
{
this->PlayCommand( TS.sCommandName );
if( TS.sCommandName.Left(1) == "!" )
MESSAGEMAN->Broadcast( TS.sCommandName.substr(1) );
else
this->PlayCommand( TS.sCommandName );
}
}
@@ -1028,6 +1031,15 @@ void Actor::QueueCommand( const CString& sCommandName )
DestTweenState().sCommandName = sCommandName;
}
void Actor::QueueMessage( const CString& sMessageName )
{
// Hack: use "!" as a marker to broadcast a command, instead of playing a
// command, so we don't have to add yet another element to every tween
// state for this rarely-used command.
BeginTweening( 0, TWEEN_LINEAR );
DestTweenState().sCommandName = "!" + sMessageName;
}
void Actor::AddCommand( const CString &sCmdName, apActorCommands apac )
{
m_mapNameToCommands[sCmdName] = apac;