diff --git a/app/src/chart/ChartManager.ts b/app/src/chart/ChartManager.ts index 5b67f620..c623cc8d 100644 --- a/app/src/chart/ChartManager.ts +++ b/app/src/chart/ChartManager.ts @@ -50,7 +50,7 @@ import { isHoldNote, } from "./sm/NoteTypes" import { Simfile } from "./sm/Simfile" -import { Cached, TimingEvent } from "./sm/TimingTypes" +import { Cached, TIMING_EVENT_NAMES, TimingEvent } from "./sm/TimingTypes" const SNAPS = [1, 2, 3, 4, 6, 8, 12, 16, 24, 48, -1] @@ -1762,13 +1762,25 @@ export class ChartManager { this.endRegion = this.startRegion this.startRegion = this.beat } - this.loadedChart - .getNotedata() - .filter( - note => note.beat >= this.startRegion! && note.beat <= this.endRegion! + if (this.editTimingMode == EditTimingMode.Off) { + this.setNoteSelection( + this.loadedChart + .getNotedata() + .filter( + note => + note.beat >= this.startRegion! && note.beat <= this.endRegion! + ) + .filter(note => !this.selection.notes.includes(note)) ) - .filter(note => !this.selection.notes.includes(note)) - .forEach(note => this.addNoteToSelection(note)) + } else { + this.setEventSelection( + TIMING_EVENT_NAMES.flatMap( + event => + this.loadedChart!.timingData.getColumn(event) + .events as Cached[] + ) + ) + } } modifySelection(modify: (note: NotedataEntry) => PartialNotedataEntry) {