Example #1
0
 void ssm_SongChanged(SelectSongManager.SongChangeMode obj)
 {
     mss.ChangeIndex(ssm.SelectedIndex, obj);
     if (ssm.SelectedSongInformation == null)
     {
         sic.HideInfo();
         return;
     }
     if (ssm.SelectedSongInformation.IsFolder)
     {
         menuMovie.FadeOut();
         menuMovie.CheckLoopAvailable = false;
         sic.HideInfo();
     }
     else
     {
         menuMovie.FadeOut();
         menuMovie.CheckLoopAvailable = true;
         count        = 0;
         moviechanged = true;
         SongInformation current = ssm.SelectedSongInformation.SongInfo;
         sic.ChangeSongInfo(ssm.SelectedSongInformation);
     }
 }
Example #2
0
        public void ChangeIndex(int index, SelectSongManager.SongChangeMode changeMode)
        {
            if (infos == null || infos.Length == 0)
            {
                foreach (var name in songNames)
                {
                    name.Hidden = true;
                }
                return;
            }
            var dest = songNameSprite.Position.Y;

            switch (changeMode)
            {
            case SelectSongManager.SongChangeMode.Down:
                dest -= -SongNameComponent.ItemHeight;
                break;

            case SelectSongManager.SongChangeMode.Reset:
                break;

            case SelectSongManager.SongChangeMode.Up:
                dest += -SongNameComponent.ItemHeight;
                break;
            }
            if (dest >= ItemsDefaultY + SongNameComponent.ItemHeight)
            {
                dest = ItemsDefaultY + SongNameComponent.ItemHeight;
            }
            if (dest <= ItemsDefaultY - SongNameComponent.ItemHeight)
            {
                dest = ItemsDefaultY - SongNameComponent.ItemHeight;
            }
            songNameSprite.Position = new Vector2(songNameSprite.Position.X, dest);
            selectedIndex           = index;
            index = selectedIndex - ItemCount / 2;
            foreach (var name in songNames)
            {
                var actualIndex = index;
                while (actualIndex < 0)
                {
                    actualIndex += infos.Length;
                }
                while (actualIndex >= infos.Length)
                {
                    actualIndex -= infos.Length;
                }
                var info = infos[actualIndex];
                name.Name         = info.Text;
                name.ShowFolder   = info.IsFolder;
                name.ShowAC       = info.SongInfo != null && info.SongInfo.HasAC;
                name.ShowFT       = info.SongInfo != null && info.SongInfo.HasACFT;
                name.PerfectAlpha = 0;
                if (info.SongInfo != null && !info.IsFolder)
                {
                    name.PerfectAlpha = info.PerfectRatio;
                }
                name.Hidden = false;
                index++;
            }
        }