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

{
  "namespace": "convert_purchases_to_xbl",

  "padding": {
    "type": "panel",
    "size": [ "100%", 2 ]
  },

  "image_panel": {
    "type": "panel",
    "size": [ "100%", "100%c + 2px" ],
    "controls": [
      {
        "image": {
          "type": "image",
          "texture": "textures/ui/xboxconversionkeyart",
          "size": [ "100% - 2px", "42.86%x" ],
          "controls": [
            {
              "border@common.square_image_border_white": {
                "size": [ "100% + 2px", "100% + 2px" ],
                "layer": 2,
                "color": [ 0, 0, 0 ]
              }
            }
          ]
        }
      }
    ]
  },

  "dialog_content": {
    "type": "stack_panel",
    "size": [ "100% - 4px", "100% - 4px" ],
    "controls": [
      {
        "image_panel@convert_purchases_to_xbl.image_panel": {}
      },
      {
        "padding_0@convert_purchases_to_xbl.padding": {}
      },
      {
        "scrolling_panel@common.scrolling_panel": {
          "$show_background": false,
          "$scroll_box_visible_touch": true,
          "size": [ "100%", "fill" ],
          "$scrolling_content": "convert_purchases_to_xbl.scroll_content_focus_border",
          "$scroll_size": [ 5, "100%" ],
          "$scrolling_pane_size": [ "100%", "100%" ],
          "$scrolling_pane_offset": [ 0, 0 ],
          "$scroll_bar_right_padding_size": [ 0, 0 ]
        }
      },
      {
        "padding_1@convert_purchases_to_xbl.padding": {}
      },
      {
        "button_panel": {
          "type": "stack_panel",
          "orientation": "horizontal",
          "size": [ "100%", 30 ],
          "controls": [
            {
              "save_to_xbox_button@common_buttons.light_text_button": {
                "$pressed_button_name": "button.save_to_xbl",
                "$button_text": "xbl.savePurchase.saveButton",
                "size": [ "50% - 1px", 30 ],
                "$button_text_max_size": [ "100%", 20 ],
                "$button_focus_precedence": 10,
                "$focus_override_up": "text_container"
              }
            },
            {
              "padding": {
                "type": "panel",
                "size": [ 2, "100%" ]
              }
            },
            {
              "leave_on_device_button@common_buttons.light_text_button": {
                "$pressed_button_name": "button.leave_on_device",
                "$button_text": "xbl.savePurchase.leaveOnDevice",
                "size": [ "50% - 1px", 30 ],
                "$button_text_max_size": [ "100%", 20 ],
                "$focus_override_up": "text_container"
              }
            }
          ]
        }
      }
    ]
  },

  "description_label_panel": {
    "type": "stack_panel",
    "size": [ "100% - 2px", "default" ],
    "layer": 1,
    "$font_scale": 1.0,
    "controls": [
      {
        "line1": {
          "type": "label",
          "size": [ "100%", "default" ],
          "text": "xbl.savePurchase.description.line1",
          "font_type": "smooth",
          "color": "$body_text_color",
          "font_scale_factor": "$font_scale"
        }
      },
      {
        "padding_0": {
          "type": "panel",
          "size": [ "100%", 5 ]
        }
      },
      {
        "line2": {
          "type": "label",
          "size": [ "100%", "default" ],
          "text": "xbl.savePurchase.description.line2",
          "font_type": "smooth",
          "color": "$body_text_color",
          "font_scale_factor": "$font_scale"
        }
      }
    ]
  },

  // A scrolling_panel must contain a focusable element for gamepad scroll to work.
  "scroll_content_focus_border@common.non_interact_focus_border_button": {
    "$content_inside": "convert_purchases_to_xbl.description_label_panel",
    "$border_size": [ "100%", "100%sm + 2px" ],
    "size": [ "100%", "100%cm" ],
    "$focus_id": "text_container"
  },


  // -----------------------------------------------
  //
  //    screen
  //
  // -----------------------------------------------
  "convert_purchases_to_xbl_screen@common.base_screen": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.leave_on_device",
        "mapping_type": "global"
      }
    ],
    "$screen_content": "convert_purchases_to_xbl.convert_purchases_to_xbl_screen_content"
  },

  "convert_purchases_to_xbl_screen_content": {
    "type": "panel",
    "controls": [
      {
        "root_panel": {
          "type": "panel",
          "controls": [
            { "dialog@convert_purchases_to_xbl.screen_dialog": { "layer": 1 } }
          ]
        }
      }
    ]
  },

  "screen_dialog@common_dialogs.main_panel_no_buttons": {
    "$text_name": "xbl.savePurchase.title",
    "$child_control": "convert_purchases_to_xbl.dialog_content",
    "$show_close_button": false,
    "size": [ 240, 240 ]
  }
}