{
  "namespace": "transmutation_table",

  "view": {
    "type": "button",
    "focus_enabled": true,
    "focus_wrap_enabled": false,
    "focus_magnet_enabled": true,
    "$highlight_control|default": "common.highlight_slot_panel",
    "default_focus_precedence": 1,
    "hover_control": "hover",
    "layer": 1,
    "controls": [
      {
        "hover@$highlight_control": {}
      }
    ]
  },

  "title_text": {
    "type": "label",
    "text": "Transmutation Table",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "color": [281, 23, 84],
    "shadow": false,
    "font_scale_factor": 1.1,
    "layer": 2,
    "offset": [16, -3]
  },

  "container_slot_give@common.container_slot_button_prototype": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_secondary_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_auto_place",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_inventory_drop",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_inventory_drop_all",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      }
    ]
  },

  "container_button_ui@common.GUIButton": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_secondary_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_auto_place",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_inventory_drop",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_inventory_drop_all",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "pressed"
      }
    ],
    "controls": [
      {
        "hover@$highlight_control": {
          "$hover_text": "$button_text",
          "$hover_texture": "($icon_name + '_hover')"
        }
      },
      {
        "pressed": {
          "type": "image",
          "texture": "($icon_name + '_pressed')"
        }
      },
      {
        "default": {
          "type": "image",
          "texture": "($icon_name + '_default')"
        }
      }
    ]
  },

  "container_slot_inventory@common.container_slot_button_prototype": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.container_take_all_place_all",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.container_take_all_place_all",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_back",
        "to_button_id": "button.container_take_all_place_all",
        "mapping_type": "pressed",
        "ignored": "(not $is_ps4)"
      },
      {
        "from_button_id": "button.menu_secondary_select",
        "to_button_id": "button.container_take_half_place_one",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_select",
        "to_button_id": "button.container_take_half_place_one",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_auto_place",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "none"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "to_button_id": "button.container_auto_place",
        "mapping_type": "none"
      },
      {
        "from_button_id": "button.menu_inventory_drop",
        "to_button_id": "button.drop_one",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_inventory_drop_all",
        "to_button_id": "button.drop_all",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.coalesce_stack",
        "mapping_type": "none"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.coalesce_stack",
        "mapping_type": "none"
      },
      {
        "to_button_id": "button.shape_drawing",
        "mapping_type": "pressed"
      },
      {
        "to_button_id": "button.container_slot_hovered",
        "mapping_type": "pressed"
      }
    ]
  },

  "book": {
    "type": "image",
    "texture": "textures/project_emc/gui/transmutation_book_overlay",
    "layer": 1,
    "size": [16, 16]
  },

  "flame": {
    "type": "image",
    "texture": "textures/project_emc/gui/flame_slot",
    "layer": 1,
    "size": [16, 16]
  },

  "slot": {
    "type": "stack_panel",
    "$index": 0,
    "$collection_name": "collection",
    "collection_name": "$collection_name",
    "$slot_size": [18, 18],
    "$slot_image_size": [18, 18],
    "controls": [
      {
        "slot@chest.chest_grid_item": {
          "ignored": false,
          "$cell_image_size": "$slot_image_size",
          "size": "$slot_size",
          "collection_index": "$index",
          "property_bag": {
            "#name": "[Empty]"
          },
          "bindings": [
            {
              "binding_name": "#item_name",
              "binding_type": "collection",
              "binding_collection_name": "container_items"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#item_name - ' ') = ''))",
              "target_property_name": "#show_tooltip"
            }
          ]
        }
      }
    ]
  },

  "text_display": {
    "type": "stack_panel",
    "$index": 0,
    "$collection_name": "collection",
    "size": [18, 18],
    "collection_name": "$collection_name",
    "controls": [
      {
        "text": {
          "type": "label",
          "text": "$hover_text_binding_name",
          "collection_index": "$index",
          "property_bag": {
            "#ttext": "teste"
          },
          "color": "$title_text_color",
          "$hover_text_binding_name": "#hover_text",
          "bindings": [
            {
              "binding_name_override": "#hover_text",
              "binding_name": "$hover_text_binding_name",
              "binding_condition": "always_when_visible",
              "binding_type": "collection",
              "binding_collection_name": "$collection_name"
            }
          ]
        }
      }
    ]
  },

  "slot_icon": {
    "type": "stack_panel",
    "$index": 0,
    "$collection_name": "collection",
    "collection_name": "$collection_name",
    "$slot_size": [18, 18],
    "$slot_image_size": [18, 18],
    "$sub_icon": "textues/items/diamond",
    "controls": [
      {
        "slot@common.icon_container_item": {
          "ignored": false,
          "$cell_image_size": "$slot_image_size",
          "size": "$slot_size",
          "$button_text": "$hover_text",
          "$icon_texture": "$sub_icon",
          "collection_index": "$index",
          "$item_collection_name": "$collection_name"
        }
      }
    ]
  },

  "grid": {
    "type": "panel",
    "size": [229, 197],
    "$collection_name": "container_items",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "controls": [
      {
        "book_slot@transmutation_table.slot": {
          "$index": 10,
          "$cell_overlay_ref": "transmutation_table.book",
          "$slot_image_size": [0, 0],
          "$collection_name": "container_items",
          "offset": [4, 70]
        }
      },
      {
        "transmutable_slot_01@transmutation_table.slot": {
          "$index": 1,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [24, 13]
        }
      },
      {
        "transmutable_slot_02@transmutation_table.slot": {
          "$index": 2,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [42, 13]
        }
      },
      {
        "transmutable_slot_03@transmutation_table.slot": {
          "$index": 3,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [60, 13]
        }
      },
      {
        "transmutable_slot_04@transmutation_table.slot": {
          "$index": 4,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [24, 31]
        }
      },
      {
        "transmutable_slot_05@transmutation_table.slot": {
          "$index": 5,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [42, 31]
        }
      },
      {
        "transmutable_slot_06@transmutation_table.slot": {
          "$index": 6,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [60, 31]
        }
      },
      {
        "transmutable_slot_07@transmutation_table.slot": {
          "$index": 7,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [24, 49]
        }
      },
      {
        "transmutable_slot_08@transmutation_table.slot": {
          "$index": 8,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [42, 49]
        }
      },
      {
        "transmutable_slot_09@transmutation_table.slot": {
          "$index": 9,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [60, 49]
        }
      },
      {
        "burn_slot@transmutation_table.slot": {
          "$index": 0,
          "$collection_name": "container_items",
          "$cell_overlay_ref": "transmutation_table.flame",
          "$slot_image_size": [0, 0],
          "offset": [42, 71]
        }
      },
      {
        "transmutable_slot_01_display@transmutation_table.slot": {
          "$index": 11,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [24, 13]
        }
      },
      {
        "transmutable_slot_02_display@transmutation_table.slot": {
          "$index": 12,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [42, 13]
        }
      },
      {
        "transmutable_slot_03_display@transmutation_table.slot": {
          "$index": 13,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [60, 13]
        }
      },
      {
        "transmutable_slot_04_display@transmutation_table.slot": {
          "$index": 14,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [24, 31]
        }
      },
      {
        "transmutable_slot_05_display@transmutation_table.slot": {
          "$index": 15,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [42, 31]
        }
      },
      {
        "transmutable_slot_06_display@transmutation_table.slot": {
          "$index": 16,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [60, 31]
        }
      },
      {
        "transmutable_slot_07_display@transmutation_table.slot": {
          "$index": 17,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [24, 49]
        }
      },
      {
        "transmutable_slot_08_display@transmutation_table.slot": {
          "$index": 18,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [42, 49]
        }
      },
      {
        "transmutable_slot_09_display@transmutation_table.slot": {
          "$index": 19,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [60, 49]
        }
      },
      {
        "purchase_slot_01@transmutation_table.slot": {
          "$index": 21,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [137, 13]
        }
      },
      {
        "purchase_slot_02@transmutation_table.slot": {
          "$index": 22,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [155, 13]
        }
      },
      {
        "purchase_slot_03@transmutation_table.slot": {
          "$index": 23,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [173, 13]
        }
      },
      {
        "purchase_slot_04@transmutation_table.slot": {
          "$index": 24,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [137, 31]
        }
      },
      {
        "purchase_slot_05@transmutation_table.slot": {
          "$index": 25,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [155, 31]
        }
      },
      {
        "purchase_slot_06@transmutation_table.slot": {
          "$index": 26,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [173, 31]
        }
      },
      {
        "purchase_slot_01_display@transmutation_table.slot": {
          "$index": 31,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [137, 13]
        }
      },
      {
        "purchase_slot_02_display@transmutation_table.slot": {
          "$index": 32,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [155, 13]
        }
      },
      {
        "purchase_slot_03_display@transmutation_table.slot": {
          "$index": 33,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [173, 13]
        }
      },
      {
        "purchase_slot_04_display@transmutation_table.slot": {
          "$index": 34,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [137, 31]
        }
      },
      {
        "purchase_slot_05_display@transmutation_table.slot": {
          "$index": 35,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [155, 31]
        }
      },
      {
        "purchase_slot_06_display@transmutation_table.slot": {
          "$index": 36,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [173, 31]
        }
      },
      {
        "confirm_slot_display@transmutation_table.slot": {
          "$index": 37,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_slot_give",
          "$slot_image_size": [0, 0],
          "offset": [155, 51]
        }
      }
    ]
  },

  "top_half": {
    "type": "panel",
    "size": ["100%", "50% - 12px"],
    "offset": [0, 7],
    "anchor_to": "top_left",
    "anchor_from": "top_left",
    "controls": [
      {
        "title@transmutation_table.title_text": {}
      },
      {
        "quantity_button@transmutation_table.slot_icon": {
          "$index": 20,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_button_ui",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "$sub_icon": "textures/project_emc/gui/quantity_button",
          "$hover_text": "Quantity",
          "$slot_image_size": [16, 16],
          "$slot_size": [18, 18],
          "offset": [91, 71]
        }
      },
      {
        "PagePrevious@transmutation_table.slot_icon": {
          "$index": 27,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_button_ui",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "$sub_icon": "textures/project_emc/gui/previous_button",
          "$hover_text": "Previous Page",
          "$slot_image_size": [16, 16],
          "$slot_size": [16, 16],
          "offset": [15, 32]
        }
      },
      {
        "PageNext@transmutation_table.slot_icon": {
          "$index": 28,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_button_ui",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "$sub_icon": "textures/project_emc/gui/next_button",
          "$hover_text": "Next Page",
          "$slot_image_size": [16, 16],
          "$slot_size": [16, 16],
          "offset": [91, 32]
        }
      },
      {
        "emc_display@transmutation_table.text_display": {
          "$index": 29,
          "$collection_name": "container_items",
          "offset": [138, 72],
          "anchor_from": "top_left",
          "anchor_to": "top_left"
        }
      },
      {
        "confirm_button@transmutation_table.slot_icon": {
          "$index": 30,
          "$collection_name": "container_items",
          "$button_ref": "transmutation_table.container_button_ui",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "$sub_icon": "textures/project_emc/gui/confirm_button",
          "$hover_text": "Confirm",
          "$slot_image_size": [16, 16],
          "$slot_size": [16, 16],
          "offset": [166, 52]
        }
      },
      {
        "grid@transmutation_table.grid": {
          "offset": [10, -89]
        }
      }
    ]
  }
}
