Ejemplo n.º 1
0
 public void SetLine(CSongLine line, int maxwidth = -1)
 {
     _Line = line;
     Width = 0f;
     foreach (CSongNote note in line.Notes)
     {
         _SetText(note);
         Width += _Text.Rect.W;
     }
 }
Ejemplo n.º 2
0
        public CLyric(SThemeLyrics theme, int partyModeID)
        {
            _PartyModeID = partyModeID;
            _Theme       = theme;

            _Line  = new CSongLine();
            _Text  = new CText(_PartyModeID);
            _Width = 1f;

            LyricStyle = ELyricStyle.TR_CONFIG_LYRICSTYLE_FILL;

            ThemeLoaded = true;
        }
Ejemplo n.º 3
0
        public CLyric(int partyModeID)
        {
            _PartyModeID    = partyModeID;
            _Theme          = new SThemeLyrics();
            ThemeLoaded     = false;
            _Color          = new SColorF();
            _ColorProcessed = new SColorF();

            _Line = new CSongLine();
            _Text = new CText(_PartyModeID);

            LyricStyle = ELyricStyle.TR_CONFIG_LYRICSTYLE_FILL;
        }
Ejemplo n.º 4
0
        private SRectF _GetNoteRect(CBaseNote note)
        {
            CSongLine line  = _Lines[_CurrentLine];
            float     beats = line.LastNoteBeat - line.FirstNoteBeat + 1;

            float width = note.Duration * Rect.W / beats;

            var noteRect = new SRectF(
                Rect.X + (note.StartBeat - line.FirstNoteBeat) * Rect.W / beats,
                Rect.Y + (CBase.Settings.GetNumNoteLines() - 1 - (note.Tone - line.BaseLine) / 2f) * _NoteLineHeight - _AddNoteHeight / 2,
                width,
                _NoteLineHeight + _AddNoteHeight,
                Rect.Z
                );

            return(noteRect);
        }
Ejemplo n.º 5
0
        public CLyric(CLyric l)
        {
            _PartyModeID = l._PartyModeID;
            _Theme       = l._Theme;

            _Color          = l._Color;
            _ColorProcessed = l._ColorProcessed;
            MaxRect         = l.MaxRect;

            _Line    = l._Line;
            _Text    = new CText(l._Text);
            Width    = l.Width;
            MaxWidth = l.MaxWidth;

            _Align = l._Align;

            LyricStyle = l.LyricStyle;
        }
Ejemplo n.º 6
0
 public void Clear()
 {
     _Line = new CSongLine();
 }
Ejemplo n.º 7
0
        private void _DrawToneHelper(CSongLine line)
        {
            float fadetime   = 200;
            int   tonePlayer = CBase.Record.GetToneAbs(_Player);

            if (!CBase.Record.ToneValid(_Player))
            {
                if (ToneHelperAlpha == 0)
                {
                    return;
                }

                if (!_ToneHelperTimer.IsRunning)
                {
                    _ToneHelperTimer.Start();
                }

                if (_ToneHelperTimer.ElapsedMilliseconds > fadetime)
                {
                    ToneHelperAlpha = 0;
                    _ToneHelperTimer.Reset();
                }
                else
                {
                    ToneHelperAlpha = 1 - (_ToneHelperTimer.ElapsedMilliseconds / fadetime);
                }
            }
            else
            {
                ToneHelperAlpha = 1;
                _ToneHelperTimer.Reset();
            }

            int note = line.FindPreviousNote(CBase.Game.GetCurrentBeat());

            if (note < 0)
            {
                note = 0;
            }

            int tone = line.Notes[note].Tone;

            while (tonePlayer - tone < -6)
            {
                tonePlayer += 12;
            }

            while (tonePlayer - tone > 6)
            {
                tonePlayer -= 12;
            }

            float h = (Rect.H / CBase.Settings.GetNumNoteLines()) * 2;

            CTextureRef toneHelper = CBase.Themes.GetSkinTexture(_Theme.SkinToneHelper, _PartyModeID);

            toneHelper.Rect.W = toneHelper.Rect.W * ((h) / toneHelper.Rect.H);
            toneHelper.Rect.H = h;

            var drawRect = new SRectF(
                Rect.X + _JudgementLine - toneHelper.Rect.W,
                Rect.Y + (_SemiToneHeight * (_SemiToneRange - (tonePlayer - _SongBaseLine) + 1)) - (toneHelper.Rect.H / 2),
                toneHelper.Rect.W,
                toneHelper.Rect.H,
                Rect.Z
                );

            var color = new SColorF(1, 1, 1, ToneHelperAlpha);

            CBase.Drawing.DrawTexture(toneHelper, drawRect, color, false);
        }
