/********************************************************
+*   (c) Mojang. All rights reserved                       *
+*   (c) Microsoft. All rights reserved.                   *
+*********************************************************/

{
  "namespace": "brewing_stand",
  //-----------------------------------------------------------
  // Images
  //-----------------------------------------------------------

  "brewing_pipes": {
    "type": "image",
    "layer": 2,
    "texture": "textures/ui/brewing_pipes",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ 0, 3 ],
    "size": [ 30, 26 ]
  },

  "brewing_fuel_pipes": {
    "type": "image",
    "layer": 2,
    "texture": "textures/ui/brewing_fuel_pipes",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ -47, -5 ],
    "size": [ 30, 22 ]
  },

  "bottle_empty_image": {
    "type": "image",
    "texture": "textures/ui/bottle_empty",
    "layer": 2,
    "offset": [ 1, -1 ],
    "size": [ 16, 16 ],
    "anchor_from": "center",
    "anchor_to": "center",
    "bindings": [
      {
        "binding_name": "#empty_bottle_image_visible",
        "binding_name_override": "#visible",
        "binding_type": "collection",
        "binding_collection_name": "$item_collection_name"
      }
    ]
  },

  "fuel_empty_image": {
    "type": "image",
    "texture": "textures/ui/brewing_fuel_empty",
    "layer": 2,
    "offset": [ 0, -1 ],
    "size": [ 16, 16 ],
    "anchor_from": "center",
    "anchor_to": "center",
    "bindings": [
      {
        "binding_name": "#empty_fuel_image_visible",
        "binding_name_override": "#visible",
        "binding_type": "collection",
        "binding_collection_name": "$item_collection_name"
      }
    ]
  },

  "bubbles_empty_image": {
    "type": "image",
    "texture": "textures/ui/bubbles_empty",
    "layer": 2,
    "offset": [ -23, -14 ],
    "size": [ 12, 30 ],
    "anchor_from": "center",
    "anchor_to": "center"
  },

  "bubbles_full_image": {
    "type": "image",
    "texture": "textures/ui/bubbles_full",
    "layer": 3,
    "offset": [ -23, -14 ],
    "size": [ 12, 30 ],
    "clip_direction": "down",
    "bindings": [
      {
        "binding_name": "#brewing_bubbles_ratio",
        "binding_name_override": "#clip_ratio",
        "binding_condition": "always"
      }
    ]
  },

  "brewing_arrow_empty_image": {
    "type": "image",
    "layer": 1,
    "texture": "textures/ui/brewing_arrow_empty",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ 16, -14 ],
    "size": [ 9, 28 ]
  },

  "brewing_arrow_full_image": {
    "type": "image",
    "layer": 3,
    "texture": "textures/ui/brewing_arrow_full",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ 16, -14 ],
    "size": [ 9, 28 ],
    "clip_direction": "up",
    "bindings": [
      {
        "binding_name": "#brewing_arrow_ratio",
        "binding_name_override": "#clip_ratio",
        "binding_condition": "always"
      }
    ]
  },

  "brewing_fuel_bar_empty_image": {
    "type": "image",
    "layer": 1,
    "texture": "textures/ui/brewing_fuel_bar_empty",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ -23, 3 ],
    "size": [ 24, 6 ]
  },

  "brewing_fuel_bar_full_image": {
    "type": "image",
    "layer": 3,
    "texture": "textures/ui/brewing_fuel_bar_full",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ -23, 3 ],
    "size": [ 22, 4 ],
    "clip_direction": "left",
    "bindings": [
      {
        "binding_name": "#brewing_fuel_ratio",
        "binding_name_override": "#clip_ratio",
        "binding_condition": "always"
      }
    ]
  },

  //-----------------------------------------------------------
  // Screen
  //-----------------------------------------------------------

  "brewing_label": {
    "type": "label",
    "offset": [ 0, -3 ],
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "text": "$container_title",
    "color": "$title_text_color",
    "layer": 2
  },

  "brewingstand_output_item@common.container_item": {
    "size": [ 18, 18 ],
    "$cell_overlay_ref": "brewing_stand.bottle_empty_image",
    "$item_collection_name": "brewing_result_items"
  },

  "brewing_output_slots": {
    "type": "grid",
    "size": [ 54, 18 ],
    "offset": [ 0, 23 ],
    "grid_dimensions": [ 3, 1 ],
    "collection_name": "brewing_result_items",
    "controls": [
      {
        "left_offset": {
          "type": "panel",
          "grid_position": [ 0, 0 ],
          "controls": [
            {
              "output_grid_item1@brewing_stand.brewingstand_output_item": {
                "offset": [ -5, -7 ],

                "$focus_override_left_binding_type": "none",
                "$focus_override_left": "brewing_fuel"
              }
            }
          ]
        }
      },
      {
        "output_grid_item2@brewing_stand.brewingstand_output_item": {
          "grid_position": [ 1, 0 ]
        }
      },
      {
        "right_offset": {
          "type": "panel",
          "grid_position": [ 2, 0 ],
          "controls": [
            {
              "output_grid_item3@brewing_stand.brewingstand_output_item": {
                "offset": [ 5, -7 ]
              }
            }
          ]
        }
      }
    ]
  },

  "brewing_input_slot": {
    "type": "panel",
    "size": [ 18, 18 ],
    "offset": [ 0, -18 ],
    "controls": [
      {
        "input_grid_item@common.container_item": {
          "$item_collection_name": "brewing_input_item",

          "$focus_override_left_binding_type": "none",
          "$focus_override_left": "brewing_fuel"
        }
      }
    ]
  },

  "brewing_fuel_slot": {
    "type": "panel",
    "size": [ 18, 18 ],
    "offset": [ -70, -18 ],
    "controls": [
      {
        "fuel_grid_item@common.container_item": {
          "$cell_overlay_ref": "brewing_stand.fuel_empty_image",
          "$item_collection_name": "brewing_fuel_item",

          "$focus_id_binding_type": "none",
          "$focus_id": "brewing_fuel",

          "$focus_override_right_binding_type": "none",
          "$focus_override_right": "brewing_input_item0"
        }
      }
    ]
  },

  "brewing_panel_top_half": {
    "type": "panel",
    "size": [ "100%", "50% - 12px" ],
    "offset": [ 0, 7 ],
    "anchor_to": "top_middle",
    "anchor_from": "top_middle",
    "controls": [
      { "brewing_label@brewing_label": { } },
      { "brewing_stand_pictogram@brewing_stand_pictogram": { } }
    ]
  },

  "brewing_stand_pictogram": {
    "type": "panel",
    "size": [ "40%", "80%" ],
    "controls": [
      { "brewing_input_slot@brewing_stand.brewing_input_slot": { } },
      { "brewing_output_slots@brewing_stand.brewing_output_slots": { } },
      { "brewing_fuel_slot@brewing_stand.brewing_fuel_slot": { } },
      { "brewing_arrow_empty_image@brewing_stand.brewing_arrow_empty_image": { } },
      { "brewing_arrow_full_image@brewing_stand.brewing_arrow_full_image": { } },
      { "brewing_fuel_bar_empty_image@brewing_stand.brewing_fuel_bar_empty_image": { } },
      { "brewing_fuel_bar_full_image@brewing_stand.brewing_fuel_bar_full_image": { } },
      { "bubbles_empty_image@brewing_stand.bubbles_empty_image": { } },
      { "bubbles_full_image@brewing_stand.bubbles_full_image": { } },
      { "brewing_fuel_pipes@brewing_stand.brewing_fuel_pipes": { } },
      { "brewing_pipes@brewing_stand.brewing_pipes": { } }
    ]
  },

  "brewing_stand_panel": {
    "type": "panel",
    "controls": [
      { "container_gamepad_helpers@common.container_gamepad_helpers": {} },
      {
        "flying_item_renderer@common.flying_item_renderer": {
          "layer": 11
        }
      },
      { "selected_item_details_factory@common.selected_item_details_factory": {} },
      {
        "root_panel@common.root_panel": {
          "layer": 1,
          "controls": [
            { "common_panel@common.common_panel": {} },
            {
              "furnace_screen_inventory": {
                "type": "panel",
                "layer": 5,
                "controls": [
                  { "brewing_panel_top_half@brewing_stand.brewing_panel_top_half": {} },
                  { "inventory_panel_bottom_half_with_label@common.inventory_panel_bottom_half_with_label": {} },
                  { "hotbar_grid@common.hotbar_grid_template": {} },
                  { "inventory_take_progress_icon_button@common.inventory_take_progress_icon_button": {} }
                ]
              }
            },
            { "inventory_selected_icon_button@common.inventory_selected_icon_button": {} },
            { "gamepad_cursor@common.gamepad_cursor_button": {} }
          ]
        }
      }
    ]
  },
  "brewing_stand_screen@common.inventory_screen_common": {
    "$close_on_player_hurt|default": true,
    "close_on_player_hurt": "$close_on_player_hurt",
    "variables": [
      {
        "requires": "$desktop_screen",
        "$screen_content": "brewing_stand.brewing_stand_panel",
        "$screen_bg_content": "common.screen_background"
      },
      {
        "requires": "$pocket_screen",
        "$screen_content": "brewing_stand_pocket.brewing_stand_panel"
      }
    ]
  }
}