{
  "namespace": "furnace",


  //---------------------------------------------------------------------------
  // Furnace
  //---------------------------------------------------------------------------

  "flame_panel": {
    "type": "panel",
    "size": [ 13, 13 ],
    "offset": [ -21, 0 ],
    "controls": [
      {
        "flame_empty_image@furnace.flame_empty_image": {}
      },
      {
        "flame_full_image@furnace.flame_full_image": {}
      }
    ]
  },

  "furnace_arrow_empty_image": {
    "type": "image",
    "layer": 1,
    "texture": "textures/ui/arrow_inactive",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ 22, 15 ]
  },

  "furnace_arrow_full_image": {
    "type": "image",
    "layer": 3,
    "texture": "textures/ui/arrow_active",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ 22, 15 ],
    "clip_direction": "left",
    "bindings": [
      {
        "binding_name": "#furnace_arrow_ratio",
        "binding_name_override": "#clip_ratio",
        "binding_condition": "always"
      }
    ]
  },

  "flame_empty_image": {
    "type": "image",
    "texture": "textures/ui/flame_empty_image",
    "layer": 2
  },

  "flame_full_image": {
    "type": "image",
    "texture": "textures/ui/flame_full_image",
    "layer": 3,
    "clip_direction": "down",
    "bindings": [
      {
        "binding_name": "#furnace_flame_ratio",
        "binding_name_override": "#clip_ratio",
        "binding_condition": "always"
      }
    ]
  },

  //---------------------------------------------------------------------------
  // Screens
  //---------------------------------------------------------------------------

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

  "furnace_input_panel": {
    "type": "panel",
    "size": [ "50%", "100%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "panel": {
          "type": "panel",
          "size": [ 16, 16 ],
          "anchor_from": "right_middle",
          "anchor_to": "right_middle",
          "controls": [
            { "furnace_ingredient_panel@furnace_ingredient_panel": {} },
            { "flame_panel@flame_panel": {} },
            { "furnace_fuel_panel@furnace_fuel_panel": {} }
          ]
        }
      }
    ]
  },

  "furnace_ingredient_panel": {
    "type": "panel",
    "size": [ 18, 18 ],
    "offset": [ -20, -19 ],
    "anchor_from": "right_middle",
    "anchor_to": "right_middle",
    "controls": [
      {
        "ingredient_item@common.container_item": {
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "$item_collection_name": "furnace_ingredient_items",

          "$focus_id": "furnace_ingredient_item",
          "$focus_override_left": "FOCUS_OVERRIDE_STOP",
          "$focus_override_left_binding_type": "none",
          "$focus_override_up": "FOCUS_OVERRIDE_STOP",
          "$focus_override_up_binding_type": "none"
        }
      }
    ]
  },

  "furnace_fuel_panel": {
    "type": "panel",
    "size": [ 18, 18 ],
    "offset": [ -20, 19 ],
    "anchor_from": "right_middle",
    "anchor_to": "right_middle",
    "controls": [
      {
        "fuel_item@common.container_item": {
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "$item_collection_name": "furnace_fuel_items",

          "$focus_id": "furnace_fuel_item",
          "$focus_override_right": "furnace_output_item",
          "$focus_override_right_binding_type": "none",
          "$focus_override_left": "FOCUS_OVERRIDE_STOP",
          "$focus_override_left_binding_type": "none"
        }
      }
    ]
  },

  "furnace_output_panel": {
    "type": "panel",
    "size": [ "50%", "100%" ],
    "anchor_from": "top_right",
    "anchor_to": "top_right",
    "controls": [
      {
        "output_item@common.container_item": {
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "size": [ 26, 26 ],
          "$cell_image_size": [ 26, 26 ],
          "offset": [ 20, 0 ],
          "$item_collection_name": "furnace_output_items",

          "$focus_id": "furnace_output_item",
          "$focus_override_right_binding_type": "none",
          "$focus_override_right": "FOCUS_OVERRIDE_STOP",
          "$focus_override_left_binding_type": "none",
          "$focus_override_left": "furnace_fuel_item"
        }
      }
    ]
  },

  "furnace_panel_top_half": {
    "type": "panel",
    "size": [ "100%", "50% - 12px" ],
    "offset": [ 0, 7 ],
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "controls": [
      { "furnace_label@furnace_label": {} },
      { "input@furnace_input_panel": {} },
      {
        "furnace_arrow_empty_image@furnace_arrow_empty_image": {
          "anchor_to": "center",
          "anchor_from": "center"
        }
      },
      {
        "furnace_arrow_full_image@furnace_arrow_full_image": {
          "anchor_to": "center",
          "anchor_from": "center"
        }
      },
      { "output@furnace_output_panel": {} }
    ]
  },

  "furnace_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": [
                  { "furnace_panel_top_half@furnace.furnace_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": {} }
          ]
        }
      }
    ]
  },
  "furnace_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": "furnace.furnace_panel",
        "$screen_bg_content": "common.screen_background"
      },
      {
        "requires": "$pocket_screen",
        "$screen_content": "furnace_pocket.furnace_panel"
      }
    ]
  }
}