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

{
  "namespace": "xbl_report_user",

  "hammer_l_icon": {
    "type": "image",
    "texture": "textures/ui/hammer_l",
    "size": [ 15, 15 ]
  },

  "hammer_r_icon": {
    "type": "image",
    "texture": "textures/ui/hammer_r",
    "size": [ 15, 15 ]
  },

  "hammer_l_disabled_icon": {
    "type": "image",
    "texture": "textures/ui/hammer_l_disabled",
    "size": [ 15, 15 ]
  },

  "hammer_r_disabled_icon": {
    "type": "image",
    "texture": "textures/ui/hammer_r_disabled",
    "size": [ 15, 15 ]
  },

  "report_dropdown_panel": {
    "type": "stack_panel",
    "size": [ "100% - 12px", "100%" ],
    "orientation": "horizontal",
    "controls": [
      {
        "label_panel": {
          "type": "panel",
          "size": [ "fill", "100%" ],
          "controls": [
            {
              "report_label@xbl_report_user.report_label": {}
            }
          ]
        }
      },
      {
        "arrow_panel": {
          "type": "panel",
          "layer": 1,
          "size": [ "100%c", "100%" ],
          "controls": [
            {
              "arrow@settings_common.arrow_image": {}
            }
          ]
        }
      }
    ]
  },

  "report_label@common.new_button_label": {
    "layer": 2,
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "size": [ "100%", "default" ],
    "text": "$options_dropdown_toggle_label_binding",
    "bindings": [
      {
        "binding_name": "$options_dropdown_toggle_label_binding"        
      }
    ]
  },

  "dialog_content": {
    "type": "stack_panel",
    "size": [ "100% - 4px", "100% - 4px" ],
    "controls": [
      {
        "padding_0": {
          "type": "panel",
          "size": [ "100%", 1 ]
        }
      },
      {
        "dropdown_visibility_panel": {
          "type": "panel",
          "size": [ "100%", "100%c - 2px" ],
          "controls": [
            {
              "friends_dropdown@settings_common.option_dropdown": {
                "$button_type_panel": "xbl_report_user.report_dropdown_panel",
                "$show_option_label": false,
                "$option_label": "#report_reason_dropdown_toggle_label",
                "$dropdown_content": "xbl_report_user.report_dropdown_content",
                "$dropdown_area": "main_panel",
                "$dropdown_name": "report_reason_dropdown",
                "$options_dropdown_toggle_label_binding": "#report_reason_dropdown_toggle_label",
                "$dropdown_scroll_content_size": [ "100%", 140 ]
              }
            }
          ]
        }
      },
      {
        "text_edit_box@common.text_edit_box": {
          "$text_box_name": "report_reason_text_box",
          "$place_holder_text": "xbox.report.optionalText",
          "$text_edit_box_label_anchor_point": "top_left",
          "$text_edit_box_label_offset": [ 2, 2 ],
          "$text_edit_box_label_size": [ "100% - 6px", "default" ],
          "$place_holder_text_color": "$place_holder_text_color",
          "max_length": 1000, // Max # of W's that can fit in the text box
          //"max_length": 182, // Max # of W's that can fit in the text box
          "size": [ "100%", "fill" ],
          "property_bag": {
            "#property_field": "#additional_report_notes"
          }
        }
      },
      {
        "padding_4": {
          "type": "panel",
          "size": [ "100%", 2 ]
        }
      },
      {
        "report_button@common_buttons.dark_content_button": {
          "size": [ "100%", 30 ],
          "$pressed_button_name": "button.report",
          "$button_content": "xbl_report_user.report_button_content",
          "bindings": [
            {
              "binding_name": "#reason_selected",
              "binding_name_override": "#enabled"
            }
          ]
        }
      }
    ]
  },

  "report_button_content": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100% - 8px", "100%" ],
    "controls": [
      {
        "hammer_icon_panel_l": {
          "type": "panel",
          "size": [ "100%c", "100%" ],
          "controls": [
            {
              "hammer@xbl_report_user.hammer_l_icon": {
                "bindings": [
                  {
                    "binding_name": "#reason_selected",
                    "binding_name_override": "#visible"
                  }
                ]
              }
            },
            {
              "hammer_disabled@xbl_report_user.hammer_l_disabled_icon": {
                "bindings": [
                  {
                    "binding_name": "(not #reason_selected)",
                    "binding_name_override": "#visible"
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "report_label": {
          "type": "panel",
          "size": [ "fill", "100%" ],
          "controls": [
            {
              "report_label": {
                "type": "label",
                "size": [ "default", "default" ],
                "color": "$body_text_color",
                "text": "xbox.profile.report"
              }
            }
          ]
        }
      },
      {
        "hammer_icon_panel_r": {
          "type": "panel",
          "size": [ "100%c", "100%" ],
          "controls": [
            {
              "hammer@xbl_report_user.hammer_r_icon": {
                "bindings": [
                  {
                    "binding_name": "#reason_selected",
                    "binding_name_override": "#visible"
                  }
                ]
              }
            },
            {
              "hammer_disabled@xbl_report_user.hammer_r_disabled_icon": {
                "bindings": [
                  {
                    "binding_name": "(not #reason_selected)",
                    "binding_name_override": "#visible"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "report_dropdown_content@settings_common.option_radio_dropdown_group": {
    "size": [ "100%", "100%c" ],
    "$show_option_label": false,
    "$radio_buttons": [
      {
        "bio_location@settings_common.radio_with_label": {
          "min_size": [ "100%", 22 ],
          "$toggle_state_binding_name": "#bio_location",
          "$radio_label_text": "xbox.report.bioOrLocation"
        }
      },
      {
        "cheating@settings_common.radio_with_label": {
          "min_size": [ "100%", 22 ],
          "$toggle_state_binding_name": "#cheating",
          "$radio_label_text": "xbox.report.cheating"
        }
      },
      {
        "player_name_gamertag@settings_common.radio_with_label": {
          "min_size": [ "100%", 22 ],
          "$toggle_state_binding_name": "#name_or_gametag",
          "$radio_label_text": "xbox.report.nameOrGamertag"
        }
      },
      {
        "quitting@settings_common.radio_with_label": {
          "min_size": [ "100%", 22 ],
          "$toggle_state_binding_name": "#quitting_early",
          "$radio_label_text": "xbox.report.quittingEarly"
        }
      },
      {
        "unsporting@settings_common.radio_with_label": {
          "min_size": [ "100%", 22 ],
          "$toggle_state_binding_name": "#unsporting_behavior",
          "$radio_label_text": "xbox.report.unsportingBehavior"
        }
      },
      {
        "voice_communication@settings_common.radio_with_label": {
          "min_size": [ "100%", 22 ],
          "$toggle_state_binding_name": "#voice_communication",
          "$radio_label_text": "xbox.report.voiceCommunication"
        }
      }
    ]
  },

  "dialog@common_dialogs.main_panel_no_buttons": {
    "$text_name": "$report_gamertag",
    "$child_control": "xbl_report_user.dialog_content",
    "size": [ 190, 175 ]
  },

  "gamepad_helpers": {
    "type": "panel",
    "layer": 2,
    "controls": [
      {
        "gamepad_helper_a@common.gamepad_helper_a": {
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "offset": [ "-10%", "-5%" ]
        }
      },
      {
        "gamepad_helper_b@common.gamepad_helper_b": {
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "offset": [ "10%", "-5%" ]
        }
      }
    ]
  },

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

  "xbl_report_user_screen_content": {
    "type": "panel",
    "controls": [
      { "gamepad_helpers@xbl_report_user.gamepad_helpers": {} },
      { "main_panel@xbl_report_user.dialog": { "layer": 1 } }
    ]
  }
}