sonolus-voez-engine 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,6 +63,14 @@ Engine Play Data.
63
63
  - `enginePlayData.buffer`: buffer of file.
64
64
  - `enginePlayData.hash`: hash of file.
65
65
 
66
+ ### `enginePreviewData`
67
+
68
+ Engine Preview Data.
69
+
70
+ - `enginePreviewData.path`: path to file.
71
+ - `enginePreviewData.buffer`: buffer of file.
72
+ - `enginePreviewData.hash`: hash of file.
73
+
66
74
  ### `engineTutorialData`
67
75
 
68
76
  Engine Tutorial Data.
Binary file
Binary file
Binary file
package/dist/index.cjs CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.engineThumbnail = exports.engineTutorialData = exports.enginePlayData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.vsToVC = exports.vcToLevelData = void 0;
17
+ exports.engineThumbnail = exports.engineTutorialData = exports.enginePreviewData = exports.enginePlayData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.vsToVC = exports.vcToLevelData = void 0;
18
18
  const Resource_cjs_1 = require("./Resource.cjs");
19
19
  var convert_cjs_1 = require("./vc/convert.cjs");
20
20
  Object.defineProperty(exports, "vcToLevelData", { enumerable: true, get: function () { return convert_cjs_1.vcToLevelData; } });
@@ -22,10 +22,10 @@ __exportStar(require("./vc/index.cjs"), exports);
22
22
  var convert_cjs_2 = require("./vs/convert.cjs");
23
23
  Object.defineProperty(exports, "vsToVC", { enumerable: true, get: function () { return convert_cjs_2.vsToVC; } });
24
24
  __exportStar(require("./vs/index.cjs"), exports);
