I recently managed to compile the latest CEED and noticed UserStrings are killed on Saving
Just implemented it but is there anything i could improve for a pull request?
I added the following to Window::writeXMLToStream() : after the line "writePropertiesXML(xml_stream);" :
Code: Select all
// user strings
const String UserStringXMLElementName( "UserString" );
for( auto iter = d_userStrings.begin(); iter != d_userStrings.end(); ++iter )
{
const String& name = iter->first;
// ignore auto props
if( name.rfind( "_auto_prop__" ) != CEGUI::String::npos )
{
continue;
}
xml_stream.openTag(UserStringXMLElementName)
.attribute(Property::NameXMLAttributeName, name);
// Detect whether it is a long property or not
const String& value = iter->second;
if (value.find((String::value_type)'\n') != String::npos)
{
xml_stream.text(value);
}
else
{
xml_stream.attribute(Property::ValueXMLAttributeName, iter->second);
}
xml_stream.closeTag();
}
Thankz!