diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/include/IGUIElement.h Irrlicht_starsonata/include/IGUIElement.h --- irrlicht-svn-ss/trunk/include/IGUIElement.h 2007-07-26 02:11:22.000000000 +0200 +++ Irrlicht_starsonata/include/IGUIElement.h 2008-07-25 16:36:24.000000000 +0200 @@ -786,11 +874,32 @@ public: return GUIElementTypeNames[Type]; } + //! STARSONATA, MICHA: Access the element name + core::stringc & getName() + { + return Name; + } + + //! Starsonata, MICHA: textID for stringtables + virtual void setTextID(const wchar_t* text) + { + TextID = text; + } + + //! Returns caption of this element. + virtual const wchar_t* getTextID() + { + return TextID.c_str(); + } + + //! Writes attributes of the scene node. //! Implement this to expose the attributes of your scene node for //! scripting languages, editors, debuggers or xml serialization purposes. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) { + out->addString("IdName", Name.c_str() ); // call it IdName instead of name, because otherwise it's hard to find in the xml + out->addString("TextID", getTextID()); out->addInt("Id", ID ); out->addString("Caption", getText()); out->addRect("Rect", DesiredRect); @@ -813,13 +922,15 @@ public: //! scripting languages, editors, debuggers or xml deserialization purposes. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) { + Name = in->getAttributeAsString("IdName"); + setTextID(in->getAttributeAsStringW("TextID").c_str()); setID(in->getAttributeAsInt("Id")); setText(in->getAttributeAsStringW("Caption").c_str()); setVisible(in->getAttributeAsBool("Visible")); setEnabled(in->getAttributeAsBool("Enabled")); IsTabStop = in->getAttributeAsBool("TabStop"); IsTabGroup = in->getAttributeAsBool("TabGroup"); - TabOrder = in->getAttributeAsBool("TabOrder"); + TabOrder = in->getAttributeAsInt("TabOrder"); core::position2di p = in->getAttributeAsPosition2d("MaxSize"); setMaxSize(core::dimension2di(p.X,p.Y)); @@ -904,6 +1015,12 @@ protected: //! type of element EGUI_ELEMENT_TYPE Type; + + //! STARSONATA, MICHA: We use names to find elements and assign the ID's automatically + core::stringc Name; + + //! Starsonata, MICHA: textID for stringtables + core::stringw TextID; };