mirror of
https://github.com/Mojang/bedrock-samples.git
synced 2024-11-23 12:26:14 +00:00
a3b394c507
Initial layout
332 lines
8.7 KiB
JSON
332 lines
8.7 KiB
JSON
{
|
|
"namespace": "post_rating",
|
|
|
|
"rating_dropdown_button_panel": {
|
|
"type": "stack_panel",
|
|
"size": [ "100% - 12px", "100%" ],
|
|
"orientation": "horizontal",
|
|
"controls": [
|
|
{
|
|
"rating_panel": {
|
|
"type": "panel",
|
|
"size": [ "fill", "100%" ],
|
|
"controls": [
|
|
{
|
|
"rating_stars@pdp.scaling_rating": {
|
|
"size": [ "75%", "20%x" ],
|
|
"anchor_from": "left_middle",
|
|
"anchor_to": "left_middle",
|
|
"$rating_bind_name": "#player_rating"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"arrow_panel": {
|
|
"type": "panel",
|
|
"layer": 1,
|
|
"size": [ "100%c", "100%" ],
|
|
"controls": [
|
|
{
|
|
"arrow@settings_common.arrow_image": {}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"star": {
|
|
"type": "panel",
|
|
"controls": [
|
|
{
|
|
"bg": {
|
|
"type": "image",
|
|
"texture": "textures/ui/ratings_nostar",
|
|
"ignored": "($star_index < $star_count-1)",
|
|
"bilinear": true
|
|
}
|
|
},
|
|
{
|
|
"fg": {
|
|
"type": "image",
|
|
"layer": 4,
|
|
"texture": "textures/ui/ratings_fullstar",
|
|
"ignored": "($star_index > $star_count-1)",
|
|
"bilinear": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"star_grid": {
|
|
"type": "grid",
|
|
"grid_dimensions": [ 5, 1 ],
|
|
"controls": [
|
|
{
|
|
"star_1@star": {
|
|
"grid_position": [ 0, 0 ],
|
|
"$star_index": 0
|
|
}
|
|
},
|
|
{
|
|
"star_2@star": {
|
|
"grid_position": [ 1, 0 ],
|
|
"$star_index": 1
|
|
}
|
|
},
|
|
{
|
|
"star_3@star": {
|
|
"grid_position": [ 2, 0 ],
|
|
"$star_index": 2
|
|
}
|
|
},
|
|
{
|
|
"star_4@star": {
|
|
"grid_position": [ 3, 0 ],
|
|
"$star_index": 3
|
|
}
|
|
},
|
|
{
|
|
"star_5@star": {
|
|
"grid_position": [ 4, 0 ],
|
|
"$star_index": 4
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"rating_radio": {
|
|
"type": "panel",
|
|
"anchor_from": "left_middle",
|
|
"anchor_to": "left_middle",
|
|
"size": [ "100%", "17px" ],
|
|
"$enabled|default": true,
|
|
"$no_label": true,
|
|
"controls": [
|
|
{
|
|
"radio_with_label_core@settings_common.radio_with_label_core": {
|
|
"offset": [ 5, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"star_panel": {
|
|
"type": "panel",
|
|
"anchor_from": "left_middle",
|
|
"anchor_to": "left_middle",
|
|
"size": [ "50%", "80%" ],
|
|
"offset": [ 20, -1 ],
|
|
"controls": [
|
|
{
|
|
"star_grid@star_grid": {}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"rating_dropdown_content@settings_common.option_radio_dropdown_group": {
|
|
"size": [ "100%", "100%c + 4px" ],
|
|
"anchor_from": "top_middle",
|
|
"anchor_to": "top_middle",
|
|
"$show_option_label": false,
|
|
"$radio_buttons": [
|
|
{
|
|
"5_star@post_rating.rating_radio": {
|
|
"min_size": [ "100%", 22 ],
|
|
"$toggle_state_binding_name": "#current_rating_5",
|
|
"$star_count": 5
|
|
}
|
|
},
|
|
{
|
|
"4_star@post_rating.rating_radio": {
|
|
"min_size": [ "100%", 22 ],
|
|
"$toggle_state_binding_name": "#current_rating_4",
|
|
"$star_count": 4
|
|
}
|
|
},
|
|
{
|
|
"3_star@post_rating.rating_radio": {
|
|
"min_size": [ "100%", 22 ],
|
|
"$toggle_state_binding_name": "#current_rating_3",
|
|
"$star_count": 3
|
|
}
|
|
},
|
|
{
|
|
"2_star@post_rating.rating_radio": {
|
|
"min_size": [ "100%", 22 ],
|
|
"$toggle_state_binding_name": "#current_rating_2",
|
|
"$star_count": 2
|
|
}
|
|
},
|
|
{
|
|
"1_star@post_rating.rating_radio": {
|
|
"min_size": [ "100%", 22 ],
|
|
"$toggle_state_binding_name": "#current_rating_1",
|
|
"$star_count": 1
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"dropdown_background": {
|
|
"layer": 1,
|
|
"type": "image",
|
|
"texture": "textures/ui/Banners"
|
|
},
|
|
|
|
"rating_dropdown_control": {
|
|
"type": "panel",
|
|
"size": [ "100%", 30 ],
|
|
"anchor_from": "center",
|
|
"anchor_to": "center",
|
|
"$dropdown_background_control|default": "common.dropdown_background",
|
|
"$dropdown_toggle_override|default": "",
|
|
"$option_dropdown_type|default": "common.dropdown",
|
|
"controls": [
|
|
{
|
|
"dropdown@$option_dropdown_type": {
|
|
"$dropdown_background": "$dropdown_background_control",
|
|
"$dropdown_content|default": "unset_dropdown_content",
|
|
"$dropdown_name|default": "unset $dropdown_name",
|
|
"$options_dropdown_toggle_label_binding|default": "unset $options_dropdown_toggle_label_text",
|
|
"$locked_alpha": 0.5
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"rating_dropdown@post_rating.rating_dropdown_control": {
|
|
"$option_dropdown_type": "common.dropdown_no_scrollpanel",
|
|
"$option_enabled_binding_name|default": "",
|
|
"$enabled|default": true,
|
|
"$button_type_panel": "post_rating.rating_dropdown_button_panel",
|
|
"$dropdown_background_control": "post_rating.dropdown_background",
|
|
"$dropdown_toggle": "settings_common.options_dropdown_dark_toggle_control",
|
|
"$show_option_label": false,
|
|
"$dropdown_content": "post_rating.rating_dropdown_content",
|
|
"$dropdown_area": "dialog",
|
|
"$dropdown_name": "rating_dropdown"
|
|
},
|
|
|
|
"main_panel": {
|
|
"type": "panel",
|
|
"layer": 1,
|
|
"anchor_from": "top_middle",
|
|
"anchor_to": "top_middle",
|
|
"controls": [
|
|
{
|
|
"content": {
|
|
"type": "stack_panel",
|
|
"size": [ "100% - 2px", "100%c" ],
|
|
"anchor_from": "top_middle",
|
|
"anchor_to": "top_middle",
|
|
"controls": [
|
|
{
|
|
"header": {
|
|
"type": "label",
|
|
"size": [ "100%", "default" ],
|
|
"text": "review.item.post.rating.dropdown.label",
|
|
"text_alignment": "left",
|
|
"color": "$body_text_color"
|
|
}
|
|
},
|
|
{"rating@rating_dropdown": {} },
|
|
{
|
|
"footer": {
|
|
"type": "panel",
|
|
"size": [ "100%", "100%c" ],
|
|
"controls": [
|
|
{
|
|
"text": {
|
|
"type": "label",
|
|
"anchor_from": "top_left",
|
|
"anchor_to": "top_left",
|
|
"offset": [ 0, 5 ],
|
|
"size": [ "100%", "default" ],
|
|
"text_alignment": "left",
|
|
"color": "$body_text_color",
|
|
"text": "#footer_text",
|
|
"bindings": [
|
|
{
|
|
"binding_name": "#footer_text"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"submit_button@common_buttons.light_text_button": {
|
|
"anchor_from": "bottom_middle",
|
|
"anchor_to": "top_middle",
|
|
"size": [ "100% + 2px", 30 ],
|
|
"offset": [ 0, 5 ],
|
|
"layer": 2,
|
|
"$button_text": "review.item.post.rating.submit.button",
|
|
"button_mappings": [
|
|
{
|
|
"from_button_id": "button.menu_select",
|
|
"to_button_id": "button.submit_rating",
|
|
"mapping_type": "pressed"
|
|
},
|
|
{
|
|
"from_button_id": "button.menu_ok",
|
|
"to_button_id": "button.submit_rating",
|
|
"mapping_type": "focused"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"title_label@common_dialogs.standard_title_label": {
|
|
"text_alignment": "left",
|
|
"anchor_from": "top_left",
|
|
"anchor_to": "top_left"
|
|
},
|
|
|
|
"post_rating_screen_content": {
|
|
"type": "panel",
|
|
"controls": [
|
|
{
|
|
"dialog@common_dialogs.main_panel_one_button": {
|
|
"$use_custom_title_control": true,
|
|
"$custom_title_label": "post_rating.title_label",
|
|
"$dialog_background": "dialog_background_hollow_2",
|
|
"$title_size": [ "100% - 14px", 10 ],
|
|
"size": "$tall_modal_screen_size",
|
|
"$text_name": "store.ratings.rate",
|
|
"$title_text_binding_type": "none",
|
|
"$child_control": "post_rating.main_panel",
|
|
"layer": 2
|
|
}
|
|
},
|
|
{
|
|
"background@common.screen_background": {
|
|
"alpha": 0.85,
|
|
"layer": 1
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"post_rating_screen@common_store.store_base_screen": {
|
|
"button_mappings": [
|
|
{
|
|
"from_button_id": "button.menu_cancel",
|
|
"to_button_id": "button.menu_exit",
|
|
"mapping_type": "global"
|
|
}
|
|
],
|
|
"force_render_below": true,
|
|
"$screen_content": "post_rating.post_rating_screen_content"
|
|
}
|
|
}
|