/********************************************************
+*   (c) Mojang. All rights reserved                       *
+*   (c) Microsoft. All rights reserved.                   *
+*********************************************************/

// Used to control the layout of the Realm Settings screen. Player gets to this screen
// by selecting the "configure" button in the Realms List screen.

{
  "namespace": "realms_common",

  // The "envelope" icon that shows in the header panel if you have a pending invite
  "pending_invites_icon": {
    "type": "image",
    "texture": "textures/ui/invite_base",
    "layer": 5,
    "anchor_from": "bottom_right",
    "anchor_to": "bottom_right",

    "bindings": [
      {
        "binding_name": "#pending_invites_visible",
        "binding_name_override": "#visible",
        "binding_type": "global"
      }
    ],
    "size": [ 16, 16 ]
  },

  "dark_banner": {
    "type": "image",
    "texture": "textures/ui/mainbanners",
    "layer": 1,
    "anchor_from": "top_left",
    "anchor_to": "top_left"
  },

  "dark_banner_hover@dark_banner": {
    "texture": "textures/ui/MainBannersHover"
  },

  // Legacy - do not use
  "legacy_banner": {
    "type": "image",
    "texture": "textures/ui/legacybanner",
    "layer": 1,
    "anchor_from": "top_left",
    "anchor_to": "top_left"
  },

  "main_banner": {
    "type": "image",
    "texture": "textures/ui/mainbanners",
    "layer": 1,
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100% - 6px", "default" ]
  },

  "hollow_banner": {
    "type": "image",
    "texture": "textures/ui/hollowbanner",
    "layer": 1,
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100% - 6px", "default" ]
  },

  "popup_dialog_bg": {
    "type": "image",
    "texture": "textures/ui/dialog_background_opaque"
  },

  //--------------------------------------------------------------------------------
  // Play on Realm Dialog Popup
  //--------------------------------------------------------------------------------
  "popup_dialog__play_on_realm@popup_dialog.modal_input_panel": {
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "play_on_realm_popup_background@realms_common.play_on_realm_popup_background": {
          "layer": 0
        }
      },
      {
        "gamepad_helpers@common.gamepad_helpers_a_and_b": {
          "layer": 0,
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "offset": [ 0, "31px" ]
        }
      },
      {
        "play_on_realm_popup_content@realms_common.play_on_realm_popup_content": {
          "layer": 1
        }
      }
    ]
  },

  "play_on_realm_popup_background": {
    "type": "image",
    "texture": "textures/ui/control",
    "size": [ "300%", "300%" ],
    "alpha": 0.6,
    "anchor_from": "center",
    "anchor_to": "center"
  },

  "play_on_realm_popup_content": {
    "type": "panel",
    "size": [ 300, 200 ],
    "controls": [
      { "popup_dialog_bg@realms_common.popup_dialog_bg": {} },
      { "play_on_realm_popup_dialog_header@realms_common.play_on_realm_popup_dialog_header": {} },
      { "play_on_realm_popup_dialog_upper_body@realms_common.play_on_realm_popup_dialog_upper_body": {} },
      { "play_on_realm_popup_dialog_lower_body@realms_common.play_on_realm_popup_dialog_lower_body": {} }
    ]
  },

  "play_on_realm_popup_dialog_header": {
    "type": "panel",
    "size": [ "100%", "10%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "layer": 1,
    "controls": [
      { "play_on_realm_popup_dialog_header_text@realms_common.play_on_realm_popup_dialog_header_text": {} },
      {
        "close_button@common.close_button": {
          "anchor_from": "top_right",
          "anchor_to": "top_right",
          "offset": [ -1, 1 ],
          "button_mappings": [
            {
              "from_button_id": "button.menu_select",
              "to_button_id": "button.play_on_realm_close",
              "mapping_type": "pressed"
            },
            {
              "from_button_id": "button.menu_ok",
              "to_button_id": "button.play_on_realm_close",
              "mapping_type": "focused"
            }
          ],
          "bindings": [
            {
              "binding_name": "(not #is_using_gamepad)",
              "binding_name_override": "#visible"
            }
          ]
        }
      }
    ]
  },

  "play_on_realm_popup_dialog_header_text": {
    "type": "label",
    "text": "realmsCreateScreen.playNowTitle",
    "font_size": "normal",
    "color": "$title_text_color",
    "anchor_from": "center",
    "anchor_to": "center",
    "offset": [ 0, 2 ]
  },

  "play_on_realm_popup_dialog_upper_body": {
    "type": "panel",
    "size": [ "100%", "53%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "offset": [ 0, "10%" ],
    "layer": 1,
    "controls": [
      {
        "play_on_realm_banner@realms_common.hollow_banner": {
          "anchor_from": "center",
          "anchor_to": "center",
          "size": [ "100%-12px", "100%" ],
          "layer": 1
        }
      },
      {
        "play_on_realm_panel@realms_common.play_on_realm_panel": {}
      },
      {
        "background_panel": {
          "type": "panel",
          "anchor_from": "center",
          "anchor_to": "center",
          "size": [ "100%-14px", "100%-2px" ],
          "layer": 1,
          "controls": [
            {
              "black_background": {
                "type": "image",
                "texture": "textures/ui/Black",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "size": [ "100%", "100%" ]
              }
            }
          ]
        }
      }
    ]
  },

  "play_on_realm_panel": {
    "type": "panel",
    "anchor_from": "center",
    "anchor_to": "center",
    "layer": 2,
    "size": [ "100%-12px", "100%" ],
    "controls": [
      {        
        "play_on_realm_content_panel": {
          "type": "stack_panel",
          "orientation": "horizontal",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "size": [ "100%", "100%" ],
          "controls": [
            {
              "play_image_panel": {
                "type": "stack_panel",
                "orientation": "vertical",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "size": [ "25%", "100%" ],
                "controls": [
                  {
                    "spacing_gap_image": {
                      "type": "panel",
                      "size": [ "100%", 10 ]
                    }
                  },
                  {
                    "realms_image": {
                      "type": "image",
                      "texture": "textures/ui/realms_key_art",
                      "anchor_from": "left_middle",
                      "anchor_to": "left_middle",
                      "size": [ "100%", "75%" ]
                    }
                  }
                ]
              }
            },
            {
              "play_text_panel": {
                "type": "stack_panel",
                "orientation": "vertical",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "size": [ "75%", "100%" ],
                "controls": [
                  {
                    "spacing_gap_text_1": {
                      "type": "panel",
                      "size": [ "100%", 5 ]
                    }
                  },
                  {
                    "play_on_realm_text_1": {
                      "type": "label",
                      "text": "realmsCreateScreen.playNowMessage1",
                      "size": [ "95%", "default" ],
                      "font_size": "normal",
                      "color": "$sub_header_text_color",
                      "anchor_from": "top_left",
                      "anchor_to": "top_left"
                    }
                  },
                  {
                    "spacing_gap_text_2": {
                      "type": "panel",
                      "size": [ "100%", 5 ]
                    }
                  },
                  {
                    "play_on_realm_text_2": {
                      "type": "label",
                      "text": "realmsCreateScreen.playNowMessage2",
                      "size": [ "95%", "default" ],
                      "font_size": "normal",
                      "color": "$sub_header_text_color",
                      "anchor_from": "top_left",
                      "anchor_to": "top_left"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "play_on_realm_popup_dialog_lower_body": {
    "type": "panel",
    "size": [ "100%", "42%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "offset": [ 0, "65%" ],
    "layer": 1,
    "controls": [
      {
        "button_panel": {
          "type": "stack_panel",
          "orientation": "vertical",
          "size": [ "100% - 12px", "100%" ],
          "offset": [ 6, 0 ],
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "controls": [
            {
              "play_with_friends_button@common_buttons.light_text_button": {
                "size": [ "100%", 20 ],
                "anchor_from": "center",
                "anchor_to": "center",
                "$button_text": "realmsCreateScreen.playWithFriends",
                "button_mappings": [
                  {
                    "from_button_id": "button.menu_select",
                    "to_button_id": "button.playWithFriends",
                    "mapping_type": "pressed"
                  },
                  {
                    "from_button_id": "button.menu_ok",
                    "to_button_id": "button.playWithFriends",
                    "mapping_type": "focused"
                  }
                ]
              }
            },
            {
              "spacing_gap1": {
                "type": "panel",
                "size": [ "100%", 2 ]
              }
            },
            {
              "play_solo_button@common_buttons.light_text_button": {
                "size": [ "100%", 20 ],
                "anchor_from": "center",
                "anchor_to": "center",
                "$button_text": "realmsCreateScreen.playSolo",
                "button_mappings": [
                  {
                    "from_button_id": "button.menu_select",
                    "to_button_id": "button.playSolo",
                    "mapping_type": "pressed"
                  },
                  {
                    "from_button_id": "button.menu_ok",
                    "to_button_id": "button.playSolo",
                    "mapping_type": "focused"
                  }
                ]
              }
            },
            {
              "spacing_gap2": {
                "type": "panel",
                "size": [ "100%", 2 ]
              }
            },
            {
              "go_back_button@common_buttons.light_text_button": {
                "size": [ "100%", 20 ],
                "anchor_from": "center",
                "anchor_to": "center",
                "$button_text": "realmsCreateScreen.goBack",
                "button_mappings": [
                  {
                    "from_button_id": "button.menu_select",
                    "to_button_id": "button.play_on_realm_close",
                    "mapping_type": "pressed"
                  },
                  {
                    "from_button_id": "button.menu_ok",
                    "to_button_id": "button.play_on_realm_close",
                    "mapping_type": "focused"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }

}