public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _offsetPosition = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "offsetPosition", out exists); _offsetPosition.OnElementChanged += offsetPosition_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("offsetPosition", exists); } else { SetPropertyExistsInBaseData("offsetPosition", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "offsetPosition")); } SetPropertyExists("offsetPosition", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _projectileID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "projectileID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileID", exists); } else { SetPropertyExistsInBaseData("projectileID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(projectileID, "projectileID")); } SetPropertyExists("projectileID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _projectileType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "projectileType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileType", exists); } else { SetPropertyExistsInBaseData("projectileType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileType")); } SetPropertyExists("projectileType", exists); _projectileParticleName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "projectileParticleName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileParticleName", exists); } else { SetPropertyExistsInBaseData("projectileParticleName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileParticleName")); } SetPropertyExists("projectileParticleName", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _explosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionID", exists); } else { SetPropertyExistsInBaseData("explosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionID")); } SetPropertyExists("explosionID", exists); _projectileExpireExplosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "projectileExpireExplosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileExpireExplosionID", exists); } else { SetPropertyExistsInBaseData("projectileExpireExplosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileExpireExplosionID")); } SetPropertyExists("projectileExpireExplosionID", exists); _areaOfEffectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "areaOfEffectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("areaOfEffectID", exists); } else { SetPropertyExistsInBaseData("areaOfEffectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "areaOfEffectID")); } SetPropertyExists("areaOfEffectID", exists); _instantKillShipClass = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "instantKillShipClass", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("instantKillShipClass", exists); } else { SetPropertyExistsInBaseData("instantKillShipClass", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "instantKillShipClass")); } SetPropertyExists("instantKillShipClass", exists); _materialNameHead = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "materialNameHead", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("materialNameHead", exists); } else { SetPropertyExistsInBaseData("materialNameHead", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "materialNameHead")); } SetPropertyExists("materialNameHead", exists); _materialNameTail = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "materialNameTail", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("materialNameTail", exists); } else { SetPropertyExistsInBaseData("materialNameTail", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "materialNameTail")); } SetPropertyExists("materialNameTail", exists); _ribbonID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "ribbonID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("ribbonID", exists); } else { SetPropertyExistsInBaseData("ribbonID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "ribbonID")); } SetPropertyExists("ribbonID", exists); _dPExpire = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "dPExpire", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("dPExpire", exists); } else { SetPropertyExistsInBaseData("dPExpire", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "dPExpire")); } SetPropertyExists("dPExpire", exists); _damageOverTime = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "damageOverTime", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damageOverTime", exists); } else { SetPropertyExistsInBaseData("damageOverTime", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damageOverTime")); } SetPropertyExists("damageOverTime", exists); _damageOverTimeMax = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "damageOverTimeMax", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damageOverTimeMax", exists); } else { SetPropertyExistsInBaseData("damageOverTimeMax", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damageOverTimeMax")); } SetPropertyExists("damageOverTimeMax", exists); _duration = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "duration", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("duration", exists); } else { SetPropertyExistsInBaseData("duration", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "duration")); } SetPropertyExists("duration", exists); _maxDuration = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "maxDuration", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("maxDuration", exists); } else { SetPropertyExistsInBaseData("maxDuration", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "maxDuration")); } SetPropertyExists("maxDuration", exists); _projectileHeadSize = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "projectileHeadSize", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileHeadSize", exists); } else { SetPropertyExistsInBaseData("projectileHeadSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileHeadSize")); } SetPropertyExists("projectileHeadSize", exists); _projectileTailSize = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "projectileTailSize", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileTailSize", exists); } else { SetPropertyExistsInBaseData("projectileTailSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileTailSize")); } SetPropertyExists("projectileTailSize", exists); _projectileVelocity = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "projectileVelocity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileVelocity", exists); } else { SetPropertyExistsInBaseData("projectileVelocity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileVelocity")); } SetPropertyExists("projectileVelocity", exists); _initialLife = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialLife", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialLife", exists); } else { SetPropertyExistsInBaseData("initialLife", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialLife")); } SetPropertyExists("initialLife", exists); _damage = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "damage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damage", exists); } else { SetPropertyExistsInBaseData("damage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damage")); } SetPropertyExists("damage", exists); _weaponPush = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "weaponPush", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("weaponPush", exists); } else { SetPropertyExistsInBaseData("weaponPush", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "weaponPush")); } SetPropertyExists("weaponPush", exists); _range = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "range", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("range", exists); } else { SetPropertyExistsInBaseData("range", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "range")); } SetPropertyExists("range", exists); _bShowProjectileExpire = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bShowProjectileExpire", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bShowProjectileExpire", exists); } else { SetPropertyExistsInBaseData("bShowProjectileExpire", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bShowProjectileExpire")); } SetPropertyExists("bShowProjectileExpire", exists); _bPersistsOnHit = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bPersistsOnHit", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bPersistsOnHit", exists); } else { SetPropertyExistsInBaseData("bPersistsOnHit", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bPersistsOnHit")); } SetPropertyExists("bPersistsOnHit", exists); _bAntiCapital = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bAntiCapital", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bAntiCapital", exists); } else { SetPropertyExistsInBaseData("bAntiCapital", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bAntiCapital")); } SetPropertyExists("bAntiCapital", exists); _bCrewKiller = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bCrewKiller", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bCrewKiller", exists); } else { SetPropertyExistsInBaseData("bCrewKiller", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bCrewKiller")); } SetPropertyExists("bCrewKiller", exists); _bIgnoresShields = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bIgnoresShields", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bIgnoresShields", exists); } else { SetPropertyExistsInBaseData("bIgnoresShields", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bIgnoresShields")); } SetPropertyExists("bIgnoresShields", exists); _bMining = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bMining", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bMining", exists); } else { SetPropertyExistsInBaseData("bMining", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bMining")); } SetPropertyExists("bMining", exists); _projectileSize = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "projectileSize", out exists); _projectileSize.OnElementChanged += projectileSize_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("projectileSize", exists); } else { SetPropertyExistsInBaseData("projectileSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "projectileSize")); } SetPropertyExists("projectileSize", exists); _canister = DataStructureParseHelpers.GetcanisterDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("canister", exists); } else { SetPropertyExistsInBaseData("canister", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "canister")); } SetPropertyExists("canister", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _effectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "effectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("effectType", exists); } else { SetPropertyExistsInBaseData("effectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "effectType")); } SetPropertyExists("effectType", exists); _particleSystemName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "particleSystemName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("particleSystemName", exists); } else { SetPropertyExistsInBaseData("particleSystemName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "particleSystemName")); } SetPropertyExists("particleSystemName", exists); _explosionSoundID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionSoundID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionSoundID", exists); } else { SetPropertyExistsInBaseData("explosionSoundID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionSoundID")); } SetPropertyExists("explosionSoundID", exists); _explosionType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionType", exists); } else { SetPropertyExistsInBaseData("explosionType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionType")); } SetPropertyExists("explosionType", exists); _renderingDistance = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "renderingDistance", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("renderingDistance", exists); } else { SetPropertyExistsInBaseData("renderingDistance", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "renderingDistance")); } SetPropertyExists("renderingDistance", exists); _shakeDistance = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "shakeDistance", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("shakeDistance", exists); } else { SetPropertyExistsInBaseData("shakeDistance", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "shakeDistance")); } SetPropertyExists("shakeDistance", exists); _pushForce = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "pushForce", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("pushForce", exists); } else { SetPropertyExistsInBaseData("pushForce", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "pushForce")); } SetPropertyExists("pushForce", exists); _damage = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "damage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damage", exists); } else { SetPropertyExistsInBaseData("damage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damage")); } SetPropertyExists("damage", exists); _maxSounds = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "maxSounds", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("maxSounds", exists); } else { SetPropertyExistsInBaseData("maxSounds", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "maxSounds")); } SetPropertyExists("maxSounds", exists); _life = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "life", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("life", exists); } else { SetPropertyExistsInBaseData("life", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "life")); } SetPropertyExists("life", exists); _angularForce = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "angularForce", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("angularForce", exists); } else { SetPropertyExistsInBaseData("angularForce", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "angularForce")); } SetPropertyExists("angularForce", exists); _bCausesShake = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bCausesShake", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bCausesShake", exists); } else { SetPropertyExistsInBaseData("bCausesShake", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bCausesShake")); } SetPropertyExists("bCausesShake", exists); _impactSize = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "impactSize", out exists); _impactSize.OnElementChanged += impactSize_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("impactSize", exists); } else { SetPropertyExistsInBaseData("impactSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "impactSize")); } SetPropertyExists("impactSize", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _name = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "name", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("name", exists); } else { SetPropertyExistsInBaseData("name", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "name")); } SetPropertyExists("name", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _doorSoundID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "doorSoundID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("doorSoundID", exists); } else { SetPropertyExistsInBaseData("doorSoundID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "doorSoundID")); } SetPropertyExists("doorSoundID", exists); _openTimeMultiplier = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "openTimeMultiplier", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("openTimeMultiplier", exists); } else { SetPropertyExistsInBaseData("openTimeMultiplier", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "openTimeMultiplier")); } SetPropertyExists("openTimeMultiplier", exists); _bPhysicalDoor = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bPhysicalDoor", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bPhysicalDoor", exists); } else { SetPropertyExistsInBaseData("bPhysicalDoor", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bPhysicalDoor")); } SetPropertyExists("bPhysicalDoor", exists); _bOpenOnProximity = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bOpenOnProximity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bOpenOnProximity", exists); } else { SetPropertyExistsInBaseData("bOpenOnProximity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bOpenOnProximity")); } SetPropertyExists("bOpenOnProximity", exists); _translateMax = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "translateMax", out exists); _translateMax.OnElementChanged += translateMax_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("translateMax", exists); } else { SetPropertyExistsInBaseData("translateMax", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "translateMax")); } SetPropertyExists("translateMax", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _particleSystemName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "particleSystemName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("particleSystemName", exists); } else { SetPropertyExistsInBaseData("particleSystemName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "particleSystemName")); } SetPropertyExists("particleSystemName", exists); _affectedObjects = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "affectedObjects", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("affectedObjects", exists); } else { SetPropertyExistsInBaseData("affectedObjects", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "affectedObjects")); } SetPropertyExists("affectedObjects", exists); _damage = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "damage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damage", exists); } else { SetPropertyExistsInBaseData("damage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damage")); } SetPropertyExists("damage", exists); _lifeTimer = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "lifeTimer", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("lifeTimer", exists); } else { SetPropertyExistsInBaseData("lifeTimer", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "lifeTimer")); } SetPropertyExists("lifeTimer", exists); _bRefuel = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bRefuel", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bRefuel", exists); } else { SetPropertyExistsInBaseData("bRefuel", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bRefuel")); } SetPropertyExists("bRefuel", exists); _bDebrisFieldRadiation = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bDebrisFieldRadiation", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bDebrisFieldRadiation", exists); } else { SetPropertyExistsInBaseData("bDebrisFieldRadiation", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bDebrisFieldRadiation")); } SetPropertyExists("bDebrisFieldRadiation", exists); _fieldSize = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "fieldSize", out exists); _fieldSize.OnElementChanged += fieldSize_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("fieldSize", exists); } else { SetPropertyExistsInBaseData("fieldSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "fieldSize")); } SetPropertyExists("fieldSize", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _name = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "name", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("name", exists); } else { SetPropertyExistsInBaseData("name", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "name")); } SetPropertyExists("name", exists); _missileType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "missileType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("missileType", exists); } else { SetPropertyExistsInBaseData("missileType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileType")); } SetPropertyExists("missileType", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _ribbonID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "ribbonID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("ribbonID", exists); } else { SetPropertyExistsInBaseData("ribbonID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "ribbonID")); } SetPropertyExists("ribbonID", exists); _trailParticleName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "trailParticleName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("trailParticleName", exists); } else { SetPropertyExistsInBaseData("trailParticleName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "trailParticleName")); } SetPropertyExists("trailParticleName", exists); _explosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionID", exists); } else { SetPropertyExistsInBaseData("explosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionID")); } SetPropertyExists("explosionID", exists); _missileParticleName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "missileParticleName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("missileParticleName", exists); } else { SetPropertyExistsInBaseData("missileParticleName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileParticleName")); } SetPropertyExists("missileParticleName", exists); _cruiseSpeed = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "cruiseSpeed", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("cruiseSpeed", exists); } else { SetPropertyExistsInBaseData("cruiseSpeed", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "cruiseSpeed")); } SetPropertyExists("cruiseSpeed", exists); _timeTillCruise = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "timeTillCruise", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("timeTillCruise", exists); } else { SetPropertyExistsInBaseData("timeTillCruise", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "timeTillCruise")); } SetPropertyExists("timeTillCruise", exists); _initialVelocity = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialVelocity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialVelocity", exists); } else { SetPropertyExistsInBaseData("initialVelocity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialVelocity")); } SetPropertyExists("initialVelocity", exists); _initialLife = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialLife", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialLife", exists); } else { SetPropertyExistsInBaseData("initialLife", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialLife")); } SetPropertyExists("initialLife", exists); _timeTillActive = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "timeTillActive", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("timeTillActive", exists); } else { SetPropertyExistsInBaseData("timeTillActive", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "timeTillActive")); } SetPropertyExists("timeTillActive", exists); _damage = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "damage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damage", exists); } else { SetPropertyExistsInBaseData("damage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damage")); } SetPropertyExists("damage", exists); _health = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "health", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("health", exists); } else { SetPropertyExistsInBaseData("health", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "health")); } SetPropertyExists("health", exists); _yaw = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "yaw", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("yaw", exists); } else { SetPropertyExistsInBaseData("yaw", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "yaw")); } SetPropertyExists("yaw", exists); _pitch = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "pitch", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("pitch", exists); } else { SetPropertyExistsInBaseData("pitch", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "pitch")); } SetPropertyExists("pitch", exists); _roll = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "roll", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("roll", exists); } else { SetPropertyExistsInBaseData("roll", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "roll")); } SetPropertyExists("roll", exists); _bAntiCapital = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bAntiCapital", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bAntiCapital", exists); } else { SetPropertyExistsInBaseData("bAntiCapital", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bAntiCapital")); } SetPropertyExists("bAntiCapital", exists); _bSelfTarget = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bSelfTarget", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bSelfTarget", exists); } else { SetPropertyExistsInBaseData("bSelfTarget", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bSelfTarget")); } SetPropertyExists("bSelfTarget", exists); _bReAcquireTarget = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bReAcquireTarget", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bReAcquireTarget", exists); } else { SetPropertyExistsInBaseData("bReAcquireTarget", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bReAcquireTarget")); } SetPropertyExists("bReAcquireTarget", exists); _missileSize = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "missileSize", out exists); _missileSize.OnElementChanged += missileSize_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("missileSize", exists); } else { SetPropertyExistsInBaseData("missileSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileSize")); } SetPropertyExists("missileSize", exists); _mirv = DataStructureParseHelpers.GetmirvDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("mirv", exists); } else { SetPropertyExistsInBaseData("mirv", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "mirv")); } SetPropertyExists("mirv", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _name = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "name", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("name", exists); } else { SetPropertyExistsInBaseData("name", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "name")); } SetPropertyExists("name", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _soundID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "soundID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("soundID", exists); } else { SetPropertyExistsInBaseData("soundID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "soundID")); } SetPropertyExists("soundID", exists); _proximityDistance = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "proximityDistance", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("proximityDistance", exists); } else { SetPropertyExistsInBaseData("proximityDistance", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "proximityDistance")); } SetPropertyExists("proximityDistance", exists); _moveAwayTimeDuration = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "moveAwayTimeDuration", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("moveAwayTimeDuration", exists); } else { SetPropertyExistsInBaseData("moveAwayTimeDuration", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "moveAwayTimeDuration")); } SetPropertyExists("moveAwayTimeDuration", exists); _bOpenOnProximity = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bOpenOnProximity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bOpenOnProximity", exists); } else { SetPropertyExistsInBaseData("bOpenOnProximity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bOpenOnProximity")); } SetPropertyExists("bOpenOnProximity", exists); _translateVector = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "translateVector", out exists); _translateVector.OnElementChanged += translateVector_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("translateVector", exists); } else { SetPropertyExistsInBaseData("translateVector", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "translateVector")); } SetPropertyExists("translateVector", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _name = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "name", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("name", exists); } else { SetPropertyExistsInBaseData("name", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "name")); } SetPropertyExists("name", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _wireframeMaterial = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "wireframeMaterial", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("wireframeMaterial", exists); } else { SetPropertyExistsInBaseData("wireframeMaterial", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "wireframeMaterial")); } SetPropertyExists("wireframeMaterial", exists); _tacticalExplosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "tacticalExplosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("tacticalExplosionID", exists); } else { SetPropertyExistsInBaseData("tacticalExplosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "tacticalExplosionID")); } SetPropertyExists("tacticalExplosionID", exists); _babyExplosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "babyExplosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("babyExplosionID", exists); } else { SetPropertyExistsInBaseData("babyExplosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "babyExplosionID")); } SetPropertyExists("babyExplosionID", exists); _explosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionID", exists); } else { SetPropertyExistsInBaseData("explosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionID")); } SetPropertyExists("explosionID", exists); _asteroidSize = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "asteroidSize", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("asteroidSize", exists); } else { SetPropertyExistsInBaseData("asteroidSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "asteroidSize")); } SetPropertyExists("asteroidSize", exists); _displayName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "displayName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("displayName", exists); } else { SetPropertyExistsInBaseData("displayName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "displayName")); } SetPropertyExists("displayName", exists); _asteroidType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "asteroidType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("asteroidType", exists); } else { SetPropertyExistsInBaseData("asteroidType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "asteroidType")); } SetPropertyExists("asteroidType", exists); _descriptionText = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "descriptionText", out exists)); _descriptionText.CollectionChanged += OndescriptionTextChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("descriptionText", exists); } else { SetPropertyExistsInBaseData("descriptionText", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "descriptionText")); } SetPropertyExists("descriptionText", exists); _collisionShape = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "collisionShape", out exists)); _collisionShape.CollectionChanged += OncollisionShapeChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("collisionShape", exists); } else { SetPropertyExistsInBaseData("collisionShape", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "collisionShape")); } SetPropertyExists("collisionShape", exists); _babySpawnDamage = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "babySpawnDamage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("babySpawnDamage", exists); } else { SetPropertyExistsInBaseData("babySpawnDamage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "babySpawnDamage")); } SetPropertyExists("babySpawnDamage", exists); _health = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "health", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("health", exists); } else { SetPropertyExistsInBaseData("health", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "health")); } SetPropertyExists("health", exists); _bShowInTactical = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bShowInTactical", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bShowInTactical", exists); } else { SetPropertyExistsInBaseData("bShowInTactical", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bShowInTactical")); } SetPropertyExists("bShowInTactical", exists); _isMassInfinite = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "isMassInfinite", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("isMassInfinite", exists); } else { SetPropertyExistsInBaseData("isMassInfinite", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "isMassInfinite")); } SetPropertyExists("isMassInfinite", exists); _bCanAddViaBattleEditorSlider = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bCanAddViaBattleEditorSlider", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bCanAddViaBattleEditorSlider", exists); } else { SetPropertyExistsInBaseData("bCanAddViaBattleEditorSlider", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bCanAddViaBattleEditorSlider")); } SetPropertyExists("bCanAddViaBattleEditorSlider", exists); _deathLinearVelocity = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "deathLinearVelocity", out exists); _deathLinearVelocity.OnElementChanged += deathLinearVelocity_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("deathLinearVelocity", exists); } else { SetPropertyExistsInBaseData("deathLinearVelocity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "deathLinearVelocity")); } SetPropertyExists("deathLinearVelocity", exists); _deathSpawn = DataStructureParseHelpers.GetdeathSpawnDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("deathSpawn", exists); } else { SetPropertyExistsInBaseData("deathSpawn", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "deathSpawn")); } SetPropertyExists("deathSpawn", exists); _baby = new ObservableCollection <VD2DataStructure>(DataStructureParseHelpers.GetbabyDataStructureListFromVD2Data(this, DataXMLDoc, out exists)); _baby.CollectionChanged += OnbabyChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("baby", exists); } else { SetPropertyExistsInBaseData("baby", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "baby")); } SetPropertyExists("baby", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _weaponID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "weaponID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("weaponID", exists); } else { SetPropertyExistsInBaseData("weaponID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(weaponID, "weaponID")); } SetPropertyExists("weaponID", exists); _weaponType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "weaponType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("weaponType", exists); } else { SetPropertyExistsInBaseData("weaponType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "weaponType")); } SetPropertyExists("weaponType", exists); _name = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "name", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("name", exists); } else { SetPropertyExistsInBaseData("name", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "name")); } SetPropertyExists("name", exists); _turretWeapon = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "turretWeapon", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("turretWeapon", exists); } else { SetPropertyExistsInBaseData("turretWeapon", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "turretWeapon")); } SetPropertyExists("turretWeapon", exists); _hardpointID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "hardpointID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("hardpointID", exists); } else { SetPropertyExistsInBaseData("hardpointID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "hardpointID")); } SetPropertyExists("hardpointID", exists); _linkedMovingElement = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "linkedMovingElement", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("linkedMovingElement", exists); } else { SetPropertyExistsInBaseData("linkedMovingElement", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "linkedMovingElement")); } SetPropertyExists("linkedMovingElement", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _turnSoundID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "turnSoundID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("turnSoundID", exists); } else { SetPropertyExistsInBaseData("turnSoundID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "turnSoundID")); } SetPropertyExists("turnSoundID", exists); _mineQuota = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "mineQuota", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("mineQuota", exists); } else { SetPropertyExistsInBaseData("mineQuota", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "mineQuota")); } SetPropertyExists("mineQuota", exists); _barrelDelay = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "barrelDelay", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("barrelDelay", exists); } else { SetPropertyExistsInBaseData("barrelDelay", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "barrelDelay")); } SetPropertyExists("barrelDelay", exists); _pitchMax = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "pitchMax", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("pitchMax", exists); } else { SetPropertyExistsInBaseData("pitchMax", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "pitchMax")); } SetPropertyExists("pitchMax", exists); _dMoveSpeed = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "dMoveSpeed", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("dMoveSpeed", exists); } else { SetPropertyExistsInBaseData("dMoveSpeed", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "dMoveSpeed")); } SetPropertyExists("dMoveSpeed", exists); _bAlwaysShowInTactical = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bAlwaysShowInTactical", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bAlwaysShowInTactical", exists); } else { SetPropertyExistsInBaseData("bAlwaysShowInTactical", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bAlwaysShowInTactical")); } SetPropertyExists("bAlwaysShowInTactical", exists); _bPhysicalBody = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bPhysicalBody", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bPhysicalBody", exists); } else { SetPropertyExistsInBaseData("bPhysicalBody", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bPhysicalBody")); } SetPropertyExists("bPhysicalBody", exists); _bInvisibleTurret = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bInvisibleTurret", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bInvisibleTurret", exists); } else { SetPropertyExistsInBaseData("bInvisibleTurret", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bInvisibleTurret")); } SetPropertyExists("bInvisibleTurret", exists); _bOssilateTargetAimNodeOffset = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bOssilateTargetAimNodeOffset", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bOssilateTargetAimNodeOffset", exists); } else { SetPropertyExistsInBaseData("bOssilateTargetAimNodeOffset", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bOssilateTargetAimNodeOffset")); } SetPropertyExists("bOssilateTargetAimNodeOffset", exists); _turretViewPos = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "turretViewPos", out exists); _turretViewPos.OnElementChanged += turretViewPos_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("turretViewPos", exists); } else { SetPropertyExistsInBaseData("turretViewPos", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "turretViewPos")); } SetPropertyExists("turretViewPos", exists); _weaponDirection = DataStructureParseHelpers.GetweaponDirectionDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("weaponDirection", exists); } else { SetPropertyExistsInBaseData("weaponDirection", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "weaponDirection")); } SetPropertyExists("weaponDirection", exists); _targetPriorityList = DataStructureParseHelpers.GettargetPriorityListDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("targetPriorityList", exists); } else { SetPropertyExistsInBaseData("targetPriorityList", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "targetPriorityList")); } SetPropertyExists("targetPriorityList", exists); _turretBarrel = new ObservableCollection <VD2DataStructure>(DataStructureParseHelpers.GetturretBarrelDataStructureListFromVD2Data(this, DataXMLDoc, out exists)); _turretBarrel.CollectionChanged += OnturretBarrelChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("turretBarrel", exists); } else { SetPropertyExistsInBaseData("turretBarrel", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "turretBarrel")); } SetPropertyExists("turretBarrel", exists); base.LoadDataFromXML(); } }