Skip to content

Commit

Permalink
Merge pull request #82 from Ladysnake/blabber-illustrations
Browse files Browse the repository at this point in the history
Document Blabber's illustrations
  • Loading branch information
Pyrofab authored May 1, 2024
2 parents 4f2f5fa + 2ab557d commit 986bd01
Show file tree
Hide file tree
Showing 18 changed files with 407 additions and 106 deletions.
2 changes: 2 additions & 0 deletions public/_includes/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
https://github.com/darkreader/darkreader/blob/main/CONTRIBUTING.md#disabling-dark-reader-on-your-site
{%- endcomment %}
<meta name="darkreader-lock">
<!-- Enriched HTML -->
<script src="/scripts/sprinkles/better-details.js" type="module"></script>
<!-- Embed -->
<meta property="og:title" content="{{ full_title }}" />
<meta property="og:type" content="website" />
Expand Down
4 changes: 4 additions & 0 deletions public/_sass/parts/admonitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
padding: 0.5em 1em;
}

li.admonition {
margin-left: -1em;
}

.admonition-note {
--admonition-color: var(--color-info);
}
Expand Down
6 changes: 0 additions & 6 deletions public/_sass/parts/details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,5 @@ details {
&:hover {
background-color: var(--accent-background-color);
}

h5, h6 {
font-size: inherit;
margin-top: 1em;
margin-bottom: 1em;
}
}
}
13 changes: 13 additions & 0 deletions public/_sass/parts/headings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1.1;
}

h5, h6 {
margin-top: 1em;
margin-bottom: 1em;
}

h6 {
font-size: 14px;
}

h5 {
font-size: 16px;
}

