* .ent: support setting default model value of MiscModel type (<model key="model" name="Model File" value="ass/spider.mdc">)
This commit is contained in:
parent
4a53b753b8
commit
155c2624b1
|
|
@ -247,6 +247,13 @@ public:
|
|||
m_entity.instanceAttach( path_find_mapfile( path.begin(), path.end() ) );
|
||||
m_entity.attach( m_keyObservers );
|
||||
m_entity.attach( m_remapKeysObserver );
|
||||
{ // handle set default model key value
|
||||
const EntityClass& eclass = m_entity.getEntityClass();
|
||||
const char *key = eclass.miscmodel_key();
|
||||
const char *model = EntityClass_valueForKey( eclass, key );
|
||||
if( !string_empty( model ) && model == m_entity.getKeyValue( key ) ) // default found = no key set
|
||||
m_model.modelChanged( model );
|
||||
}
|
||||
}
|
||||
}
|
||||
void instanceDetach( const scene::Path& path ){
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ void Entity_createFromSelection( const char* name, const Vector3& origin ){
|
|||
}
|
||||
}
|
||||
|
||||
if ( isModel ) {
|
||||
if ( isModel && string_empty( EntityClass_valueForKey( *entityClass, entityClass->miscmodel_key() ) ) ) { // handle set default model key value : no dialog needed
|
||||
const char* model = misc_model_dialog( GTK_WIDGET( MainFrame_getWindow() ) );
|
||||
if ( model != 0 ) {
|
||||
entity->setKeyValue( entityClass->miscmodel_key(), model );
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user