Exemple #1
0
        private void InitCue(string cueName)
        {
            if (string.IsNullOrEmpty(cueName))
            {
                CueId = MyStringId.NullOrEmpty;
            }
            else
            {
                MyStringId stringId = MyStringId.GetOrCompute(cueName);
                MySoundCategoryDefinition.SoundDescription soundDesc = null;
                var soundCategories = MyDefinitionManager.Static.GetSoundCategoryDefinitions();

                // check whether saved cue is in some category
                foreach (var category in soundCategories)
                {
                    foreach (var soundDescTmp in category.Sounds)
                    {
                        if (MySoundPair.GetCueId(soundDescTmp.SoundId) == stringId)
                        {
                            soundDesc = soundDescTmp;
                        }
                    }
                }

                if (soundDesc != null)
                {
                    SelectSound(stringId, false);
                }
                else
                {
                    CueId = MyStringId.NullOrEmpty;
                }
            }
        }
        private void InitCue(string cueName)
        {
            if (string.IsNullOrEmpty(cueName))
            {
                m_cueIdString.Value = "";
            }
            else
            {
                var cueId = new MySoundPair(cueName);
                MySoundCategoryDefinition.SoundDescription soundDesc = null;
                var soundCategories = MyDefinitionManager.Static.GetSoundCategoryDefinitions();

                // check whether saved cue is in some category
                foreach (var category in soundCategories)
                {
                    foreach (var soundDescTmp in category.Sounds)
                    {
                        if (soundDescTmp.SoundId.Equals(cueId.SoundId))
                        {
                            soundDesc = soundDescTmp;
                        }
                    }
                }

                if (soundDesc != null)
                {
                    SelectSound(soundDesc.SoundId, false);
                }
                else
                {
                    m_cueIdString.Value = "";
                }
            }
        }
Exemple #3
0
        private void InitCue(int cueId)
        {
            if (cueId == 0)
            {
                CueId = cueId;
            }
            else
            {
                MyStringId stringId = MyStringId.TryGet(cueId);
                MySoundCategoryDefinition.SoundDescription soundDesc = null;
                var soundCategories = MyDefinitionManager.Static.GetSoundCategoryDefinitions();

                // check whether saved cue is in some category
                foreach (var category in soundCategories)
                {
                    foreach (var soundDescTmp in category.Sounds)
                    {
                        if (MySoundPair.GetCueId(soundDescTmp.SoundId) == stringId)
                        {
                            soundDesc = soundDescTmp;
                        }
                    }
                }

                if (soundDesc != null)
                {
                    SelectSound(stringId, false);
                }
                else
                {
                    CueId = 0;
                }
            }
        }
        private void InitCue(string cueName)
        {
            if (string.IsNullOrEmpty(cueName))
            {
                m_cueIdString.Value = "";
            }
            else
            {
                var cueId = new MySoundPair(cueName);
                MySoundCategoryDefinition.SoundDescription soundDesc = null;
                var soundCategories = MyDefinitionManager.Static.GetSoundCategoryDefinitions();

                // check whether saved cue is in some category
                foreach (var category in soundCategories)
                {
                    foreach (var soundDescTmp in category.Sounds)
                    {
                        if (cueId.SoundId.ToString().EndsWith(soundDescTmp.SoundId.ToString()))    //GK: EndsWith instead of Equals to catch both Realistic and Arcade sounds
                        {
                            soundDesc = soundDescTmp;
                        }
                    }
                }

                if (soundDesc != null)
                {
                    SelectSound(soundDesc.SoundId, false);
                }
                else
                {
                    m_cueIdString.Value = "";
                }
            }
        }