示例#1
0
 public void KeyboardSelection(bool active, int player)
 {
     //Overwrite player-selection; Same profile, but other player
     if (active && Selection != -1)
     {
         _player = player;
         PlayerSelector.Color = CTheme.GetPlayerColor(player);
     }
     //Normal activation
     else if (active)
     {
         Selection              = 0;
         _actualSelection       = 0;
         _player                = player;
         PlayerSelector.Color   = CTheme.GetPlayerColor(player);
         PlayerSelector.Visible = true;
     }
     //Deactivate
     else
     {
         Selection              = -1;
         _actualSelection       = -1;
         _player                = -1;
         PlayerSelector.Visible = false;
     }
 }
示例#2
0
        private void LoadNextSong()
        {
            CGame.NextRound();

            if (CGame.IsFinished())
            {
                CGraphics.FadeTo(EScreens.ScreenScore);
                _FadeOut = true;
                return;
            }

            CSong song = CGame.GetSong();

            if (song == null)
            {
                CLog.LogError("Critical Error! ScreenSing.LoadNextSong() song is null!");
                return;
            }

            CloseSong();

            if (!song.CoverSmallLoaded)
            {
                song.ReadNotes();
            }

            string songname = song.Artist + " - " + song.Title;
            int    rounds   = CGame.GetNumSongs();

            if (rounds > 1)
            {
                songname += " (" + CGame.RoundNr + "/" + rounds.ToString() + ")";
            }
            Texts[htTexts(TextSongName)].Text = songname;

            _CurrentStream = CSound.Load(song.GetMP3(), true);
            CSound.SetStreamVolume(_CurrentStream, _Volume);
            CSound.SetPosition(_CurrentStream, song.Start);
            _CurrentTime         = song.Start;
            _FinishTime          = song.Finish;
            _TimeToFirstNote     = 0f;
            _TimeToFirstNoteDuet = 0f;
            CGame.ResetPlayer();

            CDraw.RemoveTexture(ref _CurrentVideoTexture);

            if (song.VideoFileName != String.Empty)
            {
                _CurrentVideo = CVideo.VdLoad(Path.Combine(song.Folder, song.VideoFileName));
                CVideo.VdSkip(_CurrentVideo, song.Start, song.VideoGap);
                _VideoAspect = song.VideoAspect;
            }

            CDraw.RemoveTexture(ref _Background);
            if (song.BackgroundFileName != String.Empty)
            {
                _Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
            }

            SingNotes[htSingNotes(SingBars)].Reset();

            bool LyricsOnTop = CGame.NumPlayer == 2 && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON;

            if (song.IsDuet)
            {
                CGame.Player[1].LineNr = 1;
                Statics[htStatics(StaticLyricsDuet)].Visible = true;
                Lyrics[htLyrics(LyricMainDuet)].Visible      = true;
                Lyrics[htLyrics(LyricSubDuet)].Visible       = true;

                Lyrics[htLyrics(LyricMainTop)].Visible      = false;
                Lyrics[htLyrics(LyricSubTop)].Visible       = false;
                Statics[htStatics(StaticLyricsTop)].Visible = false;
            }
            else
            {
                Statics[htStatics(StaticLyricsDuet)].Visible = false;
                Lyrics[htLyrics(LyricMainDuet)].Visible      = false;
                Lyrics[htLyrics(LyricSubDuet)].Visible       = false;

                Lyrics[htLyrics(LyricMainTop)].Visible      = LyricsOnTop;
                Lyrics[htLyrics(LyricSubTop)].Visible       = LyricsOnTop;
                Statics[htStatics(StaticLyricsTop)].Visible = LyricsOnTop;
            }

            for (int p = 0; p < CGame.NumPlayer; p++)
            {
                NoteLines[p] = SingNotes[htSingNotes(SingBars)].AddPlayer(
                    SingNotes[htSingNotes(SingBars)].BarPos[p, CGame.NumPlayer - 1],
                    CTheme.GetPlayerColor(p + 1),
                    p);
            }

            /*
             *  case 4:
             *      NoteLines[0] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(35f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[0]);
             *      NoteLines[1] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(35f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[1]);
             *      NoteLines[2] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(640f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[2]);
             *      NoteLines[3] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(640f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[3]);
             *      break;
             */


            _TimerSongText.Stop();
            _TimerSongText.Reset();

            if (song.Notes.Lines.Length != 2)
            {
                _TimerSongText.Start();
            }

            StartSong();
        }