Ejemplo n.º 1
0
 private void OnsoundFileChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (Source != null)
     {
         if (Source.WriteAccess)
         {
             SetPropertyEdited("soundFile", true);
         }
         else
         {
             bool exists = false;
             _soundFile = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "soundFile", out exists));
             _soundFile.CollectionChanged += OnsoundFileChanged;
             if (Source.ShortName == "Base")
             {
                 SetPropertyExistsInBaseData("soundFile", exists);
             }
             else
             {
                 SetPropertyExistsInBaseData("soundFile", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "soundFile"));
             }
             SetPropertyExists("soundFile", exists);
         }
     }
 }
Ejemplo n.º 2
0
        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);

                _materialName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "materialName", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("materialName", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("materialName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "materialName"));
                }
                SetPropertyExists("materialName", exists);

                _factionType = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "factionType", out exists));
                _factionType.CollectionChanged += OnfactionTypeChanged;
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("factionType", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("factionType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "factionType"));
                }
                SetPropertyExists("factionType", exists);

                _bGeneric = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bGeneric", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bGeneric", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bGeneric", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bGeneric"));
                }
                SetPropertyExists("bGeneric", exists);

                base.LoadDataFromXML();
            }
        }
Ejemplo n.º 3
0
        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);
                _soundType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "soundType", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("soundType", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("soundType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "soundType"));
                }
                SetPropertyExists("soundType", exists);
                _tailSound = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "tailSound", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("tailSound", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("tailSound", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "tailSound"));
                }
                SetPropertyExists("tailSound", exists);
                _startSound = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "startSound", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("startSound", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("startSound", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "startSound"));
                }
                SetPropertyExists("startSound", exists);
                _startSoundFile = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "startSoundFile", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("startSoundFile", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("startSoundFile", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "startSoundFile"));
                }
                SetPropertyExists("startSoundFile", exists);
                _soundEngineSoundType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "soundEngineSoundType", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("soundEngineSoundType", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("soundEngineSoundType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "soundEngineSoundType"));
                }
                SetPropertyExists("soundEngineSoundType", exists);

                _soundFile = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "soundFile", out exists));
                _soundFile.CollectionChanged += OnsoundFileChanged;
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("soundFile", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("soundFile", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "soundFile"));
                }
                SetPropertyExists("soundFile", exists);

                _maxDistance = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "maxDistance", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("maxDistance", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("maxDistance", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "maxDistance"));
                }
                SetPropertyExists("maxDistance", exists);
                _referenceDistance = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "referenceDistance", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("referenceDistance", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("referenceDistance", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "referenceDistance"));
                }
                SetPropertyExists("referenceDistance", 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);

                _soundPriority = new ObservableCollection <int>(ParseHelpers.GetInt32ListFromVD2Data(DataXMLDoc, "soundPriority", out exists));
                _soundPriority.CollectionChanged += OnsoundPriorityChanged;
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("soundPriority", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("soundPriority", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "soundPriority"));
                }
                SetPropertyExists("soundPriority", exists);

                _defaultVolume = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "defaultVolume", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("defaultVolume", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("defaultVolume", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "defaultVolume"));
                }
                SetPropertyExists("defaultVolume", exists);

                _bDisable3d = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bDisable3d", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bDisable3d", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bDisable3d", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bDisable3d"));
                }
                SetPropertyExists("bDisable3d", exists);

                base.LoadDataFromXML();
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
        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);

                _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);
                _upgradeCategory = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "upgradeCategory", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("upgradeCategory", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("upgradeCategory", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "upgradeCategory"));
                }
                SetPropertyExists("upgradeCategory", exists);
                _upgradeType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "upgradeType", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("upgradeType", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("upgradeType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "upgradeType"));
                }
                SetPropertyExists("upgradeType", exists);
                _shipActiveUpgradeType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "shipActiveUpgradeType", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("shipActiveUpgradeType", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("shipActiveUpgradeType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "shipActiveUpgradeType"));
                }
                SetPropertyExists("shipActiveUpgradeType", exists);
                _imageSet = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "imageSet", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("imageSet", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("imageSet", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "imageSet"));
                }
                SetPropertyExists("imageSet", exists);
                _image = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "image", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("image", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("image", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "image"));
                }
                SetPropertyExists("image", 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);
                _shieldObjectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "shieldObjectID", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("shieldObjectID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("shieldObjectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "shieldObjectID"));
                }
                SetPropertyExists("shieldObjectID", exists);
                _activeSoundID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "activeSoundID", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("activeSoundID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("activeSoundID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "activeSoundID"));
                }
                SetPropertyExists("activeSoundID", exists);
                _missileID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "missileID", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("missileID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("missileID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileID"));
                }
                SetPropertyExists("missileID", exists);
                _platformObjectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "platformObjectID", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("platformObjectID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("platformObjectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "platformObjectID"));
                }
                SetPropertyExists("platformObjectID", exists);
                _shipID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "shipID", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("shipID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("shipID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "shipID"));
                }
                SetPropertyExists("shipID", exists);

                _description = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "description", out exists));
                _description.CollectionChanged += OndescriptionChanged;
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("description", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("description", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "description"));
                }
                SetPropertyExists("description", exists);

                _cost = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "cost", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("cost", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("cost", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "cost"));
                }
                SetPropertyExists("cost", exists);
                _rechargeTime = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "rechargeTime", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("rechargeTime", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("rechargeTime", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "rechargeTime"));
                }
                SetPropertyExists("rechargeTime", exists);

                _addCostAsPercentOfShip = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "addCostAsPercentOfShip", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("addCostAsPercentOfShip", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("addCostAsPercentOfShip", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "addCostAsPercentOfShip"));
                }
                SetPropertyExists("addCostAsPercentOfShip", exists);
                _durationTime = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "durationTime", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("durationTime", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("durationTime", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "durationTime"));
                }
                SetPropertyExists("durationTime", exists);
                _healthShieldRechargePercent = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "healthShieldRechargePercent", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("healthShieldRechargePercent", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("healthShieldRechargePercent", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "healthShieldRechargePercent"));
                }
                SetPropertyExists("healthShieldRechargePercent", exists);
                _maneuveringMultiplier = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "maneuveringMultiplier", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("maneuveringMultiplier", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("maneuveringMultiplier", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "maneuveringMultiplier"));
                }
                SetPropertyExists("maneuveringMultiplier", exists);

                _bIllegalUpgrade = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bIllegalUpgrade", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bIllegalUpgrade", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bIllegalUpgrade", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bIllegalUpgrade"));
                }
                SetPropertyExists("bIllegalUpgrade", exists);
                _bOneAtATimeUpgrade = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bOneAtATimeUpgrade", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bOneAtATimeUpgrade", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bOneAtATimeUpgrade", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bOneAtATimeUpgrade"));
                }
                SetPropertyExists("bOneAtATimeUpgrade", exists);
                _bAlwaysAvailableUpgrade = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bAlwaysAvailableUpgrade", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bAlwaysAvailableUpgrade", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bAlwaysAvailableUpgrade", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bAlwaysAvailableUpgrade"));
                }
                SetPropertyExists("bAlwaysAvailableUpgrade", exists);

                base.LoadDataFromXML();
            }
        }
