private static void LoadSounds()
 {
     m_sounds = new List <MySoundCuesEnum>();
     foreach (MySoundCuesEnum enumValue in MyGuiInfluenceSphereHelpers.MyInfluenceSphereSoundHelperTypesEnumValues)
     {
         MyGuiInfluenceSphereHelper musicHelper = MyGuiInfluenceSphereHelpers.GetInfluenceSphereSoundHelper(enumValue);
         if (musicHelper != null && musicHelper.Description.ToString().ToLower().StartsWith("amb2d_"))
         {
             m_sounds.Add(enumValue);
         }
     }
 }
        public void Init(StringBuilder hudLabelText, MyMwcObjectBuilder_InfluenceSphere objectBuilder, Matrix matrix)
        {
            // Influence spheres dont have hud label text
            base.Init(hudLabelText, objectBuilder);

            InfluenceFlags = objectBuilder.InfluenceFlags;

            m_radiusMin = objectBuilder.RadiusMin;
            RadiusMax   = objectBuilder.RadiusMax;
            DustColor   = objectBuilder.DustColor;
            Magnitude   = objectBuilder.Magnitude;

            VisibleInGame = false;

            SetWorldMatrix(matrix);

            Enabled = objectBuilder.Enabled;

            NeedsUpdate = Enabled;
            Save        = true;

            //m_soundType = objectBuilder.SoundType;
            //MySoundCuesEnum cueEnum = GetSoundCueByObjectBuilderType(m_soundType);
            //m_cueEnum = cueEnum;
            m_cueEnum = (MySoundCuesEnum)objectBuilder.SoundCueId;

            if ((InfluenceFlags & MyInfluenceFlags.Sound) > 0)
            {
                MyGuiInfluenceSphereHelper musicHelper = MyGuiInfluenceSphereHelpers.GetInfluenceSphereSoundHelper(m_cueEnum);
                if (musicHelper == null || !musicHelper.Description.ToString().ToLower().StartsWith("amb2d_"))
                {
                    if (musicHelper == null)
                    {
                        Debug.Fail("Incorrect influence sphere sound doesn't exist");
                        MyMwcLog.WriteLine("Incorrect influence sphere sound doesn't exist");
                    }
                    else
                    {
                        Debug.Fail("Incorrect influence sphere sound: " + musicHelper.Description.ToString() + ", deleted");
                        MyMwcLog.WriteLine("Incorrect influence sphere sound: " + musicHelper.Description.ToString() + ", deleted");
                    }
                }
            }

            Flags |= EntityFlags.EditableInEditor;
        }
        private void CreateControlsSound(Vector2 controlsOrigin)
        {
            AddSeparator(controlsOrigin);

            Controls.Add(new MyGuiControlLabel(this, controlsOrigin + m_controlsAdded * CONTROLS_DELTA + new Vector2(0.05f, 0), null, MyTextsWrapperEnum.SoundInfluenceSphereType, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER));
            m_soundCheckbox = new MyGuiControlCheckbox(this, controlsOrigin + m_controlsAdded++ *CONTROLS_DELTA + new Vector2(0.02f, 0), false, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR);
            Controls.Add(m_soundCheckbox);

            //m_controlsAdded++;

            //COMBOBOX - sounds
            //m_selectSoundCombobox = new MyGuiControlCombobox(this,
            //                                                 controlsOrigin + m_controlsAdded++ * CONTROLS_DELTA +
            //                                                 new Vector2(MyGuiConstants.COMBOBOX_LARGE_SIZE.X / 2.0f, 0),
            //                                                 MyGuiControlPreDefinedSize.LARGE,
            //                                                 MyGuiConstants.COMBOBOX_BACKGROUND_COLOR,
            //                                                 MyGuiConstants.COMBOBOX_TEXT_SCALE, 3, true, false, true);
            m_selectSoundCombobox = new MyGuiControlCombobox(this,
                                                             controlsOrigin + m_controlsAdded++ *CONTROLS_DELTA +
                                                             new Vector2(MyGuiConstants.COMBOBOX_LONGMEDIUM_SIZE.X / 2.0f, 0),
                                                             MyGuiControlPreDefinedSize.MEDIUM,
                                                             MyGuiConstants.COMBOBOX_BACKGROUND_COLOR,
                                                             MyGuiConstants.COMBOBOX_TEXT_SCALE, 6, false, false, false);

            foreach (MySoundCuesEnum enumValue in MyGuiInfluenceSphereHelpers.MyInfluenceSphereSoundHelperTypesEnumValues)
            {
                MyGuiInfluenceSphereHelper musicHelper = MyGuiInfluenceSphereHelpers.GetInfluenceSphereSoundHelper(enumValue);
                if (musicHelper != null && musicHelper.MultiLineDescription.ToString().ToLower().StartsWith("amb2d_"))
                {
                    m_selectSoundCombobox.AddItem((int)enumValue, musicHelper.Icon, musicHelper.MultiLineDescription);
                }
            }

            m_selectSoundCombobox.SelectItemByKey(0);
            //m_selectSoundCombobox.OnSelectItemDoubleClick = OnOkClick;
            Controls.Add(m_selectSoundCombobox);
        }