Skip to content

Commit

Permalink
Support Sonolus 0.8.8 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSpicyBurrito authored Nov 30, 2024
1 parent daebedb commit 2dd23ff
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"acorn": "^8.14.0"
},
"peerDependencies": {
"@sonolus/core": "~7.9.2"
"@sonolus/core": "~7.9.3"
},
"devDependencies": {
"@eslint/js": "^9.16.0",
Expand Down
1 change: 1 addition & 0 deletions src/build/play/tasks/main/engine/playData/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { clean } from '../../../../../shared/utils/clean.js'

export const buildSkin = (skin: EnginePlayData['skin']): EnginePlayData['skin'] =>
clean(skin, {
'renderMode?': 'string',
sprites: [
{
name: 'string',
Expand Down
1 change: 1 addition & 0 deletions src/build/preview/tasks/main/engine/playData/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { clean } from '../../../../../shared/utils/clean.js'

export const buildSkin = (skin: EnginePlayData['skin']): EnginePlayData['skin'] =>
clean(skin, {
'renderMode?': 'string',
sprites: [
{
name: 'string',
Expand Down
1 change: 1 addition & 0 deletions src/build/tutorial/tasks/main/engine/tutorialData/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { clean } from '../../../../../shared/utils/clean.js'

export const buildSkin = (skin: EngineTutorialData['skin']): EngineTutorialData['skin'] =>
clean(skin, {
'renderMode?': 'string',
sprites: [
{
name: 'string',
Expand Down
1 change: 1 addition & 0 deletions src/build/watch/tasks/main/engine/watchData/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { clean } from '../../../../../shared/utils/clean.js'

export const buildSkin = (skin: EnginePlayData['skin']): EnginePlayData['skin'] =>
clean(skin, {
'renderMode?': 'string',
sprites: [
{
name: 'string',
Expand Down
3 changes: 3 additions & 0 deletions src/lib/shared/define/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type SkinSprite = {
}

type SkinDefinition = {
renderMode?: 'default' | 'standard' | 'lightweight'
sprites: Record<string, SkinSpriteName | (string & {})>
}

Expand Down Expand Up @@ -61,6 +62,7 @@ type SkinSprites = {
}

type Skin<T extends SkinDefinition> = {
renderMode?: 'default' | 'standard' | 'lightweight'
sprites: { readonly name: string; readonly id: number }[] & {
[K in keyof T['sprites']]: SkinSprite
} & SkinSprites
Expand Down Expand Up @@ -91,6 +93,7 @@ export const createDefineSkin =
(pointer: <T>(x: number, y: number, s: number) => T) =>
<T extends SkinDefinition>(skin: T): Skin<T> =>
defineLib<Skin<T>>({
...(skin.renderMode && { renderMode: skin.renderMode }),
sprites: Object.assign(
Object.values(skin.sprites).map((name, id) => ({ name, id })),
Object.fromEntries(
Expand Down

0 comments on commit 2dd23ff

Please sign in to comment.