diff --git a/packages/core/src/beatmap/BeatmapInfo.ts b/packages/core/src/beatmap/BeatmapInfo.ts index 4d7e1903..34c013fd 100644 --- a/packages/core/src/beatmap/BeatmapInfo.ts +++ b/packages/core/src/beatmap/BeatmapInfo.ts @@ -1,5 +1,7 @@ import type { SharedStructure } from '@osucad/multiplayer'; +import { BindableNumber } from '@osucad/framework'; import { SharedObject } from '@osucad/multiplayer'; +import { BindableBeatDivisor } from '../editor/BindableBeatDivisor'; import { RulesetInfo } from '../rulesets/RulesetInfo'; import { BeatmapDifficultyInfo } from './BeatmapDifficultyInfo'; import { BeatmapMetadata } from './BeatmapMetadata'; @@ -149,32 +151,24 @@ export class BeatmapInfo extends SharedObject { this.#distanceSpacing.value = value; } - readonly #beatDivisor = this.property('beatDivisor', 4); - - get beatDivisorBindable() { - return this.#beatDivisor.bindable; - } + readonly beatDivisorBindable = new BindableBeatDivisor(4); get beatDivisor() { - return this.#beatDivisor.value; + return this.beatDivisorBindable.value; } set beatDivisor(value) { - this.#beatDivisor.value = value; + this.beatDivisorBindable.value = value; } - readonly #gridSize = this.property('gridSize', 0); - - get gridSizeBindable() { - return this.#gridSize.bindable; - } + readonly gridSizeBindable = new BindableNumber(0); get gridSize() { - return this.#gridSize.value; + return this.gridSizeBindable.value; } set gridSize(value) { - this.#gridSize.value = value; + this.gridSizeBindable.value = value; } readonly #timelineZoom = this.property('timelineZoom', 1); diff --git a/packages/core/src/editor/BindableBeatDivisor.ts b/packages/core/src/editor/BindableBeatDivisor.ts index 006e1a88..0ea21b6f 100644 --- a/packages/core/src/editor/BindableBeatDivisor.ts +++ b/packages/core/src/editor/BindableBeatDivisor.ts @@ -5,6 +5,10 @@ import { OsucadColors } from '../OsucadColors'; export class BindableBeatDivisor extends BindableNumber { constructor(value: number = 1) { super(value); + + this.minValue = 1; + this.maxValue = 16; + this.precision = 1; } static readonly PREDEFINED_DIVISORS = [1, 2, 3, 4, 6, 8, 12, 16];