change BGALayer to use Actor's map of commands

add "applydefaultoptions" command
clean up CoinMode and Premium enums
This commit is contained in:
Chris Danford
2005-01-04 10:51:25 +00:00
parent 5e31b8af60
commit 57e02f2b75
13 changed files with 88 additions and 49 deletions
+12 -8
View File
@@ -494,14 +494,15 @@ void BGAnimationLayer::LoadFromIni( const CString& sAniDir_, const IniKey& layer
if( KeyName.Right(7) != "command" )
continue; /* not a command */
const CString &Data = i->second;
CString CmdName;
const CString &sData = i->second;
Commands cmds = ParseCommands( sData );
CString sCmdName;
/* Special case: "Command=foo" -> "OnCommand=foo" */
if( KeyName.size() == 7 )
CmdName="on";
sCmdName="on";
else
CmdName = KeyName.Left( KeyName.size()-7 );
m_asCommands[CmdName] = Data;
sCmdName = KeyName.Left( KeyName.size()-7 );
m_mapNameToCommands[sCmdName] = cmds;
}
}
@@ -1005,18 +1006,21 @@ void BGAnimationLayer::LoseFocus()
void BGAnimationLayer::PlayCommand( const CString &sCommandName )
{
// Don't call base version.
//Actor::PlayCommand( sCommandName );
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->RunCommands( ParseCommands("playcommand,"+sCommandName) );
CString sKey = sCommandName;
sKey.MakeLower();
map<CString, CString>::const_iterator it = m_asCommands.find( sKey );
map<CString, Commands>::const_iterator it = m_mapNameToCommands.find( sKey );
if( it == m_asCommands.end() )
if( it == m_mapNameToCommands.end() )
return;
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->RunCommands( ParseCommands(it->second) );
m_SubActors[i]->RunCommands( it->second );
}
/*