sonolus-llsif-engine 1.0.0-beta.0 → 1.0.1
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/LICENSE.txt +21 -0
- package/README.md +69 -0
- package/dist/EngineData +0 -0
- package/dist/index.cjs +17 -1
- package/dist/index.d.cts +3 -1
- package/dist/nss/convert.cjs +12 -13
- package/dist/nss/convert.d.cts +2 -2
- package/dist/nss/index.cjs +2 -2
- package/dist/nss/index.d.cts +5 -5
- package/dist/sifc/convert.cjs +5 -5
- package/dist/sifc/convert.d.cts +2 -2
- package/dist/sifc/index.d.cts +12 -13
- package/package.json +8 -8
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 NonSpicyBurrito
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Sonolus LLSIF Engine
|
|
2
|
+
|
|
3
|
+
A recreation of Love Live! School idol festival engine in [Sonolus](https://sonolus.com).
|
|
4
|
+
|
|
5
|
+
## Links
|
|
6
|
+
|
|
7
|
+
- [Sonolus Website](https://sonolus.com)
|
|
8
|
+
- [Sonolus Wiki](https://github.com/NonSpicyBurrito/sonolus-wiki)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
npm install sonolus-llsif-engine
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Custom Resources
|
|
17
|
+
|
|
18
|
+
### Skin Sprites
|
|
19
|
+
|
|
20
|
+
| Name |
|
|
21
|
+
| ------------------------- |
|
|
22
|
+
| `LLSIF Connection Active` |
|
|
23
|
+
|
|
24
|
+
## Documentation
|
|
25
|
+
|
|
26
|
+
### `version`
|
|
27
|
+
|
|
28
|
+
Package version.
|
|
29
|
+
|
|
30
|
+
### `engineInfo`
|
|
31
|
+
|
|
32
|
+
Partial engine information compatible with [sonolus-express](https://github.com/NonSpicyBurrito/sonolus-express).
|
|
33
|
+
|
|
34
|
+
### `engineConfiguration`
|
|
35
|
+
|
|
36
|
+
Engine Configuration.
|
|
37
|
+
|
|
38
|
+
- `engineConfiguration.path`: path to file.
|
|
39
|
+
- `engineConfiguration.buffer`: buffer of file.
|
|
40
|
+
- `engineConfiguration.hash`: hash of file.
|
|
41
|
+
|
|
42
|
+
### `engineData`
|
|
43
|
+
|
|
44
|
+
Engine Data.
|
|
45
|
+
|
|
46
|
+
- `engineData.path`: path to file.
|
|
47
|
+
- `engineData.buffer`: buffer of file.
|
|
48
|
+
- `engineData.hash`: hash of file.
|
|
49
|
+
|
|
50
|
+
### `engineThumbnail`
|
|
51
|
+
|
|
52
|
+
Engine Thumbnail.
|
|
53
|
+
|
|
54
|
+
- `engineThumbnail.path`: path to file.
|
|
55
|
+
- `engineThumbnail.buffer`: buffer of file.
|
|
56
|
+
- `engineThumbnail.hash`: hash of file.
|
|
57
|
+
|
|
58
|
+
### `nssToSIFC(nss)`
|
|
59
|
+
|
|
60
|
+
Converts NSS (note setting asset) to SIFC (SIF Chart).
|
|
61
|
+
|
|
62
|
+
- `nss`: note setting asset.
|
|
63
|
+
|
|
64
|
+
### `sifcToLevelData(chart, offset?)`
|
|
65
|
+
|
|
66
|
+
Converts SIFC (SIF Chart) to Level Data.
|
|
67
|
+
|
|
68
|
+
- `chart`: SIF Chart.
|
|
69
|
+
- `offset`: offset (default: `0`).
|
package/dist/EngineData
CHANGED
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.engineThumbnail = exports.engineData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.sifcToLevelData = exports.nssToSIFC = void 0;
|
|
4
18
|
const Resource_cjs_1 = require("./Resource.cjs");
|
|
5
19
|
var convert_cjs_1 = require("./nss/convert.cjs");
|
|
6
20
|
Object.defineProperty(exports, "nssToSIFC", { enumerable: true, get: function () { return convert_cjs_1.nssToSIFC; } });
|
|
21
|
+
__exportStar(require("./nss/index.cjs"), exports);
|
|
7
22
|
var convert_cjs_2 = require("./sifc/convert.cjs");
|
|
8
23
|
Object.defineProperty(exports, "sifcToLevelData", { enumerable: true, get: function () { return convert_cjs_2.sifcToLevelData; } });
|
|
9
|
-
|
|
24
|
+
__exportStar(require("./sifc/index.cjs"), exports);
|
|
25
|
+
exports.version = '1.0.1';
|
|
10
26
|
exports.engineInfo = {
|
|
11
27
|
name: 'llsif',
|
|
12
28
|
version: 8,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Resource } from './Resource.cjs';
|
|
2
2
|
export { nssToSIFC } from './nss/convert.cjs';
|
|
3
|
+
export * from './nss/index.cjs';
|
|
3
4
|
export { sifcToLevelData } from './sifc/convert.cjs';
|
|
4
|
-
export
|
|
5
|
+
export * from './sifc/index.cjs';
|
|
6
|
+
export declare const version = "1.0.1";
|
|
5
7
|
export declare const engineInfo: {
|
|
6
8
|
readonly name: "llsif";
|
|
7
9
|
readonly version: 8;
|
package/dist/nss/convert.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const index_cjs_1 = require("./index.cjs");
|
|
|
5
5
|
const nssToSIFC = (nss) => {
|
|
6
6
|
const objects = [
|
|
7
7
|
{
|
|
8
|
-
type: '
|
|
8
|
+
type: 'bpm',
|
|
9
9
|
beat: 0,
|
|
10
10
|
bpm: 60,
|
|
11
11
|
},
|
|
@@ -15,18 +15,18 @@ const nssToSIFC = (nss) => {
|
|
|
15
15
|
const beat = note.timing_sec;
|
|
16
16
|
const lane = 5 - note.position;
|
|
17
17
|
switch (note.effect) {
|
|
18
|
-
case index_cjs_1.
|
|
19
|
-
case index_cjs_1.
|
|
20
|
-
case index_cjs_1.
|
|
18
|
+
case index_cjs_1.NSSNoteEffect.Tap1:
|
|
19
|
+
case index_cjs_1.NSSNoteEffect.Tap2:
|
|
20
|
+
case index_cjs_1.NSSNoteEffect.Tap4:
|
|
21
21
|
objects.push({
|
|
22
|
-
type: '
|
|
22
|
+
type: 'tap',
|
|
23
23
|
beat,
|
|
24
24
|
lane,
|
|
25
25
|
});
|
|
26
26
|
break;
|
|
27
|
-
case index_cjs_1.
|
|
27
|
+
case index_cjs_1.NSSNoteEffect.TapHold:
|
|
28
28
|
objects.push({
|
|
29
|
-
type: '
|
|
29
|
+
type: 'tap',
|
|
30
30
|
beat,
|
|
31
31
|
lane,
|
|
32
32
|
hold: {
|
|
@@ -34,8 +34,8 @@ const nssToSIFC = (nss) => {
|
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
36
|
break;
|
|
37
|
-
case index_cjs_1.
|
|
38
|
-
case index_cjs_1.
|
|
37
|
+
case index_cjs_1.NSSNoteEffect.Swing:
|
|
38
|
+
case index_cjs_1.NSSNoteEffect.SwingHold: {
|
|
39
39
|
const notes = swings.get(note.notes_level);
|
|
40
40
|
if (notes) {
|
|
41
41
|
notes.push(note);
|
|
@@ -62,9 +62,9 @@ const nssToSIFC = (nss) => {
|
|
|
62
62
|
? 'Right'
|
|
63
63
|
: 'Left'
|
|
64
64
|
: 'Left';
|
|
65
|
-
if (note.effect === index_cjs_1.
|
|
65
|
+
if (note.effect === index_cjs_1.NSSNoteEffect.Swing) {
|
|
66
66
|
objects.push({
|
|
67
|
-
type: '
|
|
67
|
+
type: 'swing',
|
|
68
68
|
beat,
|
|
69
69
|
lane,
|
|
70
70
|
direction,
|
|
@@ -72,7 +72,7 @@ const nssToSIFC = (nss) => {
|
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
74
|
objects.push({
|
|
75
|
-
type: '
|
|
75
|
+
type: 'swing',
|
|
76
76
|
beat,
|
|
77
77
|
lane,
|
|
78
78
|
direction,
|
|
@@ -85,7 +85,6 @@ const nssToSIFC = (nss) => {
|
|
|
85
85
|
}
|
|
86
86
|
return {
|
|
87
87
|
attribute: nss[0].notes_attribute - 1,
|
|
88
|
-
offset: 0,
|
|
89
88
|
objects,
|
|
90
89
|
};
|
|
91
90
|
};
|
package/dist/nss/convert.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SIFC } from '../sifc/index.cjs';
|
|
2
2
|
import { NSS } from './index.cjs';
|
|
3
|
-
export declare const nssToSIFC: (nss: NSS) =>
|
|
3
|
+
export declare const nssToSIFC: (nss: NSS) => SIFC;
|
package/dist/nss/index.cjs
CHANGED
package/dist/nss/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type NSS =
|
|
2
|
-
export declare const
|
|
1
|
+
export type NSS = NSSNote[];
|
|
2
|
+
export declare const NSSNoteEffect: {
|
|
3
3
|
readonly Tap1: 1;
|
|
4
4
|
readonly Tap2: 2;
|
|
5
5
|
readonly Tap4: 4;
|
|
@@ -7,12 +7,12 @@ export declare const NoteEffect: {
|
|
|
7
7
|
readonly Swing: 11;
|
|
8
8
|
readonly SwingHold: 13;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
10
|
+
export type NSSNoteEffect = (typeof NSSNoteEffect)[keyof typeof NSSNoteEffect];
|
|
11
|
+
export type NSSNote = {
|
|
12
12
|
timing_sec: number;
|
|
13
13
|
position: number;
|
|
14
14
|
notes_attribute: number;
|
|
15
15
|
notes_level: number;
|
|
16
|
-
effect:
|
|
16
|
+
effect: NSSNoteEffect;
|
|
17
17
|
effect_value: number;
|
|
18
18
|
};
|
package/dist/sifc/convert.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sifcToLevelData = void 0;
|
|
4
4
|
const sonolus_core_1 = require("sonolus-core");
|
|
5
|
-
function sifcToLevelData(chart) {
|
|
5
|
+
function sifcToLevelData(chart, offset = 0) {
|
|
6
6
|
const entities = [];
|
|
7
7
|
const beatToIntermediates = new Map();
|
|
8
8
|
const intermediateToRef = new Map();
|
|
@@ -90,7 +90,7 @@ function sifcToLevelData(chart) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return {
|
|
93
|
-
bgmOffset:
|
|
93
|
+
bgmOffset: offset,
|
|
94
94
|
entities,
|
|
95
95
|
};
|
|
96
96
|
}
|
|
@@ -158,7 +158,7 @@ const hold = (head, beat, append) => {
|
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
160
|
const handlers = {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
bpm,
|
|
162
|
+
tap,
|
|
163
|
+
swing,
|
|
164
164
|
};
|
package/dist/sifc/convert.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LevelData } from 'sonolus-core';
|
|
2
|
-
import {
|
|
3
|
-
export declare function sifcToLevelData(chart:
|
|
2
|
+
import { SIFC } from './index.cjs';
|
|
3
|
+
export declare function sifcToLevelData(chart: SIFC, offset?: number): LevelData;
|
package/dist/sifc/index.d.cts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
export type
|
|
2
|
-
offset: number;
|
|
1
|
+
export type SIFC = {
|
|
3
2
|
attribute: number;
|
|
4
|
-
objects:
|
|
3
|
+
objects: SIFCObject[];
|
|
5
4
|
};
|
|
6
|
-
export type
|
|
7
|
-
type
|
|
5
|
+
export type SIFCObject = SIFCBPMChangeObject | SIFCTapNote | SIFCSwingNote;
|
|
6
|
+
type BaseSIFCObject = {
|
|
8
7
|
beat: number;
|
|
9
8
|
};
|
|
10
|
-
export type
|
|
11
|
-
type: '
|
|
9
|
+
export type SIFCBPMChangeObject = BaseSIFCObject & {
|
|
10
|
+
type: 'bpm';
|
|
12
11
|
bpm: number;
|
|
13
12
|
};
|
|
14
|
-
type
|
|
13
|
+
type BaseSIFCNote = BaseSIFCObject & {
|
|
15
14
|
lane: number;
|
|
16
|
-
hold?:
|
|
15
|
+
hold?: BaseSIFCObject;
|
|
17
16
|
};
|
|
18
|
-
export type
|
|
19
|
-
type: '
|
|
17
|
+
export type SIFCTapNote = BaseSIFCNote & {
|
|
18
|
+
type: 'tap';
|
|
20
19
|
};
|
|
21
|
-
export type
|
|
22
|
-
type: '
|
|
20
|
+
export type SIFCSwingNote = BaseSIFCNote & {
|
|
21
|
+
type: 'swing';
|
|
23
22
|
direction: 'Left' | 'Right';
|
|
24
23
|
};
|
|
25
24
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonolus-llsif-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A recreation of Love Live! School idol festival engine in Sonolus",
|
|
5
5
|
"author": "NonSpicyBurrito",
|
|
6
6
|
"repository": "github:NonSpicyBurrito/sonolus-llsif-engine",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"build": "tsc -p ./lib/tsconfig.json && sonolus-cli --build && node ./lib/build.mjs"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/node": "^16.18.
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "^5.59.
|
|
23
|
-
"@typescript-eslint/parser": "^5.59.
|
|
24
|
-
"eslint": "^8.
|
|
21
|
+
"@types/node": "^16.18.36",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
23
|
+
"@typescript-eslint/parser": "^5.59.11",
|
|
24
|
+
"eslint": "^8.42.0",
|
|
25
25
|
"eslint-config-prettier": "^8.8.0",
|
|
26
26
|
"eslint-plugin-prettier": "^4.2.1",
|
|
27
27
|
"prettier": "^2.8.8",
|
|
28
28
|
"prettier-plugin-organize-imports": "^3.2.2",
|
|
29
|
-
"sonolus-core": "~7.0.0
|
|
30
|
-
"sonolus.js": "~9.0.0
|
|
31
|
-
"typescript": "~5.
|
|
29
|
+
"sonolus-core": "~7.0.0",
|
|
30
|
+
"sonolus.js": "~9.0.0",
|
|
31
|
+
"typescript": "~5.1.3"
|
|
32
32
|
}
|
|
33
33
|
}
|