コード例 #1
0
 internal int GetIndexOfSelected()
 {
     foreach (MPIAudioContainer miac in IntroAudioList)
     {
         if (miac == CurrentAC)
         {
             return(IntroAudioList.IndexOf(miac));
         }
     }
     return(0);
 }
コード例 #2
0
        internal MPIAudioContainer SelectAudio(int idx)
        {
            MPIAudioContainer[] ial = IntroAudioList.ToArray();

            if (idx < ial.Length && idx >= 0)
            {
                CurrentAC = ial[idx];
            }
            else
            {
                CurrentAC = DefaultAC;
            }

            MPIConfig.LastSound = CurrentAC.Name;

            return(CurrentAC);
        }
コード例 #3
0
        internal IEnumerator Load()
        {
            var folderPath = Environment.CurrentDirectory + Plugin.AudioPath;

            if (!Directory.Exists(folderPath))
            {
                Directory.CreateDirectory(folderPath);
            }
            var directories = Directory.GetDirectories(folderPath);

            IntroAudioList.Add(DefaultAC);
            IntroAudioList.Add(MutedAC);
            foreach (var folder in directories)
            {
                //Logger.log.Info(folder);
                MPIAudioContainer miac = new MPIAudioContainer("");//FromFolder(folder);
                yield return(miac.LoadFromFolder(folder + "/"));

                if (miac != null)
                {
                    IntroAudioList.Add(miac);
                    //Logger.log.Info("Added: " + miac.Name + " | " + (miac.BuildUpClip != null) + " | " + (miac.ReadyClip != null) + " | " + (miac.SetClip != null) + " | " + (miac.GoClip != null));
                    if (miac.Name.Equals(MPIConfig.LastSound))
                    {
                        //Logger.log.Info("Last used Sounds found!");
                        CurrentAC = miac;
                    }
                }
            }

            Logger.log.Info((IntroAudioList.Count - 2) + " custom multiplayer intro sound preset(s) loaded!");

            if (CurrentAC == null)
            {
                CurrentAC = DefaultAC;
            }
        }
コード例 #4
0
 internal void Clear()
 {
     IntroAudioList.Clear();
 }