Skip to content

Commit

Permalink
feat: support for alpha, pos, size, and y controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Naptie committed Dec 24, 2024
1 parent 4211857 commit 934d4ca
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 47 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"mathjs": "^14.0.0",
"mime": "^4.0.4",
"phaser": "^3.87.0",
"phaser3-rex-plugins": "^1.80.12",
"query-string": "^9.1.1",
"wavesurfer.js": "^7.8.11"
}
Expand Down
140 changes: 140 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions src/player/objects/Line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import {
getIntegral,
getLineColor,
getTimeSec,
getValue,
getEventValue,
processEvents,
rgbToHex,
toBeats,
processControlNodes,
} from '../utils';
import type { Game } from '../scenes/Game';
import { FONT_FAMILY } from '../constants';
Expand Down Expand Up @@ -145,6 +146,12 @@ export class Line {
processEvents(this._data.extended.textEvents);
}

processControlNodes(this._data.alphaControl);
processControlNodes(this._data.posControl);
processControlNodes(this._data.sizeControl);
processControlNodes(this._data.skewControl);
processControlNodes(this._data.yControl);

if (this._data.notes) {
// this._holdContainer = this.createContainer(3);
// this._dragContainer = this.createContainer(4);
Expand Down Expand Up @@ -429,7 +436,7 @@ export class Line {
) {
return undefined;
}
return getValue(beat, events[cur[layerIndex]]);
return getEventValue(beat, events[cur[layerIndex]]);
} else {
return undefined;
}
Expand Down Expand Up @@ -491,13 +498,9 @@ export class Line {
gif: this.handleEvent(beat, layerIndex, extended.gifEvents, this._curGif, false) as
| number
| undefined,
incline: this.handleEvent(
beat,
layerIndex,
extended.inclineEvents,
this._curIncline,
false,
) as number | undefined,
incline: this.handleEvent(beat, layerIndex, extended.inclineEvents, this._curIncline) as
| number
| undefined,
scaleX: this.handleEvent(beat, layerIndex, extended.scaleXEvents, this._curScaleX) as
| number
| undefined,
Expand Down
Loading

0 comments on commit 934d4ca

Please sign in to comment.