From 26655b84dc108fc7a36f9e68896643035bd3d9db Mon Sep 17 00:00:00 2001 From: Gary Kertopermono Date: Tue, 9 Apr 2019 17:32:42 +0200 Subject: [PATCH] Rap notes are now properly interpreted --- VocaluxeLib/Menu/SingNotes/CNoteBars.cs | 21 ++++++++++++++------- VocaluxeLib/Songs/CSongLoader.cs | 2 ++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/VocaluxeLib/Menu/SingNotes/CNoteBars.cs b/VocaluxeLib/Menu/SingNotes/CNoteBars.cs index 5e6c50ee..023cab92 100644 --- a/VocaluxeLib/Menu/SingNotes/CNoteBars.cs +++ b/VocaluxeLib/Menu/SingNotes/CNoteBars.cs @@ -84,8 +84,8 @@ namespace VocaluxeLib.Menu.SingNotes _Flares.Clear(); _PerfectNoteEffect.Clear(); - foreach (CSongNote note in _Lines[_CurrentLine].Notes.Where(note => note.Type == ENoteType.Golden)) - _AddGoldenNote(_GetNoteRect(note)); + foreach (CSongNote note in _Lines[_CurrentLine].Notes.Where(note => (note.Type == ENoteType.Golden || note.Type == ENoteType.RapGolden))) + _AddGoldenNote(_GetNoteRect(note, note.Type == ENoteType.Rap || note.Type == ENoteType.RapGolden)); } public void Draw() @@ -107,7 +107,7 @@ namespace VocaluxeLib.Menu.SingNotes { if (note.Type != ENoteType.Freestyle) { - SRectF rect = _GetNoteRect(note); + SRectF rect = _GetNoteRect(note, note.Type == ENoteType.Rap || note.Type == ENoteType.RapGolden); _DrawNoteBG(rect, color); _DrawNoteBase(rect, new SColorF(_NoteBaseColor, _NoteBaseColor.A * Alpha), 1f); @@ -130,7 +130,7 @@ namespace VocaluxeLib.Menu.SingNotes _DrawNoteFill(rect, color, factor); - if (note.EndBeat >= CBase.Game.GetRecordedBeat() && note.Hit && note.HitNote.Type == ENoteType.Golden) + if (note.EndBeat >= CBase.Game.GetRecordedBeat() && note.Hit && (note.HitNote.Type == ENoteType.Golden || note.HitNote.Type == ENoteType.RapGolden)) { SRectF re = rect; re.W = (CBase.Game.GetMidRecordedBeat() - note.StartBeat) / beats * Rect.W; @@ -171,18 +171,25 @@ namespace VocaluxeLib.Menu.SingNotes perfnote.Draw(); } - private SRectF _GetNoteRect(CBaseNote note) + private SRectF _GetNoteRect(CBaseNote note, bool isRapNote = false) { CSongLine line = _Lines[_CurrentLine]; float beats = line.LastNoteBeat - line.FirstNoteBeat + 1; float width = note.Duration * Rect.W / beats; + float y = Rect.Y + (CBase.Settings.GetNumNoteLines() - 1 - (note.Tone - line.BaseLine) / 2f) * _NoteLineHeight - _AddNoteHeight / 2; + float height = _NoteLineHeight + _AddNoteHeight; + + if (isRapNote) { + y = Rect.Y; + height = Rect.H; + } 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, + y, width, - _NoteLineHeight + _AddNoteHeight, + height, Rect.Z ); return noteRect; diff --git a/VocaluxeLib/Songs/CSongLoader.cs b/VocaluxeLib/Songs/CSongLoader.cs index 650971cb..48a2d324 100644 --- a/VocaluxeLib/Songs/CSongLoader.cs +++ b/VocaluxeLib/Songs/CSongLoader.cs @@ -566,6 +566,8 @@ namespace VocaluxeLib.Songs break; case ':': case '*': + case 'R': + case 'G': case 'F': string[] noteData = line.Split(splitChars, 4); if (noteData.Length < 4)