示例#1
0
 private void OnsoundPriorityChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (Source != null)
     {
         if (Source.WriteAccess)
         {
             SetPropertyEdited("soundPriority", true);
         }
         else
         {
             bool exists = false;
             _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);
         }
     }
 }
示例#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);

                _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();
            }
        }