Got back on track today with working on this. Instead of checking defaults before the xml document is created, I am checking them before it is saved. Had to change that a tad to make use of the serializer i recently learned how to use properly.
In the process i accidentally created an Undo feature. Got a line of code wrong in the deserialization (data to readable text), and instead of clearing the element that was being edited and re-adding it. It buried it inside it like the following:
Code:
<?xml version="1.0" encoding="us-ascii"?>
<TextureInfo item="CS_Buttons.bmp">
<XmlDocument>
<TextureInfo item="CS_Buttons.bmp">
<XmlDocument>
<TextureInfo item="CS_Buttons.bmp">
<Size>
<CX>256</CX>
<CY>256</CY>
</Size>
</TextureInfo>
</XmlDocument>
<Size>
<CX>256</CX>
<CY>300</CY>
</Size>
</TextureInfo>
</XmlDocument>
<Size>
<CX>256</CX>
<CY>400</CY>
</Size>
</TextureInfo>
However the code that reads the individual elements before saving to file doesn't know to look for XmlDocument element, so it only grabs the outermost one:
Code:
<?xml version="1.0" encoding="us-ascii"?>
<TextureInfo item="CS_Buttons.bmp">
<Size>
<CX>256</CX>
<CY>400</CY>
</Size>
</TextureInfo>
So i'm going to use that to my advantage, hahaha.