Updated ScEd.

This was SVN commit r2083.
This commit is contained in:
Ykkrosh 2005-03-30 02:06:00 +00:00
parent 8d6ebe1b1f
commit 827e06b8e4
2 changed files with 8 additions and 18 deletions

View File

@ -68,28 +68,23 @@ CBaseEntity* CBaseEntityCollection::getTemplate( CStrW name )
newTemplate->loadBase();
}
else
{
LOG( WARNING, LOG_CATEGORY, "Parent template \"%ls\" does not exist in template \"%ls\"", newTemplate->m_Base_Name.c_str(), newTemplate->m_Tag.c_str() );
// (The requested entity will still be returned, but with no parent.
// Is this a reasonable thing to do?)
}
}
return newTemplate;
}
void CBaseEntityCollection::getTemplateNames( std::vector<CStrW>& names )
void CBaseEntityCollection::getBaseEntityNames( std::vector<CStrW>& names )
{
for( templateFilenameMap::iterator it = m_templateFilenames.begin(); it != m_templateFilenames.end(); ++it )
if( ! (it->first.Length() > 8 && it->first.Left(8) == L"template"))
names.push_back( it->first );
}
#ifdef SCED
// TODO: Fix ScEd, so that it works
CBaseEntity* CBaseEntityCollection::getTemplateByID( int n )
{
return m_templates[n];
}
#endif
CBaseEntityCollection::~CBaseEntityCollection()
{
for( templateMap::iterator it = m_templates.begin(); it != m_templates.end(); ++it )

View File

@ -38,14 +38,9 @@ public:
void loadTemplates();
void LoadFile( const char* path );
// Create a list of the names of all templates, for display in ScEd's
// entity-selection box. (This isn't really very good, since it includes
// 'abstract' entity classes that should never be created, and it doesn't
// split them into useful categories or give them readable names.)
void getTemplateNames( std::vector<CStrW>& names );
#ifdef SCED // a slightly unpleasant hack, since ScEd can only remember numbers:
CBaseEntity* getTemplateByID( int n );
#endif
// Create a list of the names of all base entities, excluding template_*,
// for display in ScEd's entity-selection box.
void getBaseEntityNames( std::vector<CStrW>& names );
};
#endif