private void ModifyCurrentList(ref List <MyGuiControlListbox.Item> list, bool Add)
 {
     Debug.Assert(list != null, "Adding NULL from list");
     m_allowCurrentListUpdate = false;
     if (list != null)
     {
         foreach (var val in list)
         {
             Debug.Assert(val.UserData != null, "User data is null");
             MyDefinitionId?id = val.UserData as MyDefinitionId?;
             if (id != null)
             {
                 ChangeListId((MyDefinitionId)id, Add);
                 continue;
             }
             byte?b = val.UserData as byte?;
             if (b == null)
             {
                 Debug.Assert(false, "Should not be here");
                 continue;
             }
             ChangeListType((byte)b, Add);
         }
     }
     m_allowCurrentListUpdate = true;
     currentList.UpdateVisual();
     addToSelectionButton.UpdateVisual();
     removeFromSelectionButton.UpdateVisual();
 }
示例#2
0
 private void ModifyCurrentList(ref List <MyGuiControlListbox.Item> list, bool Add)
 {
     this.m_allowCurrentListUpdate = false;
     if (list != null)
     {
         foreach (MyGuiControlListbox.Item item in list)
         {
             MyDefinitionId?userData = item.UserData as MyDefinitionId?;
             if (userData != null)
             {
                 this.ChangeListId(userData.Value, Add);
                 continue;
             }
             byte?nullable2 = item.UserData as byte?;
             if (nullable2 != null)
             {
                 this.ChangeListType(nullable2.Value, Add);
             }
         }
     }
     this.m_allowCurrentListUpdate = true;
     currentList.UpdateVisual();
     addToSelectionButton.UpdateVisual();
     removeFromSelectionButton.UpdateVisual();
 }
示例#3
0
 void SelectionChanged()
 {
     if (!MySandboxGame.IsDedicated)
     {
         m_soundPair.Init(m_cueId);
         var soundData = MyAudio.Static.GetCue(m_cueId);
         if (soundData != null)
         {
             IsLoopable = soundData.Loopable;
         }
     }
     m_loopableTimeSlider.UpdateVisual();
     m_playButton.UpdateVisual();
     m_stopButton.UpdateVisual();
 }
示例#4
0
 void SelectionChanged()
 {
     if (!MySandboxGame.IsDedicated)
     {
         if (m_cueIdString.Value.Length > 0)
         {
             m_cueId = new MySoundPair(m_cueIdString.Value);
         }
         else
         {
             m_cueId = MySoundPair.Empty;
         }
         var soundData = MyAudio.Static.GetCue(m_cueId.Arcade);
         if (soundData != null)
         {
             IsLoopable = soundData.Loopable;
         }
     }
     m_loopableTimeSlider.UpdateVisual();
     m_playButton.UpdateVisual();
     m_stopButton.UpdateVisual();
 }
示例#5
0
        public void SelectSound(MyCueId cueId, bool sync)
        {
            if (sync)
            {
                SyncObject.SendSelectSoundRequest(cueId);
            }
            else
            {
                CueId = cueId;

                if (!MySandboxGame.IsDedicated)
                {
                    m_soundPair.Init(cueId);
                    var soundData = MyAudio.Static.GetCue(cueId);
                    if (soundData != null)
                    {
                        IsLoopable = soundData.Loopable;
                    }
                }
                m_loopableTimeSlider.UpdateVisual();
                m_playButton.UpdateVisual();
                m_stopButton.UpdateVisual();
            }
        }
 private void SelectFromCurrentList(List <MyGuiControlListbox.Item> val)
 {
     m_selectedForDelete = val;
     removeFromSelectionButton.UpdateVisual();
 }