sonolus-pjsekai-js 1.2.7 → 1.2.8

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
@@ -166,6 +166,12 @@ Converts USC (Universal Sekai Chart) to Level Data.
166
166
  - `usc`: usc chart.
167
167
  - `offset`: offset (default: `0`).
168
168
 
169
+ ### `uscToUSC(usc)`
170
+
171
+ Converts MMW usc chart to USC (Universal Sekai Chart).
172
+
173
+ - `usc`: usc chart.
174
+
169
175
  ### Assets
170
176
 
171
177
  The following assets are exposed as package entry points:
Binary file
Binary file
package/dist/index.cjs CHANGED
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "uscToLevelData", { enumerable: true, get: functi
22
22
  __exportStar(require("./usc/index.cjs"), exports);
23
23
  var revert_cjs_1 = require("./usc/revert.cjs");
24
24
  Object.defineProperty(exports, "uscToUSC", { enumerable: true, get: function () { return revert_cjs_1.uscToUSC; } });
25
- exports.version = '1.2.7';
25
+ exports.version = '1.2.8';
26
26
  exports.databaseEngineItem = {
27
27
  name: 'prosekaR',
28
28
  version: 13,
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@ export { susToUSC } from './sus/convert.cjs';
2
2
  export { uscToLevelData } from './usc/convert.cjs';
3
3
  export * from './usc/index.cjs';
4
4
  export { uscToUSC } from './usc/revert.cjs';
5
- export declare const version = "1.2.7";
5
+ export declare const version = "1.2.8";
6
6
  export declare const databaseEngineItem: {
7
7
  readonly name: "prosekaR";
8
8
  readonly version: 13;
@@ -68,6 +68,17 @@ const uscToLevelData = (usc, offset = 0) => {
68
68
  data: {},
69
69
  sim: false,
70
70
  });
71
+ let lastBeat = 0;
72
+ for (const object of usc.objects) {
73
+ if ('beat' in object && typeof object.beat === 'number') {
74
+ lastBeat = Math.max(lastBeat, object.beat);
75
+ }
76
+ if (object.type === 'slide') {
77
+ for (const connection of object.connections) {
78
+ lastBeat = Math.max(lastBeat, connection.beat);
79
+ }
80
+ }
81
+ }
71
82
  for (const object of usc.objects) {
72
83
  handlers[object.type](object, append);
73
84
  }
@@ -83,6 +94,13 @@ const uscToLevelData = (usc, offset = 0) => {
83
94
  });
84
95
  }
85
96
  }
97
+ append({
98
+ archetype: 'lastTimeChecker',
99
+ data: {
100
+ [core_1.EngineArchetypeDataName.Beat]: lastBeat,
101
+ },
102
+ sim: false,
103
+ });
86
104
  return {
87
105
  bgmOffset: usc.offset + offset,
88
106
  entities,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-pjsekai-js",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "A recreation of Project Sekai: Colorful Stage! engine in Sonolus",
5
5
  "type": "module",
6
6
  "files": [