Skip to content

Commit

Permalink
Select region with timing events
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Dec 30, 2023
1 parent aa14d22 commit ec7a230
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions app/src/chart/ChartManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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<TimingEvent>[]
)
)
}
}

modifySelection(modify: (note: NotedataEntry) => PartialNotedataEntry) {
Expand Down

0 comments on commit ec7a230

Please sign in to comment.