diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/include/IGUIElementFactory.h Irrlicht_starsonata/include/IGUIElementFactory.h --- irrlicht-svn-ss/trunk/include/IGUIElementFactory.h 2007-07-26 02:11:22.000000000 +0200 +++ Irrlicht_starsonata/include/IGUIElementFactory.h 2007-10-22 18:57:04.000000000 +0200 @@ -57,6 +57,9 @@ namespace gui /** \param type: Type of GUI element. \return: Returns name of the type if this factory can create the type, otherwise 0. */ virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) = 0; + + //! get the typenumber for the elementname + virtual EGUI_ELEMENT_TYPE getTypeFromName(const c8* name) = 0; }; diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/source/Irrlicht/CDefaultGUIElementFactory.h Irrlicht_starsonata/source/Irrlicht/CDefaultGUIElementFactory.h --- irrlicht-svn-ss/trunk/source/Irrlicht/CDefaultGUIElementFactory.h 2007-07-26 02:11:08.000000000 +0200 +++ Irrlicht_starsonata/source/Irrlicht/CDefaultGUIElementFactory.h 2007-10-22 18:56:54.000000000 +0200 @@ -51,9 +51,10 @@ namespace gui \return: Returns name of the type if this factory can create the type, otherwise 0. */ virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type); - private: + //! get the typenumber for the elementname + virtual EGUI_ELEMENT_TYPE getTypeFromName(const c8* name); - EGUI_ELEMENT_TYPE getTypeFromName(const c8* name); + private: IGUIEnvironment* Environment; }; diff -abBpNPwrU2 --exclude='*.svn' irrlicht-svn-ss/trunk/source/Irrlicht/CGUIEnvironment.cpp Irrlicht_starsonata/source/Irrlicht/CGUIEnvironment.cpp --- irrlicht-svn-ss/trunk/source/Irrlicht/CGUIEnvironment.cpp 2007-07-26 02:11:08.000000000 +0200 +++ Irrlicht_starsonata/source/Irrlicht/CGUIEnvironment.cpp 2008-08-15 18:20:47.000000000 +0200 @@ -612,4 +639,14 @@ IGUIElementFactory* CGUIEnvironment::get } +//! get the typenumber for the elementname +EGUI_ELEMENT_TYPE CGUIEnvironment::getTypeFromName(const c8* name) +{ + EGUI_ELEMENT_TYPE type = EGUIET_ELEMENT; + for (s32 i=0; i<(int)GUIElementFactoryList.size() && type == EGUIET_ELEMENT; ++i) + type = GUIElementFactoryList[i]->getTypeFromName(name); + + return type; +} + //! adds a GUI Element using its name IGUIElement* CGUIEnvironment::addGUIElement(const c8* elementName, IGUIElement* parent) diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/source/Irrlicht/CGUIEnvironment.h Irrlicht_starsonata/source/Irrlicht/CGUIEnvironment.h --- irrlicht-svn-ss/trunk/source/Irrlicht/CGUIEnvironment.h 2007-07-26 02:11:08.000000000 +0200 +++ Irrlicht_starsonata/source/Irrlicht/CGUIEnvironment.h 2008-05-31 04:51:06.000000000 +0200 @@ -242,6 +277,9 @@ private: } }; + //! get the typenumber for the elementname + EGUI_ELEMENT_TYPE getTypeFromName(const c8* name); + struct SSpriteBank { core::stringc Filename;