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

{
  "namespace": "xbl_optional_signin",

  "Xbox_icon": {
    "type": "image",
    "texture": "textures/ui/xbox4",
    "layer": 3,
    "size": [ 20, 20 ]
  },

  "xbl_signin_label": {
    "type": "panel",
    "layer": 2,
    "controls": [
      {
        "Xbox_icon@xbl_optional_signin.Xbox_icon": {
          "ignored": true,
          "anchor_from": "left_middle",
          "anchor_to": "left_middle",
          "offset": [ 24, 0 ]
        }
      },
      {
        "button_label": {
          "type": "label",
          "color": "$text_color",
          "text": "xbox.signInLong"
        }
      }
    ]
  },

  "xbl_signin_button@common_buttons.light_content_button": {
    "$pressed_button_name": "button.xbl_signin",
    "$button_content": "xbl_optional_signin.xbl_signin_label"
  },


  "dialog_image": {
    "type": "image",
    "layer": 2,
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "texture": "#texture",
    "size": [ "137.667%y", "100% - 2px" ],
    "offset": [ 1, 1 ],
    "bindings": [
      {
        "binding_name": "#texture"
      }
    ]
  },

  "dialog_image_with_border": {
    "type": "image",
    "layer": 1,
    "texture": "textures/ui/Grey",
    "size": [ "100%c + 2px", "100%" ],
    "controls": [
      {
        "dialog_image@xbl_optional_signin.dialog_image": { }
      }
    ]
  },

  "title_image_panel": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "dialog_image_with_border@xbl_optional_signin.dialog_image_with_border": { }
      },
      {
        "message_content": {
          "type": "panel",
          "size": [ "fill", "100%" ],
          "controls": [
            {
              "message_label": {
                "type": "label",
                "size": [ "100% - 16px", "default" ],
                "text": "#message",
                "layer": 2,
                "color": "$body_text_color",
                "bindings": [
                  {
                    "binding_name": "#message"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "main_panel": {
    "type": "input_panel",
    "size": "$xbl_optional_signin_screen_size",
    "controls": [
      { "common_panel@common.common_panel": { "$dialog_background": "dialog_background_hollow_3" } },
      {
        "title_label": {
          "type": "label",
          "text": "#title",
          "anchor_from": "top_middle",
          "anchor_to": "top_middle",
          "offset": [ 0, 7 ],
          "layer": 2,
          "color": "$title_text_color",
          "bindings": [
            {
              "binding_name": "#title"
            }
          ]
        }
      },
      {
        "myimage@xbl_optional_signin.title_image_panel": {
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "size": [ "100%-18px", "100%-67px" ],
          "offset": [ 10, 25 ]
        }
      },
      {
        "a@xbl_optional_signin.xbl_signin_button": {
          "size": [ "100%-20px", 30 ],
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "offset": [ 10, -10 ]
        }
      }
    ]
  },

  "gamepad_helpers": {
    "type": "panel",
    "layer": 2,
    "controls": [
      {
        "gamepad_helper_a@common.gamepad_helper_a": {
          "anchor_from": "bottom_right",
          "anchor_to": "bottom_right"
        }
      }
    ]
  },

  // -----------------------------------------------
  //
  //    screen
  //
  // -----------------------------------------------
  "xbl_optional_signin_screen@common.base_screen": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      }
    ],
    "$screen_content": "xbl_optional_signin.xbl_optional_signin_screen_content"
  },

  "xbl_optional_signin_screen_content": {
    "type": "panel",
    "controls": [
      {
        "root_panel": {
          "type": "panel",
          "controls": [
            { "gamepad_helpers@xbl_optional_signin.gamepad_helpers": { } },
            { "main_panel@xbl_optional_signin.main_panel": { "layer": 1 } }
          ]
        }
      }
    ]
  }
}