From da510860e54c091247b4685474e1a5bedefd3ff9 Mon Sep 17 00:00:00 2001 From: Geomitron <22552797+Geomitron@users.noreply.github.com> Date: Sun, 9 Mar 2025 18:25:24 -0500 Subject: [PATCH] Fix drum previews with disco flip --- .../chart-sidebar-preview/render.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src-angular/app/components/browse/chart-sidebar/chart-sidebar-preview/render.ts b/src-angular/app/components/browse/chart-sidebar/chart-sidebar-preview/render.ts index b0c1578..1aa80ca 100644 --- a/src-angular/app/components/browse/chart-sidebar/chart-sidebar-preview/render.ts +++ b/src-angular/app/components/browse/chart-sidebar/chart-sidebar-preview/render.ts @@ -827,6 +827,28 @@ function adjustParsedChart(parsedChart: ParsedChart, instrument: Instrument, dif noteGroup.push(removed[0]) } } + } else if (getInstrumentType(instrument) === instrumentTypes.drums) { + for (const noteGroup of track.noteEventGroups) { + for (const note of noteGroup) { + if (note.flags & noteFlags.discoNoflip) { + note.flags &= ~noteFlags.discoNoflip + } + if (note.flags & noteFlags.disco) { + note.flags &= ~noteFlags.disco + switch (note.type) { + case noteTypes.redDrum: + note.type = noteTypes.yellowDrum + note.flags &= ~noteFlags.tom + note.flags |= noteFlags.cymbal + break + case noteTypes.yellowDrum: + note.type = noteTypes.redDrum + note.flags &= ~noteFlags.cymbal + note.flags |= noteFlags.tom + } + } + } + } } return parsedChart