{
  "namespace": "common",
    
    "cell_overlay": {
        "type": "image",
        "size": [ 18, 18 ],
        "texture": "textures//ui/cell_image"
    },
    
    "slot_selected": {
        "type": "image",
        "texture": "textures/ui/selected_hotbar_slot",
        "size": [ 18, 18 ]
    },

    "hover_text_label": {
        "type": "label",
        "text": "#hover_text",
        "color": [ 1, 1, 1 ],
        "bindings": [
            {
                "binding_name": "#hover_text"
            }
        ],
        "controls": [
            {
                "emc_value": {
                    "type": "label",
                    "color": [ 0, 229, 255 ],
                    "text": "#emc_text",
                    "bindings": [
                        {
                            "binding_name": "#hover_text",
                            "binding_name_override": "#emc_text",
                            "binding_condition": "always"
                        }
                    ]
                }
            },
            {
                "stack_value": {
                    "type": "label",
                    "color": [ 0, 64, 255 ],
                    "text": "#stack_text",
                    "bindings": [
                        {
                            "binding_name": "#hover_text",
                            "binding_name_override": "#stack_text",
                            "binding_condition": "always"
                        }
                    ]
                }
            }
        ]
    },

    "hover_text": {
        "type": "custom",
        "renderer": "hover_text_renderer",
        "size": [ "100%c", "100%c" ],
        "$hover_text_max_width": 400,
        "controls": [
            {
                "hover_panel": {
                    "type": "panel",
                    "controls": [
                        { "label@hover_text_label": {} }
                    ]
                }
            }
        ]
    },

    "hover_button_gui": {
        "type": "panel",
        "controls": [
            {
                "highlight": {
                    "type": "image",
                    "texture": "$hover_texture",
                    "layer": 29,
                    "controls": [
                        {
                            "hover_text_control@common.hover_text": {
                                "layer": 30
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#show_tooltip",
                            "binding_name_override": "#visible",
                            "binding_condition": "always"
                        }
                    ]
                }
            }
        ]
    },

    "bundle_mode_popup_control": {
        "type": "panel",
        "controls": [
            {
                "popup_text": {
                    "type": "label",
                    "text": "#bundle_popup_text",
                    "bindings": [
                        {
                            "binding_name": "#bundle_popup_text"
                        }
                    ]
                }
            }
        ]
    },

    "icon_container_item": {
        "type": "input_panel",
        "size": [ 18, 18 ],
        "layer": 1,
        "$cell_image_size|default": [ 18, 18 ],
        "$cell_overlay_ref|default": "common.cell_overlay",
        "$button_ref|default": "common.container_slot_button_prototype",
        "$stack_count_required|default": true,
        "$durability_bar_required|default": true,
        "$storage_bar_required|default": true,
        "$item_renderer|default": "common.item_renderer",
        "$item_renderer_panel_size|default": [ 18, 18 ],
        "$item_renderer_size|default": [ 16, 16 ],
        "$item_renderer_offset|default": [ 0, 0 ],
        "$background_images|default": "common.cell_image",
        "$background_image_control_name|default": "bg",
        
        "$focus_id|default": "",
        "$focus_override_down|default": "",
        "$focus_override_up|default": "",
        "$focus_override_left|default": "",
        "$focus_override_right|default": "",
        "focus_identifier": "$focus_id",
        "focus_change_down": "$focus_override_down",
        "focus_change_up": "$focus_override_up",
        "focus_change_left": "$focus_override_left",
        "focus_change_right": "$focus_override_right",
        "focus_enabled": true,
        "focus_wrap_enabled": false,
        "focus_magnet_enabled": true,
        "controls": [
            {
                "item_cell_overlay_ref@$cell_overlay_ref": {
                    "layer": 3
                }
            },
            {
                "item_selected_image@common.slot_selected": {
                    "layer": 4
                }
            },
            {
                "item_button_ref@$button_ref": {
                    "tts_ignore_count": true,
                    "tts_skip_message": true,
                    "tts_inherit_siblings": true,
                    "$icon_name": "$icon_texture",
                    "$button_text": "$button_text",
                    "layer": 5
                }
            }
        ]
    },

    "GUIButton": {
        "type": "button",
    
        "$focus_id|default": "",
        "$focus_override_down|default": "",
        "$focus_override_up|default": "",
        "$focus_override_left|default": "",
        "$focus_override_right|default": "",
    
        "$focus_id_binding_type|default": "collection",
        "$focus_override_down_binding_type|default": "collection",
        "$focus_override_up_binding_type|default": "collection",
        "$focus_override_left_binding_type|default": "collection",
        "$focus_override_right_binding_type|default": "collection",
    
        "focus_identifier": "$focus_id",
        "focus_change_down": "$focus_override_down",
        "focus_change_up": "$focus_override_up",
        "focus_change_left": "$focus_override_left",
        "focus_change_right": "$focus_override_right",
        "focus_enabled": true,
        "focus_wrap_enabled": false,
        "focus_magnet_enabled": true,
        "$highlight_control|default": "common.hover_button_gui",
    
        "default_focus_precedence": 1,
        "hover_control": "hover",
        "default_control": "default",
        "$icon_name": "textures/project_emc/gui/previous_button",
        "$button_text": "None",
        "pressed_control": "pressed",
        "layer": 1,
        "bindings": [
          {
            "binding_type": "collection_details",
            "binding_collection_name": "$item_collection_name",
            "binding_condition": "once"
          },
          {
            "binding_type": "$focus_id_binding_type",
            "binding_name": "#focus_identifier",
            "binding_name_override": "#focus_identifier",
            "binding_collection_name": "$item_collection_name",
            "binding_condition": "once"
          },
          {
            "binding_type": "$focus_override_down_binding_type",
            "binding_name": "#focus_change_down",
            "binding_name_override": "#focus_change_down",
            "binding_collection_name": "$item_collection_name",
            "binding_condition": "once"
          },
          {
            "binding_type": "$focus_override_up_binding_type",
            "binding_name": "#focus_change_up",
            "binding_name_override": "#focus_change_up",
            "binding_collection_name": "$item_collection_name",
            "binding_condition": "once"
          },
          {
            "binding_type": "$focus_override_left_binding_type",
            "binding_name": "#focus_change_left",
            "binding_name_override": "#focus_change_left",
            "binding_collection_name": "$item_collection_name",
            "binding_condition": "once"
          },
          {
            "binding_type": "$focus_override_right_binding_type",
            "binding_name": "#focus_change_right",
            "binding_name_override": "#focus_change_right",
            "binding_collection_name": "$item_collection_name",
            "binding_condition": "once"
          }
        ],
        "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": "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.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": "double_pressed"
          },
          {
            "from_button_id": "button.menu_ok",
            "to_button_id": "button.coalesce_stack",
            "mapping_type": "double_pressed"
          },
          {
            "to_button_id": "button.shape_drawing",
            "mapping_type": "pressed"
          },
          {
            "to_button_id": "button.container_slot_hovered",
            "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')"
            }
          },
          {
            "bundle_popup_factory_control": {
              "type": "panel",
              "factory": {
                "name": "bundle_popup_factory",
                "control_name": "common.bundle_mode_popup_control",
                "max_children_size": 1
              }
            }
          }
        ]
    }
}