View Single Post
Old 02-17-2007, 07:32 AM   #42
shillingworth
A Predatory Creeper
 
Join Date: Dec 2002
Server: Bertoxxulous
Posts: 251
Interface Author - Click to view interfaces
Default

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.
__________________

"Computers are like Air Conditioners, they stop working properly when you open Windows."
shillingworth is offline   Reply With Quote