If there are no target scene or portal names, don't write them out. Also

fixed naming of <portal> element.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@751 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-12-07 05:11:25 +00:00
parent 548acf53e8
commit 7831d150e5
@@ -1,5 +1,5 @@
// //
// $Id: SpotSceneWriter.java,v 1.4 2001/12/05 08:45:06 mdb Exp $ // $Id: SpotSceneWriter.java,v 1.5 2001/12/07 05:11:25 mdb Exp $
package com.threerings.whirled.tools.spot.xml; package com.threerings.whirled.tools.spot.xml;
@@ -14,6 +14,7 @@ import com.samskivert.util.StringUtil;
import com.threerings.whirled.spot.data.Location; import com.threerings.whirled.spot.data.Location;
import com.threerings.whirled.spot.data.Portal; import com.threerings.whirled.spot.data.Portal;
import com.threerings.whirled.Log;
import com.threerings.whirled.tools.EditableScene; import com.threerings.whirled.tools.EditableScene;
import com.threerings.whirled.tools.spot.EditablePortal; import com.threerings.whirled.tools.spot.EditablePortal;
import com.threerings.whirled.tools.spot.EditableSpotScene; import com.threerings.whirled.tools.spot.EditableSpotScene;
@@ -64,11 +65,15 @@ public class SpotSceneWriter extends SceneWriter
EditablePortal port = (EditablePortal)iter.next(); EditablePortal port = (EditablePortal)iter.next();
AttributesImpl attrs = new AttributesImpl(); AttributesImpl attrs = new AttributesImpl();
addSharedAttrs(attrs, port); addSharedAttrs(attrs, port);
attrs.addAttribute("", "targetSceneName", "", "", if (port.targetSceneName != null) {
port.targetSceneName); attrs.addAttribute("", "targetSceneName", "", "",
attrs.addAttribute("", "targetPortalName", "", "", port.targetSceneName);
port.targetPortalName); }
writer.emptyElement("", "location", "", attrs); if (port.targetPortalName != null) {
attrs.addAttribute("", "targetPortalName", "", "",
port.targetPortalName);
}
writer.emptyElement("", "portal", "", attrs);
} }
} }