Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ is neither mapped to a slot nor listed in ignoredObjects in theme-slots.json.
- **Add a slot to the root `theme-slots.json` only for a genuinely new role.**
Every theme is missing it until someone fills it in the assets repository:
those objects keep their placeholder art in the meantime, which is not an
error.
error. Give it a `description` saying what its objects do in the starters
and what fits it: the authors of themes choose its asset from it (the gun of
the FPS starters must shoot, a crop must grow from the soil).
- **Map an object only to a slot whose description fits what it does.** A seed
planted in a plot is not a small rock: every theme would show a rock (or a
bone, or a wheel) instead. List it in `ignoredObjects` if no slot fits.
- **List in `ignoredObjects`** what is not meant to be seen as art: the camera
anchor cube, an invisible collision helper, the faceless player of a first
person game.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"scene:Game Scene/Beet": "crop.b",
"scene:Game Scene/Harvest_Seed_Beet": "prop.container",
"scene:Game Scene/Harvest_Seed_Carrot": "prop.container",
"scene:Game Scene/Seed_Beet": "nature.rock.small",
"scene:Game Scene/Seed_Carrot": "nature.rock.small",
"scene:Game Scene/Barn": "building.tower",
"scene:Game Scene/SmallBarn": "building.tower",
"scene:Game Scene/ChickenCoop": "building.tower",
Expand Down Expand Up @@ -69,6 +67,8 @@
"object:Water3D::Water3D/AreaPlaceholder",
"object:Terrain3D::Terrain3D/AreaPlaceholder",
"object:Terrain3D::TerrainGrass/AreaPlaceholder",
"object:Terrain3D::ScatteredModels/AreaPlaceholder"
"object:Terrain3D::ScatteredModels/AreaPlaceholder",
"scene:Game Scene/Seed_Beet",
"scene:Game Scene/Seed_Carrot"
]
}
6 changes: 3 additions & 3 deletions examples/starting-first-person-farming/theme-slots.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"scene:Game Scene/Beet": "crop.b",
"scene:Game Scene/Harvest_Seed_Beet": "prop.container",
"scene:Game Scene/Harvest_Seed_Carrot": "prop.container",
"scene:Game Scene/Seed_Beet": "nature.rock.small",
"scene:Game Scene/Seed_Carrot": "nature.rock.small",
"scene:Game Scene/Walls": {
"front": "env.wall",
"left": "env.wall",
Expand All @@ -29,6 +27,8 @@
"effect:Game Scene//Effect2": "sky.day"
},
"ignoredObjects": [
"scene:Game Scene/Player"
"scene:Game Scene/Player",
"scene:Game Scene/Seed_Beet",
"scene:Game Scene/Seed_Carrot"
]
}
5 changes: 3 additions & 2 deletions scripts/lib/ThemeSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ const path = require('path');
const fs = require('fs').promises;

/**
* The vocabulary of slots a theme can fill, shared by every starter.
* The vocabulary of slots a theme can fill, shared by every starter. The
* description of a slot is what the authors of themes read to choose its asset.
* @typedef {{
* version: number,
* slots: Array<{id: string, kind: ThemeSlotKind, label: string}>,
* slots: Array<{id: string, kind: ThemeSlotKind, label: string, description: string}>,
* }} ThemeSlotsVocabulary
*
* @typedef {'model' | 'texture' | 'material' | 'skybox' | 'color'} ThemeSlotKind
Expand Down
49 changes: 42 additions & 7 deletions scripts/lib/__tests__/ThemeSlots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,48 @@ const {
const vocabulary = {
version: 1,
slots: [
{ id: 'character.player', kind: 'model', label: 'Player character' },
{ id: 'nature.tree', kind: 'model', label: 'Tree' },
{ id: 'env.ground', kind: 'texture', label: 'Ground' },
{ id: 'env.wall', kind: 'texture', label: 'Wall' },
{ id: 'sky.day', kind: 'skybox', label: 'Daytime sky' },
{ id: 'terrain.ground', kind: 'material', label: 'Terrain ground' },
{ id: 'terrain.grass.tip', kind: 'color', label: 'Grass tip color' },
{
id: 'character.player',
kind: 'model',
label: 'Player character',
description: 'The character the player controls.',
},
{
id: 'nature.tree',
kind: 'model',
label: 'Tree',
description: 'The trees.',
},
{
id: 'env.ground',
kind: 'texture',
label: 'Ground',
description: 'The texture of the ground.',
},
{
id: 'env.wall',
kind: 'texture',
label: 'Wall',
description: 'The texture of the walls.',
},
{
id: 'sky.day',
kind: 'skybox',
label: 'Daytime sky',
description: 'The sky.',
},
{
id: 'terrain.ground',
kind: 'material',
label: 'Terrain ground',
description: 'The main ground of a terrain.',
},
{
id: 'terrain.grass.tip',
kind: 'color',
label: 'Grass tip color',
description: 'The color of the grass blades at their tip.',
},
],
};

Expand Down
Loading
Loading