{
  "namespace": "smelterycontroller",
  
//ui picture	
"smelterycontroller@horse.overlay_image": {
    "texture": "textures/ui/smeltery_controller_ui",
	"alpha": 1
  },
  
  //panel for having grid offset
  "input_grid_panel":{
	"type": "panel",
    "grid_position": [ 0, 0 ],
    "ignored": true
  },
	
  //crafting grid
  "custom_crafting_grid_3x3": {
    "type": "grid",
    "size": [ 63, 63 ], //changed this if u want to change the area size between grids
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "grid_dimensions": [ 3, 3 ],
    "collection_name": "crafting_input_items",

    "controls": [
	{
	//top	
    "top_left@input_grid_panel": {
	"grid_position": [ 0, 0 ],
    "ignored": false,
      "controls": [
      {
		"left_top@crafting.crafting_input_grid_item": {
		"offset": [ -26, -20 ] //change this if u want to move this grid
		}
	  }
	  ]
	}
    },
	{
    "top_middle@input_grid_panel": {
	"grid_position": [ 1, 0 ], 
    "ignored": false, //set to true if you want to show this grid
      "controls": [
      {
        "top_middle@crafting.crafting_input_grid_item": {
          "offset": [ -26, -20 ]
		}
	  }
	  ]
	}
    },
	{
    "top_right@input_grid_panel": {
	"grid_position": [ 2, 0 ], 
    "ignored": false, //set to true if you want to show this grid
      "controls": [
      {
        "top_right@crafting.crafting_input_grid_item": {
          "offset": [ -26, -20 ]
		}
	  }
	  ]
	}
    },
	{
	//middle	
    "middle_left@input_grid_panel": {
	"grid_position": [ 0, 1 ],
    "ignored": false,
      "controls": [
      {
        "middle_left@crafting.crafting_input_grid_item": {
          "offset": [ -26, -23 ]
		}
	  }
	  ]
	}
    },
	{
    "middle@input_grid_panel": {
	"grid_position": [ 1, 1 ],
    "ignored": false,
      "controls": [
      {
        "middle@crafting.crafting_input_grid_item": {
          "offset": [ -26, -23 ]
		}
	  }
	  ]
	}
    },
	{
    "middle_right@input_grid_panel": {
	"grid_position": [ 2, 1 ],
    "ignored": false,
      "controls": [
      {
        "middle_right@crafting.crafting_input_grid_item": {
          "offset": [ -26, -23 ]
        }
	  }
	  ]
	}
    },
	{
	//bottom	
    "bottom_left@input_grid_panel": {
	"grid_position": [ 0, 2 ],
    "ignored": false,
      "controls": [
      {
        "bottom_left@crafting.crafting_input_grid_item": {
          "offset": [ -26, -26 ]
        }
	  }
	  ]
	}
    },
	{
    "bottom_middle@input_grid_panel": {
	"grid_position": [ 1, 2 ],
    "ignored": false,
      "controls": [
      {
        "bottom_middle@crafting.crafting_input_grid_item": {
          "offset": [ -26, -26 ]
        }
	  }
	  ]
	}
    },
	{
    "bottom_right@input_grid_panel": {
	"grid_position": [ 2, 2 ],
    "ignored": false,
      "controls": [
      {
        "bottom_right@crafting.crafting_input_grid_item": {
          "offset": [ -26, -26 ]
        }
	  }
	  ]
	}
    }
    ]
  },
  //workbench
  "custom_work_bench_panel_3x3": {
    "type": "panel",
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "controls": [
      {
        "crafting_label_0@crafting.crafting_label": {
          "offset": [ -5, 6 ]
        }
      },
      {
        "inventory_label@crafting.inventory_label": {
          "offset": [ -18, 87 ],
		  "ignored": false
        }
      },
      {
        "crafting_arrow_large@crafting.crafting_arrow_large": {
          "offset": [ 61, 35 ],
		  "ignored": true
        }
      },
      {
        "crafting_grid_3x3@custom_crafting_grid_3x3": {
          "offset": [ 20, 40 ]
        }
      },
	  //This is where the crafted item will output
      {
        "work_bench_output_grid@crafting.output_grid_3x3": {
          "offset": [ 76, 35.7 ]
        }
      }
    ]
  },
    //top half
  "custom_crafting_panel_top_half": {
	 "type": "panel",
    "size": [ "100%", "50%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "crafting_panel@custom_work_bench_panel_3x3": {
          "offset": [ 27, 0 ]
        }
      }
    ]  
  },
  //player inventory
  "custom_player_inventory@common.root_panel": {
    "layer": 1,
	"size":[180,180],
    "controls": [
	    //this the ui image
		{
		"ki@smelterycontroller":{
			"layer": 5,
			"size":["95%",90],
			"offset":[-2.5,-37.5]
		}
		},
      {
        "common_panel@common.common_panel": {
          "offset": [ 0, 0 ],
          "$show_close_button": true
        }
      },
      {
        "inventory_panel_top_half@$top_half_variant": {
          "layer": 2
        }
      },
      {
        "inventory_panel_bottom_half@common.inventory_panel_bottom_half": {
          "layer": 2,
          "$button_ref": "crafting.inventory_container_slot_button",
          "$background_images": "crafting.container_cell_images"

        }
      },
      {
        "hotbar_grid@common.hotbar_grid_template": {
          "layer": 2,
          "$button_ref": "crafting.inventory_container_slot_button",
          "$background_images": "crafting.container_cell_images"

        }
      }
    ]
  },
  //this controls items
    "item_control": {
    "type": "panel",
    "controls": [
	
     { "inventory_take_progress_icon_button@common.inventory_take_progress_icon_button": {} },
      { "inventory_selected_icon_button@common.inventory_selected_icon_button": {} },
      { "hold_icon@common.inventory_take_progress_icon_button": {} },
      {
        "controller_gamepad_helpers_stack_panel": {
          "type": "stack_panel",
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "controls": [
            { "container_gamepad_helpers_second_row@crafting.container_gamepad_helpers_second_row": {} },
            {
              "container_gamepad_helpers@common.container_gamepad_helpers": {
                "$helper_x_control": "crafting.inventory_x_gamepad_helper",
                "$helper_y_control": "crafting.inventory_y_gamepad_helper",
                "$helper_a_control": "crafting.inventory_a_gamepad_helper"
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#gamepad_helper_visible",
              "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
        "flying_item_renderer@common.flying_item_renderer": {
          "layer": 13
        }
      },
      {
        "game_tip@game_tip.game_tip_panel": {
          "layer": 100,
          "$offset|default": [ 0, 110 ],
          "variables": [
            {
              "requires": "$game_pad",
              "$offset": [ 0, "38%" ]
            }
          ],
          "offset": "$offset"
        }
      },
      { "selected_item_details_factory@common.selected_item_details_factory": {} },
      { "item_lock_notification_factory@common.item_lock_notification_factory": {} }
	  ]
	},
  //Final panel to show
  //use lang file to change your container title
  "final_panel":{
		"type": "panel",
		"$top_half_variant": "custom_crafting_panel_top_half",
		"controls":[
		{ "cpi@custom_player_inventory":{} },
		{ "icontrol@item_control": {} }
		],
		"bindings": [
		{
        	"binding_name": "#crafting_label_text"
		},
		{
		"binding_type": "view",
		"source_property_name": "(#crafting_label_text = 'Smeltery')", //your custom crafting table default name (in the behaviors)
		"target_property_name": "#visible" 
		}
		]		
	}
}