h4 {
font-size: 18px;
margin: 10px 0;
Expand Down
2 changes: 2 additions & 0 deletions public/_sass/parts/utilities/images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ img.rounded {

.container img.wiki {
max-width: 100%;
display: block;
margin: auto;
}

.h1-wiki-icon {
Expand Down
114 changes: 114 additions & 0 deletions public/schemas/blabber/dialogue.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ladysnake.org/schemas/blabber/dialogue.schema.json",
"title": "Dialogue",
"description": "A dialogue to be given to a player",
"type": "object",
"properties": {
"layout": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The type of layout used for the default screen",
"enum": ["blabber:classic", "blabber:rpg"]
}
}
},
"start_at": {
"description": "The entrypoint for this dialogue",
"type": "string"
},
"unskippable": {
"description": "If true, players will not be able to leave the dialogue screen before completion",
"type": "boolean"
},
"states": {
"description": "Available states for the dialogue",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"type": {
"description": "The type of the current state",
"type": "string",
"enum": ["default", "ask_confirmation", "end_dialogue"]
},
"action": {
"description": "The action to run when arriving to this state",
"type": "object",
"properties": {
"type": {
"description": "The type of action to run",
"type": "string",
"pattern": "^[a-z0-9_-]+:[a-z0-9/_-]+$"
},
"value": {
"description": "Optional value used to configure the action; depends on the type of action"
}
},
"required": ["type"]
},
"text": {
"description": "The heading text to be displayed before the choices",
"$ref": "https://raw.githubusercontent.com/Levertion/minecraft-json-schema/master/java/shared/text_component.json"
},
"choices": {
"description": "Available choices for the player",
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"description": "The line of text corresponding to the given choice item",
"$ref": "https://raw.githubusercontent.com/Levertion/minecraft-json-schema/master/java/shared/text_component.json"
},
"next": {
"description": "The id of the state to switch to when selecting this choice",
"type": "string"
},
"only_if": {
"type": "object",
"description": "Make this choice available only if a predicate is fulfilled",
"properties": {
"predicate": {
"description": "The identifier of a datapack predicate",
"type": "string"
},
"when_unavailable": {
"type": "object",
"properties": {
"action": {
"enum": ["grayed_out", "hide"]
},
"message": {
"description": "The message to display for why the choice is unavailable. Only applicable if the action is gray_out.",
"type": "string"
}
}
}
}
}
}
}
},
"illustrations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": []
}
},
"illustrations": {
"type": "object",
"description": "Available illustrations in dialogue states",
"additionalProperties": {
"$ref": "/schemas/blabber/dialogue_illustration.schema.json"
}
}
},
"required": [ "start_at", "states" ]
}
78 changes: 78 additions & 0 deletions public/schemas/blabber/dialogue_illustration.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ladysnake.org/schemas/blabber/dialogue_illustration.schema.json",
"$ref": "#/definitions/illustration",
"title": "Dialogue Illustration",
"description": "An illustration that can be referenced in dialogue states",
"definitions": {
"illustration": {
"anyOf": [
{
"$ref": "#/definitions/illustration_object"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/illustration"
},
"title": "Illustration Group",
"description": "Equivalent to {\"type\": \"blabber:group\", \"elements\": [...]}"
}
]
},
"illustration_object": {
"oneOf": [
{
"title": "Item Illustration",
"properties": {
"type": {
"const": "blabber:item"
},
"item": {
"$ref": "/schemas/minecraft/itemstack.schema.json"
}
},
"required": ["type", "item"]
},
{
"title": "Entity Illustration",
"properties": {
"type": {
"const": "blabber:entity"
},
"entity": {
"$ref": "/schemas/minecraft/entity_selector.schema.json"
}
},
"required": ["type", "entity"]
},
{
"title": "Fake Entity Illustration",
"properties": {
"type": {
"const": "blabber:fake_entity"
},
"id": {
"$ref": "/schemas/minecraft/entity_selector.schema.json"
}
},
"required": ["type", "entity"]
},
{
"title": "Illustration Composition",
"properties": {
"type": {
"const": "blabber:group"
},
"elements": {
"type": "array",
"items": {
"$ref": "#/definitions/illustration"
}
}
}
}
]
}
}
}
7 changes: 7 additions & 0 deletions public/schemas/minecraft/entity_selector.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ladysnake.org/schemas/minecraft/entity_selector.schema.json",
"title": "Entity Selector",
"type": "string",
"pattern": "^@\\w+(\\[(\\w+=.*)(,\\w+=.*)*\\])?$"
}
13 changes: 13 additions & 0 deletions public/schemas/minecraft/itemstack.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ladysnake.org/schemas/minecraft/itemstack.schema.json",
"title": "Item Stack",
"oneOf": [
{
"$ref": "/schemas/minecraft/itemstack_v1.schema.json"
},
{
"$ref": "/schemas/minecraft/itemstack_v2.schema.json"
}
]
}
23 changes: 23 additions & 0 deletions public/schemas/minecraft/itemstack_v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ladysnake.org/schemas/minecraft/itemstack_v1.schema.json",
"title": "Item Stack (pre-1.20.5)",
"properties": {
"id": {
"title": "Registry Identifier",
"description": "The type of item stored in the stack",
"type": "string",
"pattern": "^([a-z_-]+:[a-z_/-]+)"
},
"Count": {
"description": "The number of items contained in the stack",
"type": "integer",
"minimum": 0
},
"tag": {
"type": "object",
"title": "NBT Data"
}
},
"required": ["id"]
}
23 changes: 23 additions & 0 deletions public/schemas/minecraft/itemstack_v2.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ladysnake.org/schemas/minecraft/itemstack_v2.schema.json",
"title": "Item Stack (post-1.20.5)",
"properties": {
"id": {
"title": "Registry Identifier",
"description": "The type of item stored in the stack",
"type": "string",
"pattern": "^([a-z_-]+:[a-z_/-]+)"
},
"count": {
"description": "The number of items contained in the stack",
"type": "integer",
"minimum": 0
},
"components": {
"type": "object",
"title": "Item Component Data"
}
},
"required": ["id"]
}
2 changes: 1 addition & 1 deletion public/tools/parlour.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<li><a href="https://www.whatismybrowser.com/guides/how-to-enable-javascript/auto">Try enabling Javascript on your
browser</a></li>
<li><a href="../">Go back to Blabber's description</a></li>
<li><a href="../dialogue.schema.json">Look at the Dialogue Schema specification</a></li>
<li><a href="/schemas/blabber/dialogue.schema.json">Look at the Dialogue Schema specification</a></li>
</ul>
</noscript>
<div id="blabber-parlour"></div>
Expand Down
2 changes: 1 addition & 1 deletion public/wiki/blabber/basic-dialogue.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://ladysnake.org/wiki/blabber/dialogue.schema.json",
"$schema": "https://ladysnake.org/schemas/blabber/dialogue.schema.json",
"start_at": "start",
"states": {
"start": {
Expand Down
Loading

0 comments on commit 986bd01

Please sign in to comment.