Ejemplo n.º 6
0
        public override void LoadDataFromXML()
        {
            bool exists = false;

            if (DataXMLDoc != null)
            {
                _characterID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "characterID", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("characterID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("characterID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(characterID, "characterID"));
                }
                SetPropertyExists("characterID", 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);
                _imageSetName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "imageSetName", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("imageSetName", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("imageSetName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "imageSetName"));
                }
                SetPropertyExists("imageSetName", exists);
                _textColor = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "textColor", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("textColor", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("textColor", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "textColor"));
                }
                SetPropertyExists("textColor", exists);
                _title = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "title", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("title", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("title", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "title"));
                }
                SetPropertyExists("title", exists);
                _physicalObjectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "physicalObjectType", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("physicalObjectType", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("physicalObjectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "physicalObjectType"));
                }
                SetPropertyExists("physicalObjectType", exists);

                _factionID = new ObservableCollection <string>(ParseHelpers.GetStringListFromVD2Data(DataXMLDoc, "factionID", out exists));
                _factionID.CollectionChanged += OnfactionIDChanged;
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("factionID", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("factionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "factionID"));
                }
                SetPropertyExists("factionID", exists);

                _bGeneric = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bGeneric", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bGeneric", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bGeneric", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bGeneric"));
                }
                SetPropertyExists("bGeneric", exists);

                base.LoadDataFromXML();
            }
        }
Ejemplo n.º 7
0
        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);
                _faction = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "faction", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("faction", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("faction", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "faction"));
                }
                SetPropertyExists("faction", 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);
                _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);
                _collisionShape = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "collisionShape", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("collisionShape", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("collisionShape", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "collisionShape"));
                }
                SetPropertyExists("collisionShape", exists);
                _gateInParticleSystem = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "gateInParticleSystem", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("gateInParticleSystem", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("gateInParticleSystem", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "gateInParticleSystem"));
                }
                SetPropertyExists("gateInParticleSystem", exists);
                _gateOutParticleSystem = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "gateOutParticleSystem", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("gateOutParticleSystem", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("gateOutParticleSystem", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "gateOutParticleSystem"));
                }
                SetPropertyExists("gateOutParticleSystem", 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);

                _rockSubPosition = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "rockSubPosition", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("rockSubPosition", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("rockSubPosition", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "rockSubPosition"));
                }
                SetPropertyExists("rockSubPosition", 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);
                _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);
                _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);

                _bNoShow = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bNoShow", out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("bNoShow", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("bNoShow", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bNoShow"));
                }
                SetPropertyExists("bNoShow", 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);

                _cargoBay = DataStructureParseHelpers.GetcargoBayDataStructureFromVD2Data(this, DataXMLDoc, out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("cargoBay", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("cargoBay", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "cargoBay"));
                }
                SetPropertyExists("cargoBay", exists);
                _gateCollision = DataStructureParseHelpers.GetgateCollisionDataStructureFromVD2Data(this, DataXMLDoc, out exists);
                if (Source.ShortName == "Base")
                {
                    SetPropertyExistsInBaseData("gateCollision", exists);
                }
                else
                {
                    SetPropertyExistsInBaseData("gateCollision", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "gateCollision"));
                }
                SetPropertyExists("gateCollision", exists);

                base.LoadDataFromXML();
            }
        }