/********************************************************
+*   (c) Mojang. All rights reserved                       *
+*   (c) Microsoft. All rights reserved.                   *
+*********************************************************/

{
  "namespace": "settings",

  "settings_screen_base@settings_common.screen_base": {
    "$selector_stack_panel": "settings.selector_stack_panel",
    "$section_content_panels": "settings.section_content_panels",
    "$section_header_panels": "settings.section_header_panels",
    "$section_footer_panels": "settings.section_footer_panels",

    "$is_world_create": false,
    "$is_template_create": false,
    "$is_world_edit": false,
    "$include_world_section": false,
    "$include_realm_section": false,
    "$include_controls_and_settings_sections": false
  },

  "screen_world_create@settings_screen_base": {
    "$is_world_create": true,
    "$is_template_create": false,
    "$is_world_edit": false,
    "$include_world_section": true
  },

  "screen_template_create@settings_screen_base": {
    "$is_world_create": false,
    "$is_template_create": true,
    "$is_world_edit": false,
    "$include_world_section": true
  },

  "screen_world_edit@settings_screen_base": {
    "$is_world_create": false,
    "$is_template_create": false,
    "$is_world_edit": true,
    "$include_world_section": true
  },

  "screen_controls_and_settings@settings_screen_base": {
    "$include_controls_and_settings_sections": true
  },

  "screen_world_controls_and_settings@settings_screen_base": {
    "$include_world_section": true,
    "$include_controls_and_settings_sections": true
  },

  "screen_realm_controls_and_settings@settings_screen_base": {
    "$include_realm_section": true,
    "$include_controls_and_settings_sections": true
  },

  "screen_realm_settings@settings_screen_base": {    
    "$include_realm_section": true
  },

  "selector_stack_panel": {
    "type": "stack_panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "orientation": "vertical",
    "$default_selector_toggle_index": 0,
    "controls": [

      // the list of selection toggle buttons, add yours here...
      {
        "world_selector_pane@world_section.selector_pane_content": {
          "ignored": "(not $include_world_section)"
        }
      },
      {
        "realm_selector_pane@realms_settings.selector_panel": {
          "ignored": "(not $include_realm_section)",
          "$world_toggle_index": "$world_forced_index",
          "$members_toggle_index": "$members_forced_index",
          "$subscription_toggle_index": "$subscription_forced_index",
          "$backup_toggle_index": "$backup_forced_index",
          "$dev_options_toggle_index": "$dev_options_forced_index"
        }
      },
      {
        "controls_and_settings_selector_pane": {
          "type": "stack_panel",
          "ignored": "(not $include_controls_and_settings_sections)",
          "controls": [

            // Controls Section //

            {
              "spacer_0": {
                "ignored": "(not $include_world_section)",
                "type": "panel",
                "size": [ 2, 2 ]
              }
            },
            {
              "selector_group_label_0@settings_common.selector_group_label": {
                "text": "options.group.input"
              }
            },
            {
              "keyboard_and_mouse_button@controls_section.keyboard_and_mouse_button": {
                "ignored": "(not $keyboard_and_mouse_supported)",
                "$toggle_group_forced_index": "$keyboard_and_mouse_forced_index"
              }
            },
            {
              "controller_button@controls_section.controller_button": {
                "ignored": "(not $gamepad_supported or $nx_os)",
                "$toggle_group_forced_index": "$controller_and_switch_forced_index"
              }
            },
            {
              "switch_controller_button@controls_section.controller_button": {
                "ignored": "(not $gamepad_supported or not $nx_os)",
                "$toggle_group_forced_index": "$controller_and_switch_forced_index",
                "$glyph_texture": "textures/ui/controller_glyph_switch",
                "$glyph_color_texture": "textures/ui/controller_glyph_color_switch"
              }
            },
            {
              "touch_button@controls_section.touch_button": {
                "ignored": true,
                "$toggle_group_forced_index": "$touch_forced_index"
              }
            },

            // General Section //

            {
              "spacer_1": {
                "type": "panel",
                "size": [ 2, 2 ]
              }
            },
            {
              "selector_group_label_1@settings_common.selector_group_label": {
                "text": "stat.generalButton"
              }
            },
            {
              "profile_button@general_section.profile_button": {
                "$toggle_group_forced_index": "$profile_forced_index"
              }
            },
            {
              "video_button@general_section.video_button": {
                "$toggle_group_forced_index": "$video_forced_index"
              }
            },
            {
              "vr_button@general_section.vr_button": {
                "ignored": "(not $is_holographic)",
                "$toggle_group_forced_index": "$vr_forced_index"
              }
            },
            {
              "sound_button@general_section.sound_button": {
                "$toggle_group_forced_index": "$sound_forced_index"
              }
            },
            {
              "global_texture_pack_button@general_section.global_texture_pack_button": {
				"ignored": true,  
                "$toggle_group_forced_index": "$global_texture_pack_forced_index"
              }
            },
            {
              "storage_management_button@general_section.storage_management_button": {
                "$toggle_group_forced_index": "$storage_management_forced_index"
              }
            },
            {
              "language_button@general_section.language_button": {
				"ignored": true,  
                "$toggle_group_forced_index": "$language_forced_index"
              }
            },
            {
              "debug_button@general_section.debug_button": {
                "ignored": "$is_publish",
                "$toggle_group_forced_index": "$debug_forced_index"
              }
            },
            {
              "automation_button@general_section.automation_button": {
                "ignored": "($is_publish or $test_infrastructure_disabled)",
                "$toggle_group_forced_index": "$automation_forced_index"
              }
            },
            {
              "broadcast_button@general_section.broadcast_button": {
                "ignored": "(not $can_support_broadcast or $education_edition)",
                "$toggle_group_forced_index": "$broadcast_forced_index"
              }
            },
            {
              "how_to_play_button@general_section.how_to_play_button": {
                "ignored": true,
                "$toggle_group_forced_index": "$how_to_play_index"
              }
            }
          ]
        }
      },
      {
        "addons_selector_panel@world_section.addons_selector_panel": {
          "ignored": "(not $include_world_section)",
          "$level_texture_pack_toggle_index": "$level_texture_pack_index",
          "$addon_toggle_index": "$addon_index"
        }
      }
    ]
  },

  "section_content_panels": {
    "type": "panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100% - 4px", "100%c + 4px" ],
    "offset": [ 2, 0 ],
    "controls": [
      // the list of section panels, add yours here...
      {
        "world_sections": {
          "type": "stack_panel",
          "ignored": "(not $include_world_section)",
          "controls": [
            { "game_section@world_section.game_section": { } },
            { "server_section@world_section.server_section": { } },
            {
              "level_texture_pack_section@world_section.level_texture_pack_section": {
              }
            },
            {
              "addon_section@world_section.addon_section": {
              }
            },
            { "multiplayer_section@world_section.multiplayer_section": { } }
          ]
        }
      },
      {
        "section_content_panels@realms_settings.section_content_panels": {
          "ignored": "(not $include_realm_section)"
        }
      },
      {
        "general_and_controls_sections": {
          "type": "stack_panel",
          "ignored": "(not $include_controls_and_settings_sections)",
          "controls": [
            { "keyboard_and_mouse_section@controls_section.keyboard_and_mouse_section": { "ignored": "(not $keyboard_and_mouse_supported)", "visible": false } },
            { "controller_section@controls_section.controller_section": { "ignored": "(not $gamepad_supported)", "visible": false  } },
            { "touch_section@controls_section.touch_section": { "ignored": true, "visible": false } },

            { "profile_section@general_section.profile_section": { "visible": false} },
            {
              "global_texture_pack_section@general_section.global_texture_pack_section": {
				"ignored": true,  
                "visible": false
              }
            },
            { "storage_management_section@general_section.storage_management_section": { "visible": false } },
            { "video_section@general_section.video_section": { "visible": false} },
            { "vr_section@general_section.vr_section": { "ignored": "(not $is_holographic)", "visible": false } },
            { "sound_section@general_section.sound_section": { "visible": false } },
            { "language_section@general_section.language_section": { "ignored": true, "visible": false } },
            { "debug_section@general_section.debug_section": { "ignored": "$is_publish", "visible": false } },
            { "automation_section@general_section.automation_section": { "ignored": "($is_publish or $test_infrastructure_disabled)", "visible": false } },
            { "broadcast_section@general_section.broadcast_section": { "ignored": "(not $can_support_broadcast or $education_edition)", "visible": false } },
            { "how_to_play_section@general_section.how_to_play_section": { "ignored": true, "visible": false } }
          ]
        }
      }
    ]
  },

  "section_header_panels": {
    "type": "panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", "100%c" ],
    "offset": [ 2, 0 ],
    "controls": [
      // the list of header panels, add yours here...
      {
        "world_sections": {
          "type": "stack_panel",
          "ignored": "(not $include_world_section)",
          "controls": [
          ]
        }
      },
      {
        "general_and_controls_sections": {
          "type": "stack_panel",
          "size": ["100%", "100%c"],
          "ignored": "(not $include_controls_and_settings_sections)",
          "controls": [
            { "storage_management_header@general_section.storage_management_header": { } }
          ]
        }
      }
    ]
  },

  "section_footer_panels": {
    "type": "panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", "100%c" ],
    "offset": [ 2, 0 ],
    "controls": [
      // the list of header panels, add yours here...
      {
        "world_sections": {
          "type": "stack_panel",
          "ignored": "(not $include_world_section)",
          "controls": [
          ]
        }
      },
      {
        "general_and_controls_sections": {
          "type": "stack_panel",
          "size": ["100%", "100%c"],
          "ignored": "(not $include_controls_and_settings_sections)",
          "controls": [
            { "storage_management_footer@general_section.storage_management_footer": { } }
          ]
        }
      }
    ]
  }

}