protected override void SaveData() { List <string> xmltextlines = new List <string>(); xmltextlines.Add("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmltextlines.Add("<note_to_self attr1=\"Generated by Void Destroyer 2 Data Editor\"/>"); xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Strings...\"/>"); xmltextlines.Add(""); if (PropertyExists("objectType")) { xmltextlines.Add("<objectType attr1=\"" + _objectType + "\"/>"); } if (PropertyExists("objectID")) { xmltextlines.Add("<objectID attr1=\"" + _objectID + "\"/>"); } if (PropertyExists("name")) { xmltextlines.Add("<name attr1=\"" + _name + "\"/>"); } if (PropertyExists("missileType")) { xmltextlines.Add("<missileType attr1=\"" + _missileType + "\"/>"); } if (PropertyExists("meshName")) { xmltextlines.Add("<meshName attr1=\"" + _meshName + "\"/>"); } if (PropertyExists("ribbonID")) { xmltextlines.Add("<ribbonID attr1=\"" + _ribbonID + "\"/>"); } if (PropertyExists("trailParticleName")) { xmltextlines.Add("<trailParticleName attr1=\"" + _trailParticleName + "\"/>"); } if (PropertyExists("explosionID")) { xmltextlines.Add("<explosionID attr1=\"" + _explosionID + "\"/>"); } if (PropertyExists("missileParticleName")) { xmltextlines.Add("<missileParticleName attr1=\"" + _missileParticleName + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Floats...\"/>"); xmltextlines.Add(""); if (PropertyExists("cruiseSpeed")) { xmltextlines.Add("<cruiseSpeed attr1=\"" + _cruiseSpeed.ToString() + "\"/>"); } if (PropertyExists("timeTillCruise")) { xmltextlines.Add("<timeTillCruise attr1=\"" + _timeTillCruise.ToString() + "\"/>"); } if (PropertyExists("initialVelocity")) { xmltextlines.Add("<initialVelocity attr1=\"" + _initialVelocity.ToString() + "\"/>"); } if (PropertyExists("initialLife")) { xmltextlines.Add("<initialLife attr1=\"" + _initialLife.ToString() + "\"/>"); } if (PropertyExists("timeTillActive")) { xmltextlines.Add("<timeTillActive attr1=\"" + _timeTillActive.ToString() + "\"/>"); } if (PropertyExists("damage")) { xmltextlines.Add("<damage attr1=\"" + _damage.ToString() + "\"/>"); } if (PropertyExists("health")) { xmltextlines.Add("<health attr1=\"" + _health.ToString() + "\"/>"); } if (PropertyExists("yaw")) { xmltextlines.Add("<yaw attr1=\"" + _yaw.ToString() + "\"/>"); } if (PropertyExists("pitch")) { xmltextlines.Add("<pitch attr1=\"" + _pitch.ToString() + "\"/>"); } if (PropertyExists("roll")) { xmltextlines.Add("<roll attr1=\"" + _roll.ToString() + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Booleans...\"/>"); xmltextlines.Add(""); if (PropertyExists("bAntiCapital")) { xmltextlines.Add("<bAntiCapital attr1=\"" + ((_bAntiCapital) ? "1" : "0") + "\"/>"); } if (PropertyExists("bSelfTarget")) { xmltextlines.Add("<bSelfTarget attr1=\"" + ((_bSelfTarget) ? "1" : "0") + "\"/>"); } if (PropertyExists("bReAcquireTarget")) { xmltextlines.Add("<bReAcquireTarget attr1=\"" + ((_bReAcquireTarget) ? "1" : "0") + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"3D Vectors...\"/>"); xmltextlines.Add(""); if (PropertyExists("missileSize")) { xmltextlines.Add("<missileSize x=\"" + _missileSize.x.ToString() + "\" y=\"" + _missileSize.y.ToString() + "\" z=\"" + _missileSize.z.ToString() + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Data Structures...\"/>"); xmltextlines.Add(""); if (PropertyExists("mirv")) { xmltextlines.AddRange(_mirv.AsVD2XML()); xmltextlines.Add(""); } SafeWriteAllLines(_FilePath, xmltextlines); }
protected override void SaveData() { List <string> xmltextlines = new List <string>(); xmltextlines.Add("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmltextlines.Add("<note_to_self attr1=\"Generated by Void Destroyer 2 Data Editor\"/>"); xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Strings...\"/>"); xmltextlines.Add(""); if (PropertyExists("objectType")) { xmltextlines.Add("<objectType attr1=\"" + _objectType + "\"/>"); } if (PropertyExists("mineType")) { xmltextlines.Add("<mineType attr1=\"" + _mineType + "\"/>"); } if (PropertyExists("objectID")) { xmltextlines.Add("<objectID attr1=\"" + _objectID + "\"/>"); } if (PropertyExists("meshName")) { xmltextlines.Add("<meshName attr1=\"" + _meshName + "\"/>"); } if (PropertyExists("explosionID")) { xmltextlines.Add("<explosionID attr1=\"" + _explosionID + "\"/>"); } if (PropertyExists("minimumShipClass")) { xmltextlines.Add("<minimumShipClass attr1=\"" + _minimumShipClass + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Integers...\"/>"); xmltextlines.Add(""); if (PropertyExists("detectionProximity")) { xmltextlines.Add("<detectionProximity attr1=\"" + _detectionProximity.ToString() + "\"/>"); } if (PropertyExists("weaponPush")) { xmltextlines.Add("<weaponPush attr1=\"" + _weaponPush.ToString() + "\"/>"); } if (PropertyExists("renderingDistance")) { xmltextlines.Add("<renderingDistance attr1=\"" + _renderingDistance.ToString() + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Floats...\"/>"); xmltextlines.Add(""); if (PropertyExists("cruiseSpeed")) { xmltextlines.Add("<cruiseSpeed attr1=\"" + _cruiseSpeed.ToString() + "\"/>"); } if (PropertyExists("timeTillCruise")) { xmltextlines.Add("<timeTillCruise attr1=\"" + _timeTillCruise.ToString() + "\"/>"); } if (PropertyExists("initialVelocity")) { xmltextlines.Add("<initialVelocity attr1=\"" + _initialVelocity.ToString() + "\"/>"); } if (PropertyExists("initialLife")) { xmltextlines.Add("<initialLife attr1=\"" + _initialLife.ToString() + "\"/>"); } if (PropertyExists("timeTillActive")) { xmltextlines.Add("<timeTillActive attr1=\"" + _timeTillActive.ToString() + "\"/>"); } if (PropertyExists("damage")) { xmltextlines.Add("<damage attr1=\"" + _damage.ToString() + "\"/>"); } if (PropertyExists("health")) { xmltextlines.Add("<health attr1=\"" + _health.ToString() + "\"/>"); } if (PropertyExists("yaw")) { xmltextlines.Add("<yaw attr1=\"" + _yaw.ToString() + "\"/>"); } if (PropertyExists("pitch")) { xmltextlines.Add("<pitch attr1=\"" + _pitch.ToString() + "\"/>"); } if (PropertyExists("roll")) { xmltextlines.Add("<roll attr1=\"" + _roll.ToString() + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Booleans...\"/>"); xmltextlines.Add(""); if (PropertyExists("bUseParentTarget")) { xmltextlines.Add("<bUseParentTarget attr1=\"" + ((_bUseParentTarget) ? "1" : "0") + "\"/>"); } if (PropertyExists("bSpinner")) { xmltextlines.Add("<bSpinner attr1=\"" + ((_bSpinner) ? "1" : "0") + "\"/>"); } if (PropertyExists("bKeepTarget")) { xmltextlines.Add("<bKeepTarget attr1=\"" + ((_bKeepTarget) ? "1" : "0") + "\"/>"); } if (PropertyExists("bCheckFriendOrFoe")) { xmltextlines.Add("<bCheckFriendOrFoe attr1=\"" + ((_bCheckFriendOrFoe) ? "1" : "0") + "\"/>"); } if (PropertyExists("bCanAddViaBattleEditorSlider")) { xmltextlines.Add("<bCanAddViaBattleEditorSlider attr1=\"" + ((_bCanAddViaBattleEditorSlider) ? "1" : "0") + "\"/>"); } if (PropertyExists("bIgnoresShields")) { xmltextlines.Add("<bIgnoresShields attr1=\"" + ((_bIgnoresShields) ? "1" : "0") + "\"/>"); } if (PropertyExists("bHeatMine")) { xmltextlines.Add("<bHeatMine attr1=\"" + ((_bHeatMine) ? "1" : "0") + "\"/>"); } xmltextlines.Add(""); xmltextlines.Add("<note_to_self attr1=\"Data Structures...\"/>"); xmltextlines.Add(""); if (PropertyExists("mirv")) { xmltextlines.AddRange(_mirv.AsVD2XML()); xmltextlines.Add(""); } SafeWriteAllLines(_FilePath, xmltextlines); }