Skip to content

Commit dab25eb

Browse files
author
DavidQ
committed
refactor(skins): remove default.json fallback, require catalog skin.main, rename real skin files to skin.main.json, and fail fast on missing skin path
1 parent 86ace2d commit dab25eb

19 files changed

Lines changed: 30 additions & 58 deletions

games/SolarSystem/assets/presets/game-solarsystem-skin-editor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"payload": {
99
"gameId": "SolarSystem",
10-
"skinPath": "/games/SolarSystem/assets/skins/default.json",
10+
"skinPath": "/games/SolarSystem/assets/skins/skin.main.json",
1111
"skin": {
1212
"documentKind": "game-skin",
1313
"version": 1,
File renamed without changes.

games/SolarSystem/assets/workspace.asset-catalog.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"source": "workspace-manager"
1010
},
1111
"skin.main": {
12-
"path": "/games/SolarSystem/assets/skins/default.json",
12+
"path": "/games/SolarSystem/assets/skins/skin.main.json",
1313
"kind": "skin",
1414
"source": "workspace-manager"
1515
}

games/SolarSystem/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import SolarSystemScene from './game/SolarSystemScene.js';
1111
import { loadGameSkin } from '/games/shared/gameSkinLoader.js';
1212

1313
const theme = new Theme(ThemeTokens);
14-
const SOLAR_DEFAULT_SKIN_PATH = '/games/SolarSystem/assets/skins/default.json';
1514

1615
export function bootSolarSystem({
1716
documentRef = globalThis.document ?? null,
@@ -43,7 +42,6 @@ export function bootSolarSystem({
4342

4443
void loadGameSkin({
4544
gameId: 'SolarSystem',
46-
defaultSkinPath: SOLAR_DEFAULT_SKIN_PATH,
4745
fallbackSchema: 'games.solar-system.skin/1'
4846
}).then(({ skin }) => {
4947
const scene = new SceneClass({ skin });

games/bouncing-ball/assets/presets/game-bouncing-ball-skin-editor.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"payload": {
99
"gameId": "Bouncing-ball",
10-
"skinPath": "/games/Bouncing-ball/assets/skins/default.json",
10+
"skinPath": "/games/Bouncing-ball/assets/skins/skin.main.json",
1111
"skin": {
1212
"documentKind": "game-skin",
1313
"version": 1,
@@ -19,10 +19,10 @@
1919
"color": "#05070a",
2020
"shape": "hud-color"
2121
},
22-
"wall": {
22+
"walls": {
2323
"color": "#f4f4ef",
2424
"thickness": 18,
25-
"shape": "wall"
25+
"shape": "walls"
2626
},
2727
"ball": {
2828
"color": "#f4f4ef",
File renamed without changes.

games/bouncing-ball/assets/workspace.asset-catalog.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"source": "workspace-manager"
1010
},
1111
"skin.main": {
12-
"path": "/games/bouncing-ball/assets/skins/default.json",
12+
"path": "/games/bouncing-ball/assets/skins/skin.main.json",
1313
"kind": "skin",
1414
"source": "workspace-manager"
1515
}

games/bouncing-ball/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import BouncingBallScene from './game/BouncingBallScene.js';
1111
import { loadGameSkin } from '/games/shared/gameSkinLoader.js';
1212

1313
const theme = new Theme(ThemeTokens);
14-
const BOUNCING_BALL_DEFAULT_SKIN_PATH = '/games/Bouncing-ball/assets/skins/default.json';
1514

1615
export function bootBouncingBall({
1716
documentRef = globalThis.document ?? null,
@@ -43,7 +42,6 @@ export function bootBouncingBall({
4342

4443
void loadGameSkin({
4544
gameId: 'Bouncing-ball',
46-
defaultSkinPath: BOUNCING_BALL_DEFAULT_SKIN_PATH,
4745
fallbackSchema: 'games.bouncing-ball.skin/1'
4846
}).then(({ skin }) => {
4947
const scene = new SceneClass({ skin });

games/breakout/assets/presets/game-breakout-skin-editor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"payload": {
99
"gameId": "Breakout",
10-
"skinPath": "/games/Breakout/assets/skins/default.json",
10+
"skinPath": "/games/Breakout/assets/skins/skin.main.json",
1111
"skin": {
1212
"documentKind": "game-skin",
1313
"version": 1,
File renamed without changes.

0 commit comments

Comments
 (0)