diff --git a/public/assets/noteskin/dance/lift/body.txt b/public/assets/noteskin/dance/lift/body.txt index 461d0be4..8c53ed0b 100644 --- a/public/assets/noteskin/dance/lift/body.txt +++ b/public/assets/noteskin/dance/lift/body.txt @@ -1,9 +1,9 @@ 79 --9.000000 1.000000 0.500000 0.472100 --6.000000 25.000000 0.546875 0.855300 --9.000000 28.000000 0.500000 0.903200 -6.000000 25.000000 0.546875 0.855300 -9.000000 28.000000 0.500000 0.903200 +-9.000000 1.000000 0.375000 0.472100 +-6.000000 25.000000 0.421875 0.855300 +-9.000000 28.000000 0.375000 0.903200 +6.000000 25.000000 0.421875 0.855300 +9.000000 28.000000 0.375000 0.903200 -19.000000 14.000000 0.033500 0.417300 -19.000000 11.000000 0.033500 0.434600 -11.000000 6.000000 0.045700 0.466200 @@ -13,25 +13,25 @@ 19.000000 7.000000 0.094600 0.567900 19.000000 6.000000 0.094600 0.552000 25.000000 1.000000 0.094600 0.472100 -0.000000 -24.000000 0.562500 0.072900 -0.000000 -25.000000 0.546875 0.057000 -26.000000 1.000000 0.546875 0.472100 --6.000000 -5.000000 0.546875 0.376300 --19.000000 7.000000 0.562500 0.567900 --5.500000 -6.500000 0.546875 0.368300 -9.000000 1.000000 0.500000 0.472100 -19.000000 8.000000 0.546875 0.583900 -19.000000 11.000000 0.500000 0.631800 -0.000000 -28.000000 0.500000 0.009100 -29.000000 1.000000 0.500000 0.472100 --26.000000 1.000000 0.546875 0.472100 -5.500000 -6.500000 0.094600 0.392300 +0.000000 -24.000000 0.437500 0.072900 +0.000000 -25.000000 0.421875 0.057000 +26.000000 1.000000 0.421875 0.472100 +-6.000000 -5.000000 0.421875 0.376300 +-19.000000 7.000000 0.437500 0.567900 +-5.375000 -6.375000 0.421875 0.368300 +9.000000 1.000000 0.375000 0.472100 +19.000000 8.000000 0.421875 0.583900 +19.000000 11.000000 0.375000 0.631800 +0.000000 -28.000000 0.375000 0.009100 +29.000000 1.000000 0.375000 0.472100 +-26.000000 1.000000 0.421875 0.472100 +5.375000 -6.375000 0.094600 0.392300 5.000000 24.000000 0.094600 0.839400 5.000000 -8.000000 0.094600 0.408300 -5.500000 24.500000 0.562500 0.847300 --19.000000 8.000000 0.546875 0.583900 --19.000000 11.000000 0.500000 0.631800 --29.000000 1.000000 0.500000 0.472100 +5.375000 24.375000 0.437500 0.847300 +-19.000000 8.000000 0.421875 0.583900 +-19.000000 11.000000 0.375000 0.631800 +-29.000000 1.000000 0.375000 0.472100 11.000000 30.000000 0.079300 0.320000 -11.000000 30.000000 0.045700 0.320000 -11.000000 30.000000 0.045700 0.320000 @@ -48,36 +48,36 @@ 19.000000 14.000000 0.091500 0.417300 -32.000000 1.000000 0.013500 0.497200 32.000000 1.000000 0.111500 0.497200 --5.500000 -6.500000 0.094600 0.352400 +-5.375000 -6.375000 0.094600 0.352400 -19.000000 6.000000 0.094600 0.552000 -5.000000 -8.000000 0.094600 0.336400 19.000000 11.000000 0.091500 0.434600 -5.000000 24.000000 0.094600 0.839400 --5.500000 -6.500000 0.094600 0.392300 +-5.375000 -6.375000 0.094600 0.392300 -5.000000 -8.000000 0.094600 0.408300 --6.000000 -5.000000 0.546875 0.392300 +-6.000000 -5.000000 0.421875 0.392300 -29.000000 1.000000 0.017800 0.497200 -9.000000 1.000000 0.048800 0.495700 -19.000000 7.000000 0.094600 0.567900 0.000000 -24.000000 0.094600 0.072900 24.000000 1.000000 0.094600 0.472100 -5.500000 -6.500000 0.094600 0.352400 +5.375000 -6.375000 0.094600 0.352400 5.000000 -8.000000 0.094600 0.336400 -6.000000 -5.000000 0.546875 0.392300 -19.000000 7.000000 0.562500 0.567900 -5.500000 -6.500000 0.562500 0.352400 --25.000000 1.000000 0.562500 0.472100 -25.000000 1.000000 0.562500 0.472100 -6.000000 -5.000000 0.546875 0.376300 -5.500000 24.500000 0.094600 0.847300 --5.500000 24.500000 0.562500 0.847300 --5.500000 -6.500000 0.562500 0.400300 +6.000000 -5.000000 0.421875 0.392300 +19.000000 7.000000 0.437500 0.567900 +5.375000 -6.375000 0.437500 0.352400 +-25.000000 1.000000 0.437500 0.472100 +25.000000 1.000000 0.437500 0.472100 +6.000000 -5.000000 0.421875 0.376300 +5.375000 24.375000 0.094600 0.847300 +-5.375000 24.375000 0.437500 0.847300 +-5.375000 -6.375000 0.437500 0.400300 -9.000000 28.000000 0.048800 0.332200 0.000000 -28.000000 0.062500 0.675800 9.000000 28.000000 0.076200 0.332200 29.000000 1.000000 0.107200 0.497200 9.000000 1.000000 0.076200 0.495700 --5.500000 24.500000 0.094600 0.847300 +-5.375000 24.375000 0.094600 0.847300 90 0 1 2 2 3 4 diff --git a/public/assets/noteskin/dance/lift/parts.png b/public/assets/noteskin/dance/lift/parts.png index fa65bc44..da86b2a6 100644 Binary files a/public/assets/noteskin/dance/lift/parts.png and b/public/assets/noteskin/dance/lift/parts.png differ diff --git a/public/assets/noteskin/dance/lift/parts_old.png b/public/assets/noteskin/dance/lift/parts_old.png new file mode 100644 index 00000000..de13243a Binary files /dev/null and b/public/assets/noteskin/dance/lift/parts_old.png differ diff --git a/public/assets/noteskin/dance/shader/lift_gradient.frag b/public/assets/noteskin/dance/shader/lift_gradient.frag index 47c5ef14..eaf25e59 100644 --- a/public/assets/noteskin/dance/shader/lift_gradient.frag +++ b/public/assets/noteskin/dance/shader/lift_gradient.frag @@ -11,7 +11,7 @@ void main() { sampler0, vec2(vUvs.x + 0.0625 * quant, mod(1.2 - vUvs.y - time, 2.0) / 2.0) ); - if (vUvs.x < 0.5) { + if (vUvs.x < 0.375) { col = texture2D(sampler0, vUvs); } gl_FragColor = col; diff --git a/public/assets/noteskin/dance/tap/body.txt b/public/assets/noteskin/dance/tap/body.txt index 46aae656..0b692d8e 100755 --- a/public/assets/noteskin/dance/tap/body.txt +++ b/public/assets/noteskin/dance/tap/body.txt @@ -1,16 +1,16 @@ 12 -5.000000 24.000000 0.536171 0.301126 -0.000000 24.000000 0.534100 0.367417 -0.000000 -23.000000 0.551018 0.908796 -5.000000 -7.000000 0.546875 0.643631 -24.000000 1.000000 0.551018 0.356369 -19.000000 6.000000 0.546875 0.356369 --5.000000 -7.000000 0.546875 0.643631 --19.000000 6.000000 0.546875 0.356369 --24.000000 1.000000 0.542731 0.356369 -0.000000 -23.000000 0.542731 0.908796 -0.000000 24.000000 0.559649 0.367417 --5.000000 24.000000 0.557578 0.301126 +5.000000 24.000000 0.421875 0.301126 +0.000000 24.000000 0.421875 0.367417 +0.000000 -23.000000 0.421875 0.908796 +5.000000 -7.000000 0.421875 0.643631 +24.000000 1.000000 0.421875 0.356369 +19.000000 6.000000 0.421875 0.356369 +-5.000000 -7.000000 0.421875 0.643631 +-19.000000 6.000000 0.421875 0.356369 +-24.000000 1.000000 0.421875 0.356369 +0.000000 -23.000000 0.421875 0.908796 +0.000000 24.000000 0.421875 0.367417 +-5.000000 24.000000 0.421875 0.301126 8 0 1 2 3 0 2 diff --git a/public/assets/noteskin/dance/tap/parts.png b/public/assets/noteskin/dance/tap/parts.png old mode 100755 new mode 100644 index 8ad457f8..fea12e6a Binary files a/public/assets/noteskin/dance/tap/parts.png and b/public/assets/noteskin/dance/tap/parts.png differ diff --git a/public/assets/noteskin/dance/tap/parts_old.png b/public/assets/noteskin/dance/tap/parts_old.png new file mode 100644 index 00000000..fe77caf3 Binary files /dev/null and b/public/assets/noteskin/dance/tap/parts_old.png differ diff --git a/src/chart/ChartManager.ts b/src/chart/ChartManager.ts index 007efd92..ea5b7cd3 100644 --- a/src/chart/ChartManager.ts +++ b/src/chart/ChartManager.ts @@ -32,6 +32,7 @@ import { TIMING_WINDOW_AUTOPLAY } from "./play/StandardTimingWindow" import { Chart } from "./sm/Chart" import { HoldNotedataEntry, + NoteType, Notedata, NotedataEntry, PartialHoldNotedataEntry, @@ -132,7 +133,6 @@ export class ChartManager { private holdEditing: (PartialHold | undefined)[] = [] private editNoteTypeIndex = 0 - private snapIndex = 0 private partialScroll = 0 private noteIndex = 0 private lastMetronomeDivision = -1 @@ -896,19 +896,30 @@ export class ChartManager { } previousSnap() { - this.snapIndex = (this.snapIndex - 1 + SNAPS.length) % SNAPS.length - Options.chart.snap = - SNAPS[this.snapIndex] == -1 ? 0 : 1 / SNAPS[this.snapIndex] + let curIndex = this.getSnapIndex() - 1 + curIndex = (curIndex + SNAPS.length) % SNAPS.length + Options.chart.snap = SNAPS[curIndex] == -1 ? 0 : 1 / SNAPS[curIndex] EventHandler.emit("snapChanged") } nextSnap() { - this.snapIndex = (this.snapIndex + 1 + SNAPS.length) % SNAPS.length - Options.chart.snap = - SNAPS[this.snapIndex] == -1 ? 0 : 1 / SNAPS[this.snapIndex] + let curIndex = this.getSnapIndex() + if ( + curIndex == SNAPS.length - 1 || + Math.abs(1 / Options.chart.snap - SNAPS[curIndex]) <= 0.0005 + ) { + curIndex++ + } + curIndex = (curIndex + SNAPS.length) % SNAPS.length + Options.chart.snap = SNAPS[curIndex] == -1 ? 0 : 1 / SNAPS[curIndex] EventHandler.emit("snapChanged") } + private getSnapIndex() { + if (Options.chart.snap == 0) return SNAPS.length - 1 + return SNAPS.findIndex(s => 1 / s <= Options.chart.snap) + } + private removeDuplicateBeats(arr: number[]): number[] { if (arr.length === 0) return arr const ret = [arr[0]] @@ -1086,7 +1097,7 @@ export class ChartManager { holdEdit.originalNote = { beat: beat, col: col, - type: this.getEditingNoteType(), + type: this.getEditingNoteType()!, } } this.getAssistTickIndex() @@ -1214,13 +1225,13 @@ export class ChartManager { (this.editNoteTypeIndex + 1 + numNoteTypes) % numNoteTypes } - getEditingNoteType(): string { + getEditingNoteType(): NoteType | null { return ( - this.loadedChart?.gameType.editNoteTypes[this.editNoteTypeIndex] ?? "" + this.loadedChart?.gameType.editNoteTypes[this.editNoteTypeIndex] ?? null ) } - setEditingNoteType(type: string) { + setEditingNoteType(type: NoteType) { if (!this.loadedChart) return const types = this.loadedChart?.gameType.editNoteTypes const index = types.indexOf(type) diff --git a/src/chart/ChartRenderer.ts b/src/chart/ChartRenderer.ts index 73ea23d1..c6c102ce 100644 --- a/src/chart/ChartRenderer.ts +++ b/src/chart/ChartRenderer.ts @@ -24,7 +24,7 @@ import { Waveform } from "./component/Waveform" import { Notefield } from "./gameTypes/base/Notefield" import { TimingWindow } from "./play/TimingWindow" import { Chart } from "./sm/Chart" -import { NotedataEntry } from "./sm/NoteTypes" +import { NoteType, NotedataEntry } from "./sm/NoteTypes" interface SelectionBounds { start: Point @@ -46,7 +46,7 @@ export class ChartRenderer extends Container< private lastMousePos?: Point private lastMouseBeat = -1 private lastMouseCol = -1 - private lastNoteType = "" + private lastNoteType: NoteType | null = null private editingCol = -1 private waveform: Waveform @@ -313,7 +313,7 @@ export class ChartRenderer extends Container< this.notefield.setGhostNote({ beat: snapBeat, col: this.lastMouseCol, - type: this.chartManager.getEditingNoteType(), + type: this.chartManager.getEditingNoteType()!, }) } } diff --git a/src/chart/component/SnapContainer.ts b/src/chart/component/SnapContainer.ts index 30dbfd21..757a45d8 100644 --- a/src/chart/component/SnapContainer.ts +++ b/src/chart/component/SnapContainer.ts @@ -10,17 +10,17 @@ const snapNumbers = { fill: ["#ffffff"], } -const SNAP_COLORS: { [key: number]: number } = { +export const QUANT_COLORS: { [key: number]: number } = { 4: 0xe74827, 8: 0x3d89f7, 12: 0xaa2df4, 16: 0x82e247, - 24: 0xaa2df4, + 24: 0xd82eab, 32: 0xeaa138, - 48: 0xaa2df4, + 48: 0xef8ceb, 64: 0x6be88e, - 96: 0x6be88e, - 192: 0x6be88e, + 96: 0x828282, + 192: 0x828282, } export class SnapContainer extends Container implements ChartRendererComponent { @@ -66,7 +66,7 @@ export class SnapContainer extends Container implements ChartRendererComponent { for (let i = 0; i < 2; i++) { const container = this.children[i] const square = container.children[0] as Graphics - square.tint = SNAP_COLORS[4 / Options.chart.snap] ?? 0x707070 + square.tint = QUANT_COLORS[4 / Options.chart.snap] ?? 0x707070 const text = container.children[1] as BitmapText text.text = "" + diff --git a/src/chart/gameTypes/GameTypeRegistry.ts b/src/chart/gameTypes/GameTypeRegistry.ts index dc38bc87..a93f88e0 100644 --- a/src/chart/gameTypes/GameTypeRegistry.ts +++ b/src/chart/gameTypes/GameTypeRegistry.ts @@ -1,4 +1,5 @@ import { ChartRenderer } from "../ChartRenderer" +import { NoteType } from "../sm/NoteTypes" import { GameLogic } from "./base/GameLogic" import { NotedataParser } from "./base/NotedataParser" import { Notefield } from "./base/Notefield" @@ -13,7 +14,7 @@ export interface GameType { gameLogic: GameLogic parser: NotedataParser notefield: new (renderer: ChartRenderer) => Notefield - editNoteTypes: string[] + editNoteTypes: NoteType[] flipColumns: { horizontal: number[] vertical: number[] diff --git a/src/chart/gameTypes/common/BasicNotedataParser.ts b/src/chart/gameTypes/common/BasicNotedataParser.ts index 30b3b9e4..788911d7 100644 --- a/src/chart/gameTypes/common/BasicNotedataParser.ts +++ b/src/chart/gameTypes/common/BasicNotedataParser.ts @@ -4,6 +4,7 @@ import { isHoldNote, Notedata, NotedataStats, + NoteType, PartialHoldNotedataEntry, PartialNotedata, PartialNotedataEntry, @@ -12,7 +13,7 @@ import { TimingData } from "../../sm/TimingData" import { NotedataParser } from "../base/NotedataParser" import { GameType } from "../GameTypeRegistry" -const NOTE_TYPE_LOOKUP: Record = { +const NOTE_TYPE_LOOKUP: Record = { "1": "Tap", "2": "Hold", "4": "Roll", @@ -21,7 +22,7 @@ const NOTE_TYPE_LOOKUP: Record = { L: "Lift", } -const NOTE_TYPE_LOOKUP_REV: Record = { +const NOTE_TYPE_LOOKUP_REV: Record = { Tap: "1", Hold: "2", Roll: "4", diff --git a/src/chart/gameTypes/dance/DanceNoteTexture.ts b/src/chart/gameTypes/dance/DanceNoteTexture.ts index b31451a9..31299a15 100644 --- a/src/chart/gameTypes/dance/DanceNoteTexture.ts +++ b/src/chart/gameTypes/dance/DanceNoteTexture.ts @@ -67,12 +67,12 @@ export class DanceNoteTexture { }) DanceNoteTexture.arrow_tex = RenderTexture.create({ width: 256, - height: 256, + height: 320, resolution: Options.performance.resolution, }) DanceNoteTexture.lift_tex = RenderTexture.create({ width: 256, - height: 256, + height: 320, resolution: Options.performance.resolution, }) DanceNoteTexture.mine_tex = RenderTexture.create({ @@ -124,7 +124,7 @@ export class DanceNoteTexture { this.arrow_frame = arrow_frame } { - for (let i = 0; i < 8; i++) { + for (let i = 0; i < 10; i++) { const shader_body = Shader.from( this.noop_vert, this.arrow_gradient_frag, @@ -146,7 +146,7 @@ export class DanceNoteTexture { } } { - for (let i = 0; i < 8; i++) { + for (let i = 0; i < 10; i++) { const shader_body = Shader.from( this.noop_vert, this.lift_gradient_frag, @@ -244,7 +244,7 @@ export class DanceNoteTexture { static setArrowTexTime(beat: number, second: number) { if (!this.loaded) return - for (let i = 0; i < 8; i++) { + for (let i = 0; i < 10; i++) { const tapShader: Mesh = DanceNoteTexture.arrow_container.getChildByName("body" + i)! tapShader.shader.uniforms.time = beat @@ -265,10 +265,7 @@ export class DanceNoteTexture { if (note.type == "Mine") { arrow.texture = DanceNoteTexture.mine_tex } else { - const i = Math.min( - getQuantIndex(timingData.getBeatOfMeasure(note.beat)), - 7 - ) + const i = getQuantIndex(timingData.getBeatOfMeasure(note.beat)) arrow.texture = new Texture( note.type == "Lift" ? DanceNoteTexture.lift_tex.baseTexture diff --git a/src/chart/sm/NoteTypes.ts b/src/chart/sm/NoteTypes.ts index e8ad4414..4678c8d3 100644 --- a/src/chart/sm/NoteTypes.ts +++ b/src/chart/sm/NoteTypes.ts @@ -2,10 +2,21 @@ export type Notedata = NotedataEntry[] export type PartialNotedata = PartialNotedataEntry[] +export const NOTE_TYPES = [ + "Tap", + "Hold", + "Roll", + "Mine", + "Lift", + "Fake", +] as const + +export type NoteType = (typeof NOTE_TYPES)[number] + export interface PartialTapNotedataEntry { beat: number col: number - type: string + type: NoteType } export interface PartialHoldNotedataEntry extends PartialTapNotedataEntry { diff --git a/src/data/KeybindData.ts b/src/data/KeybindData.ts index 8cd806e2..d184b580 100644 --- a/src/data/KeybindData.ts +++ b/src/data/KeybindData.ts @@ -766,6 +766,20 @@ export const KEYBIND_DATA: { [key: string]: Keybind } = { }) }, }, + convertNotesLifts: { + label: "Notes to lifts", + bindLabel: "Convert notes to lifts", + combos: [], + disabled: app => + app.chartManager.selection.notes.length == 0 || + app.chartManager.getMode() != EditMode.Edit, + callback: app => { + app.chartManager.modifySelection(note => { + note.type = "Lift" + return note + }) + }, + }, convertTapsFakes: { label: "Taps to fakes", bindLabel: "Convert taps to fakes", @@ -1097,4 +1111,108 @@ export const KEYBIND_DATA: { [key: string]: Keybind } = { Options.debug.showFPS = !Options.debug.showFPS }, }, + noteTypeTap: { + label: "Switch to Taps", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: app => { + app.chartManager.setEditingNoteType("Tap") + }, + }, + noteTypeLift: { + label: "Switch to Lifts", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: app => { + app.chartManager.setEditingNoteType("Lift") + }, + }, + noteTypeMine: { + label: "Switch to Mines", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: app => { + app.chartManager.setEditingNoteType("Mine") + }, + }, + noteTypeFake: { + label: "Switch to Fakes", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: app => { + app.chartManager.setEditingNoteType("Fake") + }, + }, + quant4: { + label: "Switch to 4ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 + }, + }, + quant8: { + label: "Switch to 8ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 2 + }, + }, + quant12: { + label: "Switch to 12ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 3 + }, + }, + quant16: { + label: "Switch to 16ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 4 + }, + }, + quant24: { + label: "Switch to 24ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 6 + }, + }, + quant32: { + label: "Switch to 32ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 8 + }, + }, + quant48: { + label: "Switch to 48ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 12 + }, + }, + quant96: { + label: "Switch to 96ths", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 24 + }, + }, + quant192: { + label: "Switch to 192nds", + combos: [], + disabled: app => !app.chartManager.chartView, + callback: () => { + Options.chart.snap = 1 / 48 + }, + }, } diff --git a/src/data/MenubarData.ts b/src/data/MenubarData.ts index eb366877..dc9d4a4f 100644 --- a/src/data/MenubarData.ts +++ b/src/data/MenubarData.ts @@ -329,6 +329,10 @@ export const MENUBAR_DATA: { [key: string]: MenuMain } = { type: "selection", id: "convertNotesMines", }, + { + type: "selection", + id: "convertNotesLifts", + }, { type: "selection", id: "convertTapsFakes", diff --git a/src/gui/widget/NoteLayoutWidget.ts b/src/gui/widget/NoteLayoutWidget.ts index c77a87db..6233c470 100644 --- a/src/gui/widget/NoteLayoutWidget.ts +++ b/src/gui/widget/NoteLayoutWidget.ts @@ -6,21 +6,17 @@ import { Texture, } from "pixi.js" import { EditMode } from "../../chart/ChartManager" +import { QUANT_COLORS } from "../../chart/component/SnapContainer" import { Chart } from "../../chart/sm/Chart" import { isHoldNote } from "../../chart/sm/NoteTypes" import { BetterRoundedRect } from "../../util/BetterRoundedRect" import { EventHandler } from "../../util/EventHandler" import { clamp, lerp, unlerp } from "../../util/Math" import { Options } from "../../util/Options" -import { destroyChildIf, getQuantIndex } from "../../util/Util" +import { destroyChildIf, getDivision } from "../../util/Util" import { Widget } from "./Widget" import { WidgetManager } from "./WidgetManager" -const QUANT_COLORS = [ - 0xe74827, 0x3d89f7, 0xaa2df4, 0x82e247, 0xaa2df4, 0xeaa138, 0xaa2df4, - 0x6be88e, 0x6be88e, 0x6be88e, -] - export class NoteLayoutWidget extends Widget { barContainer = new ParticleContainer( 1500, @@ -223,7 +219,7 @@ export class NoteLayoutWidget extends Widget { let t = unlerp(0, lastBeat, note.beat) if (Options.chart.CMod) t = unlerp(songOffset, lastSecond, note.second) obj.y = t * height - obj.tint = QUANT_COLORS[getQuantIndex(note.beat)] + obj.tint = QUANT_COLORS[getDivision(note.beat)] if (note.type == "Mine") obj.tint = 0x808080 childIndex++ if (isHoldNote(note)) { diff --git a/src/gui/window/KeybindWindow.ts b/src/gui/window/KeybindWindow.ts index 2293e9d0..72e7fbf8 100644 --- a/src/gui/window/KeybindWindow.ts +++ b/src/gui/window/KeybindWindow.ts @@ -8,11 +8,45 @@ import { Dropdown } from "../element/Dropdown" import { KeyComboWindow } from "./KeyComboWindow" import { Window } from "./Window" +interface KeybindInserts { + ids: string[] + after?: string +} + const KEYBIND_BLACKLIST = ["cut", "copy", "paste", "undo", "redo", "delete"] -const KEYBIND_INSERTS: Record = { - edit: ["previousNoteType", "nextNoteType"], - view: ["playback", "selectRegion"], - debug: ["showFPSCounter", "showDebugTimers"], +const KEYBIND_INSERTS: Record = { + edit: [ + { + ids: [ + "previousNoteType", + "nextNoteType", + "noteTypeTap", + "noteTypeMine", + "noteTypeFake", + "noteTypeLift", + "quant4", + "quant8", + "quant12", + "quant16", + "quant24", + "quant32", + "quant48", + "quant96", + "quant192", + ], + after: "mousePlacement", + }, + ], + view: [ + { + ids: ["playback", "selectRegion"], + }, + ], + debug: [ + { + ids: ["showFPSCounter", "showDebugTimers"], + }, + ], } export class KeybindWindow extends Window { @@ -154,10 +188,15 @@ export class KeybindWindow extends Window { }) Object.keys(KEYBIND_INSERTS).forEach(id => { if (GROUPS[id] === undefined) GROUPS[id] = [] - GROUPS[id].unshift(...KEYBIND_INSERTS[id]) - KEYBIND_INSERTS[id].forEach(option => { - const idx = missingKeybindTest.indexOf(option) - if (idx != -1) missingKeybindTest.splice(idx, 1) + KEYBIND_INSERTS[id].forEach(insert => { + const insertIndex = !insert.after + ? 0 + : GROUPS[id].findIndex(id => insert.after == id) + 1 ?? 0 + GROUPS[id].splice(insertIndex, 0, ...insert.ids) + insert.ids.forEach(option => { + const idx = missingKeybindTest.indexOf(option) + if (idx != -1) missingKeybindTest.splice(idx, 1) + }) }) }) KEYBIND_BLACKLIST.forEach(option => { diff --git a/src/util/Ascii85.ts b/src/util/Ascii85.ts index c00b0f5a..953f2baa 100644 --- a/src/util/Ascii85.ts +++ b/src/util/Ascii85.ts @@ -1,5 +1,5 @@ -import { PartialNotedata, isHoldNote } from "../chart/sm/NoteTypes" -import { TimingEventProperty, TimingEvent } from "../chart/sm/TimingTypes" +import { NoteType, PartialNotedata, isHoldNote } from "../chart/sm/NoteTypes" +import { TimingEvent, TimingEventProperty } from "../chart/sm/TimingTypes" import { roundDigit } from "./Math" const _a85chars = Array(85) @@ -151,6 +151,8 @@ export function packValue(value: number): number[] { return bytes } +const noteTypeOrder: NoteType[] = ["Hold", "Mine", "Roll", "Lift", "Fake"] + export function decodeNotes(data: string): PartialNotedata | undefined { if (data.startsWith("ArrowVortex:notes:")) { const decoded = a85decode(data.slice(18)) @@ -169,7 +171,7 @@ export function decodeNotes(data: string): PartialNotedata | undefined { const type = data_arr.shift() if (type == undefined || type > 4) continue - const noteType = ["Hold", "Mine", "Roll", "Lift", "Fake"][type] + const noteType = noteTypeOrder[type] if (start == end) { if (noteType == "Hold" || noteType == "Roll") continue noteList.push({