bool GuiGameListMenuCtrl::onAdd()
{
   if( !Parent::onAdd() )
      return false;
      
   // If we have a non-GuiGameListMenuProfile profile, try to
   // substitute it for DefaultListMenuProfile.
      
   if( !hasValidProfile() )
   {
      GuiGameListMenuProfile* profile;
      if( !Sim::findObject( "DefaultListMenuProfile", profile ) )
      {
         Con::errorf( "GuiGameListMenuCtrl: %s can't be created with a profile of type %s. Please create it with a profile of type GuiGameListMenuProfile.",
            getName(), mProfile->getClassName() );
         return false;
      }
      else
         Con::warnf( "GuiGameListMenuCtrl: substituted non-GuiGameListMenuProfile in %s for DefaultListMenuProfile", getName() );
         
      setControlProfile( profile );
   }

   return true;
}
Beispiel #2
0
void GuiInspectorField::setInspectorProfile()
{
   GuiControlProfile *profile = NULL;   
   
   if( mInspector->getNumInspectObjects() > 1 )
   {
      if( !hasSameValueInAllObjects() )
         Sim::findObject( "GuiInspectorMultiFieldDifferentProfile", profile );
      else
         Sim::findObject( "GuiInspectorMultiFieldProfile", profile );
   }
   
   if( !profile )
      Sim::findObject( "GuiInspectorFieldProfile", profile );
   
   if( profile )
      setControlProfile( profile );
}