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

  /*//// Resources ////*/

  "panel_toggle@common_toggles_dx.toggle_panel": {
    "size": [ "100%", "100%" ],
    "ignored": "$middle_clips_children",
    "$sound_name": "null",
    "$toggle_focus_enabled": false,
    "$tab_view_binding_name": "($item_mode + _000 + _toggle)",
    "$toggle_group_forced_index": 0,
    "layer": -5
  },

  /*//// Main scroll panel ////*/

  "java_edition_menu_panel_template": {
    "type": "panel",
    "size": [ "100%", "100%" ],

    /* Content panels */
    "$top_content|default": "common.empty_panel",
    "$middle_content|default": "common_menus_dx.middle_panel",
    "$bottom_content|default": "common.empty_panel",
    /* Panels sizes */
    "$top_content_size|default": [ "100%", 32 ],
    "$bottom_content_size|default": [ "100%", 32 ],
    /* Background */
    "$bg|default": "java_gui_common.options_background",
    "$bg_middle|default": "java_gui_common.options_background_middle",
    /* Misc */
    "$middle_clips_children|default": true,

    "controls": [
      { "java_menu_stack_panel@common_menus_dx.java_menu_stack_panel": { "layer": 3 } },
      { "bg@$bg": { "layer": -20, "ignored": "(not $middle_clips_children)" } }
    ]
  },

  "java_menu_stack_panel": {
    "type": "stack_panel",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "top@$bg": {
          "size": "$top_content_size",
          "layer": 40,
          "controls": [
            { "horizontal_stack_panel@common_screens_dx.horizontal_safezone_screen": { "$panel_content": "$top_content", "layer": 45 } },
            { "panel_toggle@common_menus_dx.panel_toggle": {} }
          ]
        }
      },
      {
        "middle_panel": {
          "type": "panel",
          "size": [ "100%", "fill" ],
          "layer": 1,
          "controls": [
            { "panel_content@$middle_content": { } }
          ]
        }
      },
      {
        "bottom@$bg": {
          "size": "$bottom_content_size",
          "layer": 40,
          "controls": [
            { "horizontal_stack_panel@common_screens_dx.horizontal_safezone_screen": { "$panel_content": "$bottom_content", "layer": 45 } },
            { "panel_toggle@common_menus_dx.panel_toggle": {} }
          ]
        }
      }
    ]
  },
  
  "middle_panel": {
    "type": "panel",
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "clips_children": "$middle_clips_children",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "bg_overlay_border": {
          "type": "image",
          "layer": 40,
          "texture": "textures/uidx/menus/java_middle_bg_border",
          "size": [ "100%", "100%" ]
        }
      },
      { "panel_content@common_menus_dx.java_menu_scroll_panel": { "layer": 5 } },
      { "bg@$bg_middle": { "layer": 1 } }
    ]
  },

  /*//// Scroll template for menus! ////*/

  "java_scroll_box": {
    "type": "image",
    "size": [ "100%", "100%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "layer": 10,
    "texture": "textures/uidx/menus/java_scroll_box"
  },

  "java_scroll_track": {
    "type": "image",
    "size": [ "100%", "100%" ],
    "texture": "textures/uidx/menus/java_scroll_track"
  },

  "java_menu_scroll_panel@common.scrolling_panel": {
    "size": [ "100%", "100%" ],
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "layer": 3,
    "$scrolling_pane_size": [ "100%", "100%" ],
    "$scrolling_content": "$scrolling_content",
    "$scroll_view_port_size|default": [ 328, "100%" ],
    "$scroll_size": [ 6, "100%" ],
    "$scroll_offset": [ 8, 0 ],
    "$scroll_bar_contained|default": true,
    "$scroll_background_image_control": "",
    "$scroll_track_image_control": "common_menus_dx.java_scroll_track",
    "$scroll_box_mouse_image_control": "common_menus_dx.java_scroll_box",
    "controls": [
      {
        "scroll_mouse@common_menus_dx.java_menu_scrolling_panel_base": {
          "offset": "$scrolling_pane_offset",
          "size": "$scrolling_pane_size"
        }
      }
    ]
  },

  "java_menu_scrolling_panel_base@common.scrolling_panel_base": {
    "controls": [
      {
        "$scroll_view_name@common.scroll_view_control": {
          "controls": [
            {
              "panel": {
                "type": "panel",
                "ignored": "(not $scroll_bar_contained)",
                "anchor_to": "top_left",
                "anchor_from": "top_left",
                "$view_port_size|default": [ "100%", "100%" ],
                "controls": [
                  { "background_and_viewport@common_menus_dx.viewport": {} },
                  { "bar_and_track@common_menus_dx.scroll_bar_and_track": {} }
                ]
              }
            },
            {
              "stack_panel": {
                "type": "stack_panel",
                "orientation": "horizontal",
                "ignored": "$scroll_bar_contained",
                "anchor_to": "top_left",
                "anchor_from": "top_left",
                "size": [ "100%", "100%" ],
                "controls": [
                  {
                    "scrolling_view_port": {
                      "layer": 1,
                      "type": "panel",
                      "size": [ "fill", "100%" ],
                      "controls": [
                        {
                          "scrolling_content@$bg_middle": {
                            "size": [ "100%", "100%c" ],
                            "layer": 1,
                            "$scrolling_content_anchor_from|default": "top_left",
                            "$scrolling_content_anchor_to|default": "top_left",
                            "anchor_from": "$scrolling_content_anchor_from",
                            "anchor_to": "$scrolling_content_anchor_to",
                            "controls": [
                              {
                                "content@$scrolling_content": {
                                  "anchor_from": "top_middle",
                                  "anchor_to": "top_middle"
                                }
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  {
                    "bar_and_track@common_menus_dx.scroll_bar_and_track": {
                      "size": "$scroll_size"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "viewport@common.scroll_background_and_viewport": {
    "clips_children": false,
    "controls": [
      {
        "scrolling_view_port": {
          "layer": 1,
          "type": "panel",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "offset": "$scroll_view_port_offset",
          "size": [ "100%", "100%" ],
          "controls": [
            {
              "scrolling_content@$bg_middle": {
                "size": [ "100%", "100%c" ],
                "layer": 1,
                "$scrolling_content_anchor_from|default": "top_left",
                "$scrolling_content_anchor_to|default": "top_left",
                "anchor_from": "$scrolling_content_anchor_from",
                "anchor_to": "$scrolling_content_anchor_to",
                "controls": [
                  {
                    "content@$scrolling_content": {
                      "anchor_from": "top_middle",
                      "anchor_to": "top_middle"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },
  
  "scroll_bar_and_track@common.scroll_bar_and_track": {
    "size": "$scroll_view_port_size",
    "anchor_from": "center",
    "anchor_to": "center",
    "controls": [
      {
        "centered_panel": {
          "type": "panel",
          "size": "$scroll_size",
          "anchor_from": "right_middle",
          "anchor_to": "right_middle",
          "controls": [
            {
              "track@common.scrollbar_track": {
                "layer": 20,
                "anchor_from": "center",
                "anchor_to": "center"
              }
            },
            {
              "scroll_box@common.scroll_box": {
                "layer": 25,
                "anchor_from": "center",
                "anchor_to": "center"
              }
            }
          ]
        }
      }
    ]
  }
}