Skip to content

Commit

Permalink
Add base slot definition
Browse files Browse the repository at this point in the history
  • Loading branch information
b-wils committed Jun 20, 2024
1 parent bb141a7 commit 0e97ffc
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 46 deletions.
4 changes: 3 additions & 1 deletion docs/specs/slots.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Slots
<h1 id="slot">Slots</h1>

Slots are used to replace property values during runtime. Properties that can be replaced will have an `sid` attribute that will correspond to the slot key entry. Players that support slots must also expose an API that applications can use to replace values during runtime.

{schema_object:slots/slot}

<h3 id="color-slot">Color Slot</h3>

{schema_object:slots/color-slot}
Expand Down
25 changes: 16 additions & 9 deletions schema/slots/color-slot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"type": "object",
"title": "Color Slot",
"description": "Color Slot",
"properties": {
"t": {
"title": "Slot Type",
"const": 1
"allOf": [
{
"$ref": "#/$defs/slots/slot"
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/color-property"
{
"properties": {
"t": {
"title": "Slot Type",
"const": 1
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/color-property"
}
}
}
}
]
}
25 changes: 16 additions & 9 deletions schema/slots/file-asset-slot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"type": "object",
"title": "File Asset Slot",
"description": "File Asset Slot",
"properties": {
"t": {
"title": "Slot Type",
"const": 50
"allOf": [
{
"$ref": "#/$defs/slots/slot"
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/assets/image"
{
"properties": {
"t": {
"title": "Slot Type",
"const": 50
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/assets/image"
}
}
}
}
]
}
25 changes: 16 additions & 9 deletions schema/slots/float-slot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"type": "object",
"title": "Float Slot",
"description": "Float Slot",
"properties": {
"t": {
"title": "Slot Type",
"const": 4
"allOf": [
{
"$ref": "#/$defs/slots/slot"
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/scalar-property"
{
"properties": {
"t": {
"title": "Slot Type",
"const": 4
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/scalar-property"
}
}
}
}
]
}
25 changes: 16 additions & 9 deletions schema/slots/point-slot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"type": "object",
"title": "Point Slot",
"description": "Point Slot",
"properties": {
"t": {
"title": "Slot Type",
"const": 2
"allOf": [
{
"$ref": "#/$defs/slots/slot"
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/vector-property"
{
"properties": {
"t": {
"title": "Slot Type",
"const": 2
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/vector-property"
}
}
}
}
]
}
25 changes: 16 additions & 9 deletions schema/slots/scale-slot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"type": "object",
"title": "Scale Slot",
"description": "Scale Slot",
"properties": {
"t": {
"title": "Slot Type",
"const": 3
"allOf": [
{
"$ref": "#/$defs/slots/slot"
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/vector-property"
{
"properties": {
"t": {
"title": "Slot Type",
"const": 3
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id",
"$ref": "#/$defs/properties/vector-property"
}
}
}
}
]
}
15 changes: 15 additions & 0 deletions schema/slots/slot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Slot",
"description": "Common properties for all slots",
"properties": {
"t": {
"title": "Slot Type"
},
"p": {
"title": "Default Property Value",
"description": "The starting value of any properties with the slot id"
}
}
}

0 comments on commit 0e97ffc

Please sign in to comment.