1
0
mirror of https://github.com/Mojang/bedrock-samples.git synced 2024-11-23 13:36:18 +00:00
bedrock-samples/resource_pack/ui/choose_realm_screen.json
Mike Ammerlaan 8a7cb6d0b6 v1.20.60.4
2024-02-06 09:42:22 -08:00

725 lines
22 KiB
JSON

{
"namespace": "choose_realm",
"realm_screenshot": {
"type": "image",
"size": [ "100%c + 2px", "100%" ],
"texture": "$border_texture",
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"layer": 1,
"controls": [
{
"picture": {
"type": "image",
"layer": 1,
"texture": "textures/ui/RealmDemoScreen",
"size": [ "173.91%y", "100% - 2px" ],
"offset": [ 1, 1 ],
"anchor_from": "top_left",
"anchor_to": "top_left"
}
}
]
},
"realms_scroll_content": {
"type": "input_panel",
"anchor_from": "top_left",
"anchor_to": "top_left",
"size": [ "100%", "100%" ],
"focus_container": true,
"use_last_focus": true,
"focus_navigation_mode_down": "contained",
"focus_navigation_mode_up": "contained",
"focus_navigation_mode_right": "contained",
"focus_navigation_mode_left": "contained",
"controls": [
{
"scrolling_panel@common.scrolling_panel": {
"size": [ "100%-4px", "100% - 4px" ],
"offset": [ 2, 2 ],
"anchor_from": "top_left",
"anchor_to": "top_left",
"layer": 1,
"$scrolling_pane_size": [ "100% - 1px", "100%" ],
"$scrolling_content": "choose_realm.realms_scroll_panel",
"$scroll_size": [ 5, "100% - 4px" ],
"$show_background": false
}
}
]
},
"realms_scroll_panel": {
"type": "panel",
"anchor_from": "top_left",
"anchor_to": "top_left",
"size": [ "100%-4px", "100%c" ],
"offset": [ 2, 0 ],
"controls": [
{
"realms_stack_panel": {
"type": "stack_panel",
"orientation": "vertical",
"size": [ "100%", "100%c" ],
"controls": [
{
"realms_world_item_grid@choose_realm.realms_world_item_grid": {}
},
{
"padding_0": {
"type": "panel",
"size": [ "100%", 2 ]
}
},
{
"ten_player_button@choose_realm.ten_player_button": {}
},
{
"padding_1": {
"type": "panel",
"size": [ "100%", 2 ]
}
},
{
"two_player_button@choose_realm.two_player_button": {}
}
]
}
}
]
},
"realms_world_item_grid": {
"type": "grid",
"size": [ "100%", "default" ],
"layer": 1,
"anchor_to": "top_left",
"anchor_from": "top_left",
"grid_item_template": "choose_realm.realms_world_item",
"grid_dimension_binding": "#realms_grid_dimension",
"collection_name": "realms_collection",
"bindings": [
{
"binding_name": "#realms_grid_dimension"
}
]
},
"realms_world_item": {
"type": "stack_panel",
"anchor_from": "top_left",
"anchor_to": "top_left",
"layer": 1,
"size": [ "100%", 29 ],
"orientation": "horizontal",
"controls": [
{
"realms_world_item_button@choose_realm.realms_world_item_button": {
"size": [ "fill", "100% + 1px" ],
"layer": 1
}
}
]
},
"realms_world_item_button@common_buttons.dark_content_button": {
"$pressed_button_name": "button.menu_choose_realm",
"$button_content": "choose_realm.realms_world_content_panel",
"bindings": [
{
"binding_type": "collection_details",
"binding_collection_name": "realms_collection"
},
{
"binding_type": "collection",
"binding_name": "#world_button_focus_identifier",
"binding_name_override": "#focus_identifier",
"binding_collection_name": "realms_collection"
}
]
},
"ten_player_button@settings_common.action_button_dark_text": {
"size": [ "100%", 30 ],
"$button_text_max_size": [ "100%", 20 ],
"$default_button_texture": "textures/ui/realmsContent",
"$hover_button_texture": "textures/ui/realmsContentHover",
"$pressed_button_texture": "textures/ui/realmsContentPressed",
"$button_text": "chooseRealmScreen.realmsplusbuttontext",
"anchor_from": "center",
"anchor_to": "center",
"default_focus_precedence": 2,
"$pressed_button_name": "button.ten_player",
"bindings": [
{
"binding_name": "#ten_player_button_visible",
"binding_name_override": "#visible"
}
]
},
"two_player_button@common_buttons.light_text_button": {
"$pressed_button_name": "button.two_player",
"$button_text": "chooseRealmScreen.realmsbuttontext",
"size": [ "100%", 30 ],
"anchor_from": "center",
"anchor_to": "center",
"bindings": [
{
"binding_name": "#two_player_button_visible",
"binding_name_override": "#visible"
}
]
},
"realms_world_content_panel": {
"type": "stack_panel",
"size": [ "100%", "100%" ],
"orientation": "horizontal",
"variables": [
{
"requires": "$default_state",
"$border_texture": "textures/ui/default_indent"
},
{
"requires": "$hover_state",
"$border_texture": "textures/ui/world_screenshot_focus_border"
},
{
"requires": "$pressed_state",
"$border_texture": "textures/ui/world_screenshot_focus_border"
},
{
"requires": "$locked_state",
"$border_texture": "textures/ui/default_indent"
}
],
"controls": [
{
"realm_screenshot@choose_realm.realm_screenshot": {
}
},
{
"padding": {
"type": "panel",
"size": [ 2, "100%" ]
}
},
{
"realms_world_content_text_area_panel": {
"size": [ "fill", "100%" ],
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"layer": 1,
"type": "panel",
"controls": [
{
"realms_world_text_panel": {
"type": "panel",
"size": [ "100%-2px", "100%-2px" ],
"controls": [
{
"realms_world_header": {
"type": "label",
"color": "$text_color",
"shadow": false,
"text": "$text",
"$text": "#realms_world_header",
"anchor_from": "top_left",
"anchor_to": "top_left",
"size": [ "100%", 10 ],
"bindings": [
{
"binding_name": "$text",
"binding_type": "collection",
"binding_collection_name": "realms_collection"
}
]
}
}
]
}
}
]
}
},
{
"realms_world_content_status_area_panel@play.realms_world_content_status_area_panel": {
"size": [ "100%c + 2px", "100%" ],
"anchor_from": "right_middle",
"anchor_to": "right_middle",
"layer": 1,
"type": "stack_panel",
"orientation": "horizontal",
"controls": [
{
"world_player_count_text_panel": {
"type": "panel",
"size": [ "100%c", "100%" ],
"controls": [
{
"realms_world_player_count@play.realms_world_player_count": {
"text": "#realms_world_player_count",
"size": [ "default", "default" ],
"type": "label",
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"color": "$dark_button_secondary_default_text_color",
"shadow": false,
"bindings": [
{
"binding_name": "#realms_world_player_count",
"binding_type": "collection",
"binding_collection_name": "realms_collection"
}
]
}
}
]
}
},
{
"realms_world_game_status_icon": {
"type": "panel",
"anchor_from": "right_middle",
"anchor_to": "right_middle",
"size": [ "100%y", "100%" ],
"controls": [
{
"game_online_icon": {
"type": "image",
"texture": "textures/ui/online",
"size": [ 8, 8 ],
"bindings": [
{
"binding_name": "#realms_game_online",
"binding_name_override": "#visible",
"binding_type": "collection",
"binding_collection_name": "realms_collection"
}
]
}
},
{
"game_unavailable_icon": {
"type": "image",
"texture": "textures/ui/offline",
"size": [ 8, 8 ],
"bindings": [
{
"binding_name": "#realms_game_unavailable",
"binding_name_override": "#visible",
"binding_type": "collection",
"binding_collection_name": "realms_collection"
}
]
}
},
{
"game_offline_icon": {
"type": "image",
"texture": "textures/ui/offline",
"size": [ 8, 8 ],
"bindings": [
{
"binding_name": "#realms_game_offline",
"binding_name_override": "#visible",
"binding_type": "collection",
"binding_collection_name": "realms_collection"
}
]
}
}
]
}
}
]
}
}
]
},
"main_panel": {
"type": "panel",
"layer": 1,
"size": [ "100%", "100%" ],
"anchor_from": "top_left",
"anchor_to": "top_left",
"controls": [
{
"progress_loading_bars@progress.progress_loading_bars": {
"size": [ "100% - 14px", 10 ],
"anchor_from": "top_middle",
"anchor_to": "top_middle",
"bindings": [
{
"binding_name": "#progress_loading_visible",
"binding_name_override": "#visible"
}
]
}
},
{
"realms_scroll_content@choose_realm.realms_scroll_content": {
"bindings": [
{
"binding_name": "(not #progress_loading_visible)",
"binding_name_override": "#visible"
}
]
}
}
]
},
"slots_scroll_panel": {
"type": "panel",
"anchor_from": "top_left",
"anchor_to": "top_left",
"size": [ "100%-4px", "100%c" ],
"offset": [ 2, 0 ],
"controls": [
{
"slots_stack_panel": {
"type": "stack_panel",
"orientation": "vertical",
"size": [ "100%", "100%c" ],
"controls": [
{
"padding_0": {
"type": "panel",
"size": [ "100%", 2 ]
}
},
{
"choose_slot_text": {
"type": "label",
"size": [ "default", 10 ],
"text": "realmsSlotsScreen.chooseSlot",
"color": "$dark_button_default_text_color"
}
},
{
"padding_1": {
"type": "panel",
"size": [ "100%", 2 ]
}
},
{
"slots_grid@choose_realm.slots_grid": {}
}
]
}
}
]
},
"slots_grid": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [ "100%", "100%cm" ],
"collection_name": "slots_collection",
"controls": [
{
"slot_1@common_buttons.dark_content_button": {
"size": [ "fill", "80%x" ],
"$pressed_button_name": "button.menu_choose_slot",
"$button_content": "choose_realm.slot_content_panel",
"collection_index": 0,
"$hover_button_texture": "$default_button_texture",
"$pressed_button_texture": "$default_button_texture",
"bindings": [
{
"binding_type": "collection_details",
"binding_collection_name": "slots_collection"
}
]
}
},
{
"padding_0": {
"type": "panel",
"size": [ 2, "100%sm" ]
}
},
{
"slot_2@common_buttons.dark_content_button": {
"size": [ "fill", "80%x" ],
"$pressed_button_name": "button.menu_choose_slot",
"$button_content": "choose_realm.slot_content_panel",
"collection_index": 1,
"$hover_button_texture": "$default_button_texture",
"$pressed_button_texture": "$default_button_texture",
"bindings": [
{
"binding_type": "collection_details",
"binding_collection_name": "slots_collection"
}
]
}
},
{
"padding_1": {
"type": "panel",
"size": [ 2, "100%sm" ]
}
},
{
"slot_3@common_buttons.dark_content_button": {
"size": [ "fill", "80%x" ],
"$pressed_button_name": "button.menu_choose_slot",
"$button_content": "choose_realm.slot_content_panel",
"collection_index": 2,
"$hover_button_texture": "$default_button_texture",
"$pressed_button_texture": "$default_button_texture",
"bindings": [
{
"binding_type": "collection_details",
"binding_collection_name": "slots_collection"
}
]
}
}
]
},
"slot_content_panel": {
"type": "stack_panel",
"orientation": "vertical",
"size": [ "100%", "100%" ],
"controls": [
{
"world_slot_top": {
"type": "panel",
"size": [ "100% + 4px", "70%" ],
"controls": [
{
"plus_image@realms_slots.plus": {
"bindings": [
{
"binding_name": "(not #realm_slot_is_filled)",
"binding_name_override": "#visible",
"binding_type": "collection",
"binding_collection_name": "slots_collection"
}
]
}
},
{
"world_thumbnail": {
"type": "image",
"size": [ "100%", "100% + 4.5px" ],
"offset": [ -2, 0.5 ],
"layer": 1,
"force_texture_reload": true,
"fill": true,
"bindings": [
{
"binding_name": "#realm_slot_is_filled",
"binding_name_override": "#visible",
"binding_type": "collection",
"binding_collection_name": "slots_collection"
},
{
"binding_name": "#slot_world_image",
"binding_name_override": "#texture",
"binding_type": "collection",
"binding_collection_name": "slots_collection"
},
{
"binding_name": "#slot_world_texture_source",
"binding_name_override": "#texture_file_system",
"binding_type": "collection",
"binding_collection_name": "slots_collection"
}
]
}
}
]
}
},
{
"world_slot_bottom": {
"type": "panel",
"size": [ "100% + 4px", "30% - 2px" ],
"controls": [
{
"white_line_hover": {
"visible": "($hover_state or $pressed_state)",
"type": "image",
"size": [ "100% + 1px", 2 ],
"anchor_from": "top_middle",
"anchor_to": "top_middle",
"offset": [ -2, 2 ],
"tiled": true,
"texture": "textures/ui/whiteline",
"layer": 3
}
},
{
"world_text_panel": {
"type": "panel",
"controls": [
{
"background_grey": {
"visible": "$default_state",
"type": "image",
"offset": [ -2, 3 ],
"alpha": 0.4,
"texture": "textures/ui/Grey",
"layer": 1
}
},
{
"background_green": {
"visible": "($hover_state or $pressed_state)",
"type": "image",
"offset": [ -2, 3 ],
"alpha": 0.4,
"texture": "textures/ui/banners_no_border_dark_hover",
"layer": 1
}
},
{
"world_text": {
"type": "label",
"size": [ "100% - 2px", 10 ],
"text_alignment": "center",
"font_type": "smooth",
"text": "#slot_name",
"color": "$dark_button_default_text_color",
"bindings": [
{
"binding_name": "#slot_name",
"binding_type": "collection",
"binding_collection_name": "slots_collection"
}
],
"layer": 2
}
}
]
}
}
]
}
}
]
},
"slot_panel": {
"type": "panel",
"layer": 1,
"size": [ "100%", "100%" ],
"anchor_from": "top_left",
"anchor_to": "top_left",
"controls": [
{
"slots_scroll_content": {
"type": "input_panel",
"anchor_from": "top_left",
"anchor_to": "top_left",
"size": [ "100%", "100%" ],
"focus_container": true,
"use_last_focus": true,
"focus_navigation_mode_down": "contained",
"focus_navigation_mode_up": "contained",
"focus_navigation_mode_right": "contained",
"focus_navigation_mode_left": "contained",
"controls": [
{
"scrolling_panel@common.scrolling_panel": {
"size": [ "100%-4px", "100% - 4px" ],
"offset": [ 2, 2 ],
"anchor_from": "top_left",
"anchor_to": "top_left",
"layer": 1,
"$scrolling_pane_size": [ "100% - 1px", "100%" ],
"$scrolling_content": "choose_realm.slots_scroll_panel",
"$scroll_size": [ 5, "100% - 4px" ],
"$show_background": false
}
}
]
}
}
]
},
"choose_realm_screen@common.base_screen": {
"button_mappings": [
{
"from_button_id": "button.menu_cancel",
"to_button_id": "button.menu_exit",
"mapping_type": "global"
}
],
"$screen_animations": [
"@common.screen_exit_animation_push_fade",
"@common.screen_exit_animation_pop_fade",
"@common.screen_entrance_animation_push_fade",
"@common.screen_entrance_animation_pop_fade"
],
"$background_animations": [
"@common.screen_exit_animation_push_fade",
"@common.screen_exit_animation_pop_fade",
"@common.screen_entrance_animation_push_fade",
"@common.screen_entrance_animation_pop_fade"
],
"force_render_below": true,
"$screen_content": "choose_realm.choose_realm_screen_content",
"$screen_background_control": "choose_realm.background"
},
"choose_realm_screen_content": {
"type": "panel",
"controls": [
{
"realm_dialog@common_dialogs.main_panel_no_buttons": {
"$title_panel": "common_dialogs.standard_title_label",
"$title_size": [ "100% - 14px", 10 ],
"size": "$choose_realm_screen_size",
"$text_name": "#window_title_text",
"$title_text_binding_type": "global",
"$child_control": "choose_realm.main_panel",
"layer": 2,
"bindings": [
{
"binding_name": "(not #slots_view_toggle)",
"binding_name_override": "#visible"
}
]
}
},
{
"slot_dialog@common_dialogs.main_panel_no_buttons": {
"$use_custom_title_control": true,
"$custom_title_label": "common.back_content_panel",
"$back_button_has_title": true,
"$button_text": "#slot_dialog_header",
"$button_text_binding_type": "global",
"$back_button_pressed_button_name": "modal.back",
"$title_size": [ "100% - 14px", 10 ],
"size": "$choose_realm_screen_size",
"$child_control": "choose_realm.slot_panel",
"layer": 2,
"bindings": [
{
"binding_name": "#slots_view_toggle",
"binding_name_override": "#visible"
}
]
}
}
]
},
"background@common.screen_background": {
"alpha": 0.65,
"layer": 1
}
}