Rap notes are now properly interpreted

This commit is contained in:
Gary Kertopermono committed 2019-04-09 17:32:42 +02:00
1 parent efead3615c
commit 26655b84dc
2 files changed
+16 -7

No files matched your search

+14 -7
View File
@@ -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;
+2
View File
@@ -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)