Ejemplo n.º 8
0
        public void Draw()
        {
            _DrawJudgeLine(new SColorF(_NoteLinesColor, _NoteLinesColor.A));

            if (_CurrentLine == -1 || _CurrentLine >= _Lines.Length)
            {
                return;
            }

            CSongLine line = _Lines[_CurrentLine];

            var color = new SColorF(_Color, _Color.A * Alpha);

            if (CBase.Config.GetDrawNoteLines() == EOffOn.TR_CONFIG_ON)
            {
                _DrawNoteLines(new SColorF(_NoteLinesColor, _NoteLinesColor.A * Alpha));
                _DrawOctaveLines(new SColorF(0, 0, 0, 0.5f * Alpha));
            }

            _DrawLineSeparators(new SColorF(_NoteLinesColor, _NoteLinesColor.A));

            _DrawNotes(color);

            List <CSungLine> sungLines = CBase.Game.GetPlayers()[_Player].SungLines;

            float beats = line.LastNoteBeat - line.FirstNoteBeat + 1;

            for (int i = 0; i < sungLines.Count; i++)
            {
                foreach (CSungNote note in sungLines[i].Notes)
                {
                    SRectF rect = _GetNoteRect(note);
                    if ((rect.Right > Rect.X && rect.Right < Rect.Right))
                    {
                        if (note.EndBeat == CBase.Game.GetRecordedBeat())
                        {
                            rect.W -= (1 - (CBase.Game.GetMidRecordedBeat() - CBase.Game.GetRecordedBeat())) * Rect.W / beats;
                        }

                        float factor = (note.Hit) ? 1f : 0.6f;

                        _DrawNoteFill(rect, color, factor);

                        if (note.Perfect && !note.PerfectDrawn && note.EndBeat < CBase.Game.GetRecordedBeat())
                        {
                            _AddPerfectNote(rect);
                            note.PerfectDrawn = true;
                        }
                    }
                }
            }

            if (CBase.Config.GetDrawToneHelper() == EOffOn.TR_CONFIG_ON)
            {
                _DrawToneHelper(line);
            }

            if (_CurrentLine > 0 && sungLines.Count >= _CurrentLine && sungLines[_CurrentLine - 1].PerfectLine)
            {
                _AddPerfectLine();
                sungLines[_CurrentLine - 1].PerfectLine = false;
            }

            _Flares.RemoveAll(el => !el.IsAlive);
            _PerfectNoteEffect.RemoveAll(el => !el.IsAlive);
            _PerfectLineTwinkle.RemoveAll(el => !el.IsAlive);

            foreach (CParticleEffect perfline in _PerfectLineTwinkle)
            {
                perfline.Draw();
            }

            foreach (CParticleEffect stars in _GoldenStars)
            {
                stars.Alpha = Alpha;
                stars.Draw();
            }

            foreach (CParticleEffect flare in _Flares)
            {
                flare.Draw();
            }

            foreach (CParticleEffect perfnote in _PerfectNoteEffect)
            {
                perfnote.Draw();
            }
        }
Ejemplo n.º 9
0
        public void Draw()
        {
            if (_CurrentLine == -1 || _CurrentLine >= _Lines.Length)
            {
                return;
            }

            CSongLine line = _Lines[_CurrentLine];

            if (CBase.Config.GetDrawNoteLines() == EOffOn.TR_CONFIG_ON)
            {
                _DrawNoteLines(new SColorF(_NoteLinesColor, _NoteLinesColor.A * Alpha));
            }

            float beats = line.LastNoteBeat - line.FirstNoteBeat + 1;

            var color = new SColorF(_Color, _Color.A * Alpha);

            float baseLine = line.BaseLine;

            foreach (CSongNote note in line.Notes)
            {
                if (note.Type != ENoteType.Freestyle)
                {
                    SRectF rect = _GetNoteRect(note);

                    _DrawNoteBG(rect, color);
                    _DrawNoteBase(rect, new SColorF(_NoteBaseColor, _NoteBaseColor.A * Alpha), 1f);
                }
            }

            if (CBase.Config.GetDrawToneHelper() == EOffOn.TR_CONFIG_ON)
            {
                _DrawToneHelper((int)baseLine, (CBase.Game.GetMidRecordedBeat() - line.FirstNoteBeat) / beats * Rect.W);
            }

            List <CSungLine> sungLines = CBase.Game.GetPlayers()[_Player].SungLines;

            if (_CurrentLine >= 0 && _CurrentLine < sungLines.Count)
            {
                foreach (CSungNote note in sungLines[_CurrentLine].Notes)
                {
                    SRectF rect = _GetNoteRect(note);
                    if (note.EndBeat == CBase.Game.GetRecordedBeat())
                    {
                        rect.W -= (1 - (CBase.Game.GetMidRecordedBeat() - CBase.Game.GetRecordedBeat())) * Rect.W / beats;
                    }

                    float factor = (note.Hit) ? 1f : 0.6f;

                    _DrawNoteFill(rect, color, factor);

                    if (note.EndBeat >= CBase.Game.GetRecordedBeat() && note.Hit && note.HitNote.Type == ENoteType.Golden)
                    {
                        SRectF re = rect;
                        re.W = (CBase.Game.GetMidRecordedBeat() - note.StartBeat) / beats * Rect.W;
                        _AddFlare(re);
                    }

                    if (note.Perfect && !note.PerfectDrawn && note.EndBeat < CBase.Game.GetRecordedBeat())
                    {
                        _AddPerfectNote(rect);
                        note.PerfectDrawn = true;
                    }
                }
            }

            if (_CurrentLine > 0 && sungLines.Count >= _CurrentLine && sungLines[_CurrentLine - 1].PerfectLine)
            {
                _AddPerfectLine();
                sungLines[_CurrentLine - 1].PerfectLine = false;
            }

            _Flares.RemoveAll(el => !el.IsAlive);
            _PerfectNoteEffect.RemoveAll(el => !el.IsAlive);
            _PerfectLineTwinkle.RemoveAll(el => !el.IsAlive);

            foreach (CParticleEffect perfline in _PerfectLineTwinkle)
            {
                perfline.Draw();
            }

            foreach (CParticleEffect stars in _GoldenStars)
            {
                stars.Alpha = Alpha;
                stars.Draw();
            }

            foreach (CParticleEffect flare in _Flares)
            {
                flare.Draw();
            }

            foreach (CParticleEffect perfnote in _PerfectNoteEffect)
            {
                perfnote.Draw();
            }
        }