/*File made by @CrisXolt.
//(c) Don't use any code design without permission!*/
{
  "namespace": "common_dx",

  /*//// Text Edit Box ////*/

  "text_edit_box@common.text_edit_box": {
    "$text_edit_box_label_anchor_point": "top_left",
    "$text_edit_box_label_anchor_point|default": "top_left",
    "$text_background_locked|default": "$text_background_default",
    "$text_background_locked": "$text_background_default",
    "controls": [
      { "custom_panel@common_dx.custom_text_edit_panel": { } }
    ]
  },

  "multiline_text_edit_box@common.multiline_text_edit_box": {
    "$text_edit_box_label_anchor_point": "top_left",
    "$text_edit_box_label_anchor_point|default": "top_left",
    "$text_background_locked|default": "$text_background_default",
    "$text_background_locked": "$text_background_default",
    "controls": [
      { "custom_panel@common_dx.custom_text_edit_panel": { } }
    ]
  },

  "custom_text_edit_panel": {
    "type": "panel",
    "$text_background_locked|default": "$text_background_default",
    "$hover_content|default": "common.empty_panel",
    "controls": [
      {
        "clipper_panel": {
          "type": "panel",
          "size": "$text_edit_clipping_panel_size",
          "offset": "$text_offset",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "clips_children": true,
          "$disabled_color": "$color",
          "controls": [
            { "$text_edit_text_control@common_dx.text_edit_box_label": { "layer": 4,"shadow": false } },
            { "visibility_panel@common_dx.visibility_panel": { } }
          ]
        }
      },
      {
        "locked": {
          "type": "panel",
          "$disabled_color|default": "$color",
          "controls": [
            {
              "edit_box_indent@$text_background_locked": {
                "$color": "$disabled_color",
                "$alpha": "$disabled_alpha"
              }
            }
          ]
        }
      },
      { "default@$text_background_default": { "layer": 2 } },
      { 
        "hover@$text_background_hover": {
          "layer": 3,
          "controls": [
            { "hover_content@$hover_content": { } }
          ]
        }
      },
      { "pressed@$text_background_hover": { "layer": 3 } }
    ]
  },

  "text_edit_box_label@common.text_edit_box_label": {
    "layer": 4,
    "font_type": "normal",
    "font_scale_factor": 1.0,
    "line_padding": -1.0,
    "size": "$text_edit_box_label_size",
    "offset": "$text_edit_box_label_offset",
    "min_size": "$text_edit_box_label_min_size",
    "anchor_from": "$text_edit_box_label_anchor_point",
    "anchor_to": "$text_edit_box_label_anchor_point",
    "font_size": "$font_size",
    "$text_alpha|default": "$alpha",
    "$locked_text_alpha|default": "$disabled_alpha",
    "$locked_color|default": "$disabled_color",
    "shadow": false
  },

  "visibility_panel": {
    "type": "panel",
    "controls": [
      {
        "place_holder_control@$place_holder_control": {
          "layer": 4,
          "shadow": true,
          "size": "$text_edit_box_label_size",
          "offset": "$text_edit_box_label_offset",
          "min_size": "$text_edit_box_label_min_size",
          "anchor_from": "$text_edit_box_label_anchor_point",
          "anchor_to": "$text_edit_box_label_anchor_point",
          "$text_alpha|default": "$alpha",
          "$locked_text_alpha|default": "$disabled_alpha",
          "$locked_color|default": "$disabled_color"
        }
      }
    ],
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$text_edit_text_control",
        "source_property_name": "(#item_name = '')",
        "target_property_name": "#visible",
        "resolve_sibling_scope": true
      }
    ]
  },
  
  /* Custom Grid Template */

  "grid_panel": {
    "type": "panel",
    "$grid_template_size|default": [ "100%", 0 ],
    "$grid_item_template|default": "",
    "$grid_position|default": [ 0, 0 ],
    "$grid_dimensions|default": [ 1, 1 ],
    "$grid_dimension_binding|default": "",
    "$collection_name|default": "",
    "$not_dimension_binding|default": true,
    "$grid_bindings|default": [
      {
        "ignored": "$not_dimension_binding",
        "binding_name": "$grid_dimension_binding"
      }
    ],
    "controls": [
      {
        "grid": {
          "type": "grid",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "size": "$grid_template_size",
          "grid_dimensions": "$grid_dimensions",
          "collection_name": "$collection_name",
          "grid_dimension_binding": "$grid_dimension_binding",
          "controls": [
            {
              "top_left_offset": {
                "type": "panel",
                "grid_position": "$grid_position",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "controls": [
                  {
                    "grid_item@$grid_item_template": {
                      "anchor_from": "top_left",
                      "anchor_to": "top_left"
                    }
                  }
                ]
              }
            }
          ],
          "bindings": "$grid_bindings"
        }
      }
    ]
  },

  /* Inventory Panel */

  "root_panel@common.root_panel": {
    "$durability_bar_control": "common_dx.durability_bar_common"
  },

  "durability_bar_common": {
    "type": "panel",
    "size": [ 16, 16 ],
    "controls": [
      {
        "durability_bar_hold": {
          "type": "panel",
          "size": [ 16, 16 ],
          "ignored": "$custom_durability_bar",
          "controls": [
            { 
              "durability_bar@common.durability_bar": {
                "layer": 0,
                "size": [ 13, 1 ],
                "anchor_from": "bottom_left",
                "anchor_to": "bottom_left",
                "offset": [ 2, -2 ]
              }
            }
          ]
        }
      },
      {
        "custom_durability_bar_hold": {
          "type": "panel",
          "size": [ 16, 16 ],
          "ignored": "(not $custom_durability_bar)",
          "controls": [
            { "durability_bar@common_durability_dx.durability_bar": { } }
          ]
        }
      }
    ]
  },

  /*//// Inventory Panel Bottom Half ////*/

  "inventory_panel_bottom_half": {
    "type": "panel",
    "size": [ 162, 88 ],
    "anchor_from": "bottom_left",
    "anchor_to": "bottom_left",
    "offset": [ 7, -7 ],
    "$with_label|default": true,
    "$background_images": "java_gui_common.cell_image",
    "$highlight_control": "common_dx.highlight_slot_panel",
    "controls": [
      {
        "inventory_label@common.section_heading_label": {
          "color": "$vdx_inventory_title_text_color",
          "ignored": "(not $with_label)",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "offset": [ 1, 0 ],
          "layer": 2,
          "text": "container.inventory"
        }
      },
      {
        "inventory_grid": {
          "type": "grid",
          "size": [ 162, 54 ],
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "offset": [ 0, -22 ],
          "grid_dimensions": [ 9, 3 ],
          "grid_item_template": "common.grid_item_for_inventory",
          "collection_name": "inventory_items"
        }
      },
      {
        "hotbar_grid@common.hotbar_grid_template": {
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "offset": [ 0, 0 ],
          "layer": 2
        }
      }
    ]
  },

  /*//// Selected Icon ////*/

  "inventory_selected_icon_button@common.inventory_selected_icon_button": {
    "controls": [
      { "default@common_dx.inventory_icon_panel": {} },
      { "pressed@common_dx.inventory_icon_panel": {} },
      { "hover@common_dx.inventory_icon_panel": {} }
    ]
  },

  "inventory_icon_panel": {
    "type": "panel",
    "controls": [
      { 
        "selected_item_icon@common.inventory_selected_icon": {
          "size": [ 16, 16 ],
          "offset": [ 0, 0 ],
          "controls": [
            { "selected_item_lock_overlay@common.inventory_selected_item_lock_overlay": { "size": [ 24, 24 ] } },
            {
              "durability_bar_hold": {
                "type": "panel",
                "size": [ 16, 16 ],
                "ignored": "$custom_durability_bar",
                "controls": [
                  { 
                    "durability_bar_grabbed@common.durability_bar_grabbed": {
                      "size": [ 13, 1 ],
                      "anchor_from": "bottom_left",
                      "anchor_to": "bottom_left",
                      "offset": [ 2, -2 ],
                      "layer": 61
                    }
                  }
                ]
              }
            },
            {
              "custom_durability_bar_hold": {
                "type": "panel",
                "size": [ 16, 16 ],
                "ignored": "(not $custom_durability_bar)",
                "controls": [
                  { 
                    "durability_bar_grabbed@common_durability_dx.durability_bar": {
                      "layer": 61,
                      "$item_renderer_size": [ 16, 16 ],
                      "$is_grabbed": true,
                      "$total_amount": "#selected_item_durability_total_amount",
                      "$current_amount": "#selected_item_durability_current_amount",
                      "bindings": [
                        {
                          "binding_name": "$total_amount"
                        },
                        {
                          "binding_type": "view",
                          "source_property_name": "(not ($total_amount = 0))",
                          "target_property_name": "#visible"
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      { 
        "selected_stack_size_text@common.inventory_selected_stack_size_text": {
          "color": "$item_stack_count_color",
          "offset": [ 1, 2 ]
        }
      },
      {
        "hover_text@common.hover_text": {
          "layer": 59,
          "bindings": [
            {
              "binding_name": "#using_touch",
              "binding_name_override": "#visible"
            }
          ]
        }
      }
    ]
  },

  /*//// Highlight Control ////*/

  "item_hover_text_label@common_dx.hover_text_label": {
    //"line_padding": 2.0,
    "$hover_text_binding_name|default": "#hover_text",
    "text": "$hover_text_binding_name",
    "bindings": [
      {
        "binding_name": "$hover_text_binding_name",
        "binding_type": "collection",
        "binding_collection_name": "$item_collection_name"
      }
    ]
  },

  "highlight_slot_panel": {
    "type": "panel",
    "offset": "$item_renderer_offset",
    "$highlight_slot_image|default": "java_gui_common.highlight_slot",
    "$hover_text_alpha": 0.9375,
    "controls": [
      { "highlight_slot_image@$highlight_slot_image": { } },
      {
        "hover_text_panels": {
          "type": "panel",
          "controls": [
            {
              "custom_hover_text@common_dx.hover_text_panel": {
                "ignored": "(not $hover_text_shadow)",
                "$hover_text_label_control": "common_dx.item_hover_text_label",
                "variables": [
                  {
                    "requires": "($touch)",
                    "$hover_offset": [ 2, -18 ]
                  },
                  {
                    "requires": "(not $touch)",
                    "$hover_offset": [ 0, 0 ]
                  }
                ],
                "bindings": [
                  {
                    "binding_name": "(not (#hover_text = ''))",
                    "binding_name_override": "#visible",
                    "binding_type": "collection",
                    "binding_collection_name": "$item_collection_name"
                  }
                ]
              }
            },
            {
              "hover_text@common.hover_text": {
                "ignored": "$hover_text_shadow",
                "layer": 29,
                "$hover_text_binding_name|default": "#hover_text",
                "bindings": [
                  {
                    "binding_name": "$hover_text_binding_name",
                    "binding_name_override": "#hover_text",
                    "binding_type": "collection",
                    "binding_collection_name": "$item_collection_name"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  /*//// Hover Text ////*/

  "hover_text_label": {
    "type": "label",
    "offset": [ 4, 3 ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "layer": 155,
    "color": "$hover_panel_text_color",
    "$hover_panel_text_color|default": [ 1.0, 1.0, 1.0 ],
    "text": "$hover_panel_text",
    "shadow": "$hover_text_shadow",
    "follows_cursor": true,
    "size": "$hover_text_size",
    "$hover_text_size|default": [ "default", "default" ],
    "$hover_panel_text|default": "",
    "bindings": [
      {
        "binding_name": "$hover_panel_text"
      }
    ]
  },

  "hover_text_image": {
    "type": "image",
    "size": [ "100%c+8px", "100%c+6px" ],
    "color": [ 1.0, 1.0, 1.0, 1.0 ],
    "$hover_text_texture|default": "textures/uidx/hover_text/text_panel_purple",
    "$hover_text_alpha|default": 0.9375,
    "alpha": "$hover_text_alpha",
    "texture": "$hover_text_texture",
    "layer": 150,
    "anchor_from": "$hover_anchor_from",
    "anchor_to": "$hover_anchor_to",
    "$hover_anchor_from|default": "top_left",
    "$hover_anchor_to|default": "top_left",
    "offset": "$hover_text_offset",
    "$hover_text_offset|default": [ 14.5, -6.5 ],
    "$hover_text_label_control|default": "common_dx.hover_text_label",
    "$hover_text_texture_bindings|default": [],
    "bindings": "$hover_text_texture_bindings",
    "controls": [
      { "text@$hover_text_label_control": { } }
    ]
  },

  "hover_text_button": {
    "type": "button",
    "anchor_from": "center",
    "anchor_to": "center",
    "locked_control": "",
    "layer": -10,
    "size": [ 1, 1 ],
    "offset": [ 10000, 10000 ],
    "follows_cursor": true,
    "consume_hover_events": false,
    "always_handle_pointer": true,
    "focus_enabled": false,
    "focus_magnet_enabled": false,
    "controls": [
      { "hover@common_dx.hover_text_image": {} }
    ]
  },

  "hover_text_panel": {
    "type": "panel",
    "allow_clipping": false,
    "controls": [
      { "hover_text_button@common_dx.hover_text_button": { "ignored": "($touch)" } },
      { "hover_text_image@common_dx.hover_text_image": { "ignored": "(not $touch)" } }
    ]
  },

  /*//// Inventory Cell Images Bindings ////*/

  "container_cell_images": {
    "type": "panel",
    "$cell_images_binding_condition": "visible",
    "$cell_binding_name": "#container_item_background",
    "bindings": [
      {
        "binding_name": "$cell_binding_name",
        "binding_type": "collection",
        "binding_collection_name": "$item_collection_name",
        "binding_condition": "$cell_images_binding_condition"
      }
    ]
  },

  "cell_image_recipe_panel": {
    "type": "panel",
    "$texture_image|default": "common.empty_panel",
    "controls": [
      { "texture@$texture_image": { } }
    ]
  },

  "cell_image_0@common_dx.cell_image_recipe_panel": {
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$background_image_control_name",
        "resolve_sibling_scope": true,
        "source_property_name": "($cell_binding_name = 0)",
        "target_property_name": "#visible"
      }
    ]
  },

  "cell_image_1@common_dx.cell_image_recipe_panel": {
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$background_image_control_name",
        "resolve_sibling_scope": true,
        "source_property_name": "($cell_binding_name = 1)",
        "target_property_name": "#visible"
      }
    ]
  },

  "cell_image_2@common_dx.cell_image_recipe_panel": {
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$background_image_control_name",
        "resolve_sibling_scope": true,
        "source_property_name": "($cell_binding_name = 2)",
        "target_property_name": "#visible"
      }
    ]
  },

  "cell_image_3@common_dx.cell_image_recipe_panel": {
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$background_image_control_name",
        "resolve_sibling_scope": true,
        "source_property_name": "($cell_binding_name = 3)",
        "target_property_name": "#visible"
      }
    ]
  },

  "cell_image_4@common_dx.cell_image_recipe_panel": {
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$background_image_control_name",
        "resolve_sibling_scope": true,
        "source_property_name": "($cell_binding_name = 4)",
        "target_property_name": "#visible"
      }
    ]
  },

  "cell_image_5@common_dx.cell_image_recipe_panel": {
    "bindings": [
      {
        "binding_type": "view",
        "source_control_name": "$background_image_control_name",
        "resolve_sibling_scope": true,
        "source_property_name": "($cell_binding_name = 5)",
        "target_property_name": "#visible"
      }
    ]
  }
}