Skip to content

Commit e4b2710

Browse files
authored
Update JSON UI schemas (#192)
* Implement some missing `ui/` schemas - Add `allow_debug_missing_texture` - Add `propagate_alpha` - Add `use_child_anchors` * Tweak descriptions of `item_ref` It should be noted that UI are referred to as "elements." Moreover, the examples used colon (`:`) instead of dots (`.`) which contradicts the given description. * Add more enum values to the `easing` property These are all known values, aside from the five that was given.
1 parent 0316dcd commit e4b2710

File tree

6 files changed

+59
-9
lines changed

6 files changed

+59
-9
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"title": "Allow Debug Missing Texture",
3+
"description": "If true, the element will show the black and purple placeholder texture if the referenced image is not found.",
4+
"$ref": "../../general/boolean.json"
5+
}

source/resource/ui/elements/properties/easing.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,40 @@
33
"description": "The easing of the animation.",
44
"anyOf": [
55
{
6-
"enum": ["spring", "in_sine", "linear", "in_quint", "out_cubic"]
6+
"enum": [
7+
"linear",
8+
"spring",
9+
"in_quad",
10+
"out_quad",
11+
"in_out_quad",
12+
"in_cubic",
13+
"out_cubic",
14+
"in_out_cubic",
15+
"in_quart",
16+
"out_quart",
17+
"in_out_quart",
18+
"in_quint",
19+
"out_quint",
20+
"in_out_quint",
21+
"in_sine",
22+
"out_sine",
23+
"in_out_sine",
24+
"in_expo",
25+
"out_expo",
26+
"in_out_expo",
27+
"in_circ",
28+
"out_circ",
29+
"in_out_circ",
30+
"in_bounce",
31+
"out_bounce",
32+
"in_out_bounce",
33+
"in_back",
34+
"out_back",
35+
"in_out_back",
36+
"in_elastic",
37+
"out_elastic",
38+
"in_out_elastic"
39+
]
740
},
841
{
942
"$ref": "../../general/item_ref.json"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"title": "Propagate Alpha",
3+
"description": "If true, this element will apply the same alpha value to its controlled element(s).",
4+
"$ref": "../../general/boolean.json"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"title": "Use Child Anchors",
3+
"description": "If true, this element will stack its controlled element in respect to their anchor values.",
4+
"$ref": "../../general/boolean.json"
5+
}

source/resource/ui/general/item_ref.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"anyOf": [
44
{
5-
"title": "Item reference",
6-
"description": "A reference to an item: using the following syntax: [element_name]@[namespace_reference].[element_name_reference]",
5+
"title": "Element reference",
6+
"description": "A reference to an element: using the following syntax: [element_name]@[namespace_reference].[element_name_reference]",
77
"type": "string",
8-
"examples": ["button@minecraft", "button@minecraft:ui"],
8+
"examples": ["button@minecraft", "button@minecraft.ui"],
99
"pattern": "^[a-zA-Z0-9_]*@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?$"
1010
},
1111
{
12-
"title": "Item reference",
13-
"description": "A reference to an item: using the following syntax: [namespace_reference].[element_name_reference]",
12+
"title": "Element reference",
13+
"description": "A reference to an element: using the following syntax: [namespace_reference].[element_name_reference]",
1414
"type": "string",
15-
"examples": ["button@minecraft", "button@minecraft:ui"],
15+
"examples": ["button@minecraft", "button@minecraft.ui"],
1616
"pattern": "[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?$"
1717
},
1818
{

source/resource/ui/ui.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"initial_uv": { "$ref": "./elements/properties/initial_uv.json" },
4040
"next": { "$ref": "./elements/properties/next.json" },
4141
"play_event": { "$ref": "./elements/properties/play_event.json" },
42-
"propagate_alpha": { "$ref": "./elements/properties/alpha.json" },
42+
"propagate_alpha": { "$ref": "./elements/properties/propagate_alpha.json" },
4343
"reversible": { "$ref": "./elements/properties/reversible.json" },
4444
"scale_from_starting_alpha": { "$ref": "./elements/properties/scale_from_starting_alpha.json" },
4545
"to": { "$ref": "./elements/properties/to.json" },
@@ -62,6 +62,7 @@
6262
},
6363
"properties": {
6464
"allow_clipping": { "$ref": "./elements/properties/allow_clipping.json" },
65+
"allow_debug_missing_texture": { "$ref": "./elements/properties/allow_debug_missing_texture.json" },
6566
"allow_scroll_even_when_content_fits": { "$ref": "./elements/properties/allow_scroll_even_when_content_fits.json" },
6667
"alpha": { "$ref": "./elements/properties/alpha.json" },
6768
"always_handle_pointer": { "$ref": "./elements/properties/always_handle_pointer.json" },
@@ -183,7 +184,7 @@
183184
"primary_color": { "$ref": "./elements/properties/color.json" },
184185
"progress_control": { "$ref": "./elements/properties/progress_control.json" },
185186
"progress_hover_control": { "$ref": "./elements/properties/progress_hover_control.json" },
186-
"propagate_alpha": { "$ref": "./elements/properties/alpha.json" },
187+
"propagate_alpha": { "$ref": "./elements/properties/propagate_alpha.json" },
187188
"property_bag": { "$ref": "./elements/properties/property_bag.json" },
188189
"radio_toggle_group": { "$ref": "./elements/properties/radio_toggle_group.json" },
189190
"render_game_behind": { "$ref": "./elements/properties/render_game_behind.json" },
@@ -258,6 +259,7 @@
258259
"unchecked_locked_control": { "$ref": "./elements/properties/unchecked_locked_control.json" },
259260
"unchecked_locked_hover_control": { "$ref": "./elements/properties/unchecked_locked_hover_control.json" },
260261
"use_anchored_offset": { "$ref": "./elements/properties/use_anchored_offset.json" },
262+
"use_child_anchors": { "$ref": "./elements/properties/use_child_anchors.json" },
261263
"use_last_focus": { "$ref": "./elements/properties/use_last_focus.json" },
262264
"uv_size": { "$ref": "./elements/properties/uv_size.json" },
263265
"uv": { "$ref": "./elements/properties/uv.json" },

0 commit comments

Comments
 (0)