25
- exports.version = '1.1.0';
25
+ exports.version = '1.2.0';
26
26
  exports.engineInfo = {
27
27
  name: 'voez',
28
- version: 9,
28
+ version: 10,
29
29
  title: {
30
30
  en: 'VOEZ',
31
31
  },
@@ -49,5 +49,6 @@ exports.engineInfo = {
49
49
  };
50
50
  exports.engineConfiguration = new Resource_cjs_1.Resource('EngineConfiguration');
51
51
  exports.enginePlayData = new Resource_cjs_1.Resource('EnginePlayData');
52
+ exports.enginePreviewData = new Resource_cjs_1.Resource('EnginePreviewData');
52
53
  exports.engineTutorialData = new Resource_cjs_1.Resource('EngineTutorialData');
53
54
  exports.engineThumbnail = new Resource_cjs_1.Resource('thumbnail.png');
package/dist/index.d.cts CHANGED
@@ -3,10 +3,10 @@ export { vcToLevelData } from './vc/convert.cjs';
3
3
  export * from './vc/index.cjs';
4
4
  export { vsToVC } from './vs/convert.cjs';
5
5
  export * from './vs/index.cjs';
6
- export declare const version = "1.1.0";
6
+ export declare const version = "1.2.0";
7
7
  export declare const engineInfo: {
8
8
  readonly name: "voez";
9
- readonly version: 9;
9
+ readonly version: 10;
10
10
  readonly title: {
11
11
  readonly en: "VOEZ";
12
12
  };
@@ -22,5 +22,6 @@ export declare const engineInfo: {
22
22
  };
23
23
  export declare const engineConfiguration: Resource;
24
24
  export declare const enginePlayData: Resource;
25
+ export declare const enginePreviewData: Resource;
25
26
  export declare const engineTutorialData: Resource;
26
27
  export declare const engineThumbnail: Resource;
@@ -72,38 +72,53 @@ const vcToLevelData = (vc, offset = 0) => {
72
72
  }
73
73
  for (const track of vc.tracks) {
74
74
  const ref = next();
75
+ const data = {
76
+ x: track.x,
77
+ w: track.w,
78
+ c: track.c,
79
+ startBeat: track.startBeat,
80
+ endBeat: track.endBeat,
81
+ animateStart: +track.animateStart,
82
+ };
83
+ const addCommands = (commands, archetype, dataName) => {
84
+ const entities = commands.map((command) => ({
85
+ ref: next(),
86
+ archetype,
87
+ data: {
88
+ trackRef: ref,
89
+ startBeat: command.startBeat,
90
+ startValue: command.startValue,
91
+ endBeat: command.endBeat,
92
+ endValue: command.endValue,
93
+ ease: ease.indexOf(command.ease),
94
+ },
95
+ }));
96
+ if (entities.length) {
97
+ data[dataName] = entities[0].ref;
98
+ }
99
+ for (const [index, entity] of entities.entries()) {
100
+ if (index === entities.length - 1) {
101
+ add(entity);
102
+ }
103
+ else {
104
+ add({
105
+ ...entity,
106
+ data: {
107
+ ...entity.data,
108
+ nextRef: entities[index + 1].ref,
109
+ },
110
+ });
111
+ }
112
+ }
113
+ };
114
+ addCommands(track.moveCommands, 'TrackMoveCommand', 'moveRef');
115
+ addCommands(track.scaleCommands, 'TrackScaleCommand', 'scaleRef');
116
+ addCommands(track.colorCommands, 'TrackColorCommand', 'colorRef');
75
117
  add({
76
118
  ref,
77
119
  archetype: 'Track',
78
- data: {
79
- x: track.x,
80
- w: track.w,
81
- c: track.c,
82
- startBeat: track.startBeat,
83
- endBeat: track.endBeat,
84
- animateStart: +track.animateStart,
85
- },
86
- });
87
- const addCommand = (archetype, command) => add({
88
- archetype,
89
- data: {
90
- trackRef: ref,
91
- startBeat: command.startBeat,
92
- startValue: command.startValue,
93
- endBeat: command.endBeat,
94
- endValue: command.endValue,
95
- ease: ease.indexOf(command.ease),
96
- },
120
+ data,
97
121
  });
98
- for (const command of track.moveCommands) {
99
- addCommand('TrackMoveCommand', command);
100
- }
101
- for (const command of track.scaleCommands) {
102
- addCommand('TrackScaleCommand', command);
103
- }
104
- for (const command of track.colorCommands) {
105
- addCommand('TrackColorCommand', command);
106
- }
107
122
  for (const note of track.notes) {
108
123
  switch (note.type) {
109
124
  case 'tap':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-voez-engine",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A recreation of VOEZ engine in Sonolus",
5
5
  "author": "NonSpicyBurrito",
6
6
  "repository": "github:NonSpicyBurrito/sonolus-voez-engine",
@@ -13,24 +13,24 @@
13
13
  "dist"
14
14
  ],
15
15
  "scripts": {
16
- "dev:play": "sonolus-cli --dev ./play/sonolus-cli.config.mjs",
17
- "dev:tutorial": "sonolus-cli --dev ./tutorial/sonolus-cli.config.mjs",
18
- "prebuild": "tsc -p ./lib --noEmit && tsc -p ./shared --noEmit && tsc -p ./play --noEmit && tsc -p ./tutorial --noEmit && eslint --ext .cts ./lib && eslint --ext .mts ./shared && eslint --ext .mts ./play && eslint --ext .mts ./tutorial",
19
- "build": "tsc -p ./lib && sonolus-cli --build ./play/sonolus-cli.config.mjs && sonolus-cli --build ./tutorial/sonolus-cli.config.mjs && node ./lib/build.mjs"
16
+ "dev:play": "sonolus-cli --dev ./play",
17
+ "dev:preview": "sonolus-cli --dev ./preview",
18
+ "dev:tutorial": "sonolus-cli --dev ./tutorial",
19
+ "prebuild": "tsc -p ./lib --noEmit && tsc -p ./shared --noEmit && tsc -p ./play --noEmit && tsc -p ./preview --noEmit && tsc -p ./tutorial --noEmit && eslint . && prettier . --check",
20
+ "build": "tsc -p ./lib && sonolus-cli --build ./play && sonolus-cli --build ./preview && sonolus-cli --build ./tutorial && node ./lib/build.mjs"
20
21
  },
21
22
  "dependencies": {
22
- "sonolus-core": "~7.2.0"
23
+ "sonolus-core": "~7.3.0"
23
24
  },
24
25
  "devDependencies": {
25
- "@types/node": "^16.18.40",
26
- "@typescript-eslint/eslint-plugin": "^6.3.0",
27
- "@typescript-eslint/parser": "^6.3.0",
28
- "eslint": "^8.47.0",
26
+ "@types/node": "^16.18.48",
27
+ "@typescript-eslint/eslint-plugin": "^6.5.0",
28
+ "@typescript-eslint/parser": "^6.5.0",
29
+ "eslint": "^8.48.0",
29
30
  "eslint-config-prettier": "^9.0.0",
30
- "eslint-plugin-prettier": "^5.0.0",
31
- "prettier": "^3.0.1",
31
+ "prettier": "^3.0.3",
32
32
  "prettier-plugin-organize-imports": "^3.2.3",
33
- "sonolus.js": "~9.1.0",
34
- "typescript": "~5.1.6"
33
+ "sonolus.js": "~9.2.0",
34
+ "typescript": "~5.2.2"
35
35
  }
36
36